From 90edb9374973082f423115720414b2a1cf7cd8ae Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 10 Jun 2022 06:57:46 +0000 Subject: [PATCH] CodeGen from PR 19389 in Azure/azure-rest-api-specs [Go] Add go track2 config (#19389) * [Go] Add go track2 config * add powerplatform multi-api * other * fix * fix * cancel devspace * cancel iotspaces --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../README.md | 102 ++ .../SAMPLE.md | 422 +++++ .../pom.xml | 55 + .../EngagementFabricManager.java | 346 ++++ .../fluent/AccountsClient.java | 265 +++ .../fluent/ChannelsClient.java | 133 ++ .../fluent/EngagementFabric.java | 81 + .../fluent/OperationsClient.java | 36 + .../fluent/ResourceProvidersClient.java | 44 + .../engagementfabric/fluent/SKUsClient.java | 36 + .../fluent/models/AccountInner.java | 73 + .../fluent/models/ChannelInner.java | 112 ++ .../fluent/models/ChannelProperties.java | 110 ++ .../ChannelTypeDescriptionListInner.java | 51 + .../CheckNameAvailabilityResultInner.java | 66 + .../fluent/models/KeyDescriptionInner.java | 66 + .../fluent/models/OperationInner.java | 54 + .../fluent/models/SkuDescriptionInner.java | 115 ++ .../fluent/models/package-info.java | 6 + .../engagementfabric/fluent/package-info.java | 6 + .../implementation/AccountImpl.java | 217 +++ .../implementation/AccountsClientImpl.java | 1555 +++++++++++++++++ .../implementation/AccountsImpl.java | 234 +++ .../implementation/ChannelImpl.java | 172 ++ .../ChannelTypeDescriptionListImpl.java | 41 + .../implementation/ChannelsClientImpl.java | 773 ++++++++ .../implementation/ChannelsImpl.java | 188 ++ .../CheckNameAvailabilityResultImpl.java | 42 + .../EngagementFabricBuilder.java | 142 ++ .../implementation/EngagementFabricImpl.java | 346 ++++ .../implementation/KeyDescriptionImpl.java | 42 + .../implementation/OperationImpl.java | 37 + .../implementation/OperationsClientImpl.java | 175 ++ .../implementation/OperationsImpl.java | 46 + .../ResourceProvidersClientImpl.java | 221 +++ .../implementation/ResourceProvidersImpl.java | 64 + .../implementation/SKUsClientImpl.java | 200 +++ .../implementation/SKUsImpl.java | 45 + .../implementation/SkuDescriptionImpl.java | 71 + .../implementation/Utils.java | 204 +++ .../implementation/package-info.java | 6 + .../engagementfabric/models/Account.java | 282 +++ .../engagementfabric/models/AccountList.java | 51 + .../engagementfabric/models/AccountPatch.java | 49 + .../engagementfabric/models/Accounts.java | 236 +++ .../engagementfabric/models/Channel.java | 216 +++ .../engagementfabric/models/ChannelList.java | 51 + .../models/ChannelTypeDescription.java | 99 ++ .../models/ChannelTypeDescriptionList.java | 25 + .../engagementfabric/models/Channels.java | 145 ++ .../CheckNameAvailabilityParameter.java | 87 + .../models/CheckNameAvailabilityResult.java | 38 + .../models/CheckNameUnavailableReason.java | 38 + .../models/KeyDescription.java | 38 + .../models/KeyDescriptionList.java | 40 + .../engagementfabric/models/KeyRank.java | 38 + .../engagementfabric/models/Operation.java | 31 + .../models/OperationDisplay.java | 80 + .../models/OperationList.java | 40 + .../engagementfabric/models/Operations.java | 31 + .../models/ProxyOnlyResource.java | 20 + .../models/RegenerateKeyParameter.java | 85 + .../models/ResourceProviders.java | 38 + .../engagementfabric/models/SKUs.java | 31 + .../engagementfabric/models/Sku.java | 79 + .../models/SkuDescription.java | 60 + .../models/SkuDescriptionList.java | 40 + .../models/SkuLocationInfoItem.java | 73 + .../engagementfabric/models/package-info.java | 6 + .../engagementfabric/package-info.java | 6 + .../src/main/java/module-info.java | 19 + .../AccountsCreateOrUpdateSamples.java | 29 + .../generated/AccountsDeleteSamples.java | 23 + .../AccountsGetByResourceGroupSamples.java | 22 + .../AccountsListByResourceGroupSamples.java | 23 + .../AccountsListChannelTypesSamples.java | 23 + .../generated/AccountsListKeysSamples.java | 23 + .../generated/AccountsListSamples.java | 22 + .../AccountsRegenerateKeySamples.java | 23 + .../generated/AccountsUpdateSamples.java | 39 + .../ChannelsCreateOrUpdateSamples.java | 43 + .../generated/ChannelsDeleteSamples.java | 23 + .../generated/ChannelsGetSamples.java | 22 + .../ChannelsListByAccountSamples.java | 22 + .../generated/OperationsListSamples.java | 23 + ...eProviderCheckNameAvailabilitySamples.java | 23 + .../generated/SKUsListSamples.java | 22 + sdk/engagementfabric/ci.yml | 39 + sdk/engagementfabric/pom.xml | 53 + 92 files changed, 9576 insertions(+) create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/CHANGELOG.md create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/README.md create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/SAMPLE.md create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/pom.xml create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/EngagementFabricManager.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/AccountsClient.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/ChannelsClient.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/EngagementFabric.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/OperationsClient.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/ResourceProvidersClient.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/SKUsClient.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/AccountInner.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/ChannelInner.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/ChannelProperties.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/ChannelTypeDescriptionListInner.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/CheckNameAvailabilityResultInner.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/KeyDescriptionInner.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/OperationInner.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/SkuDescriptionInner.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/package-info.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/package-info.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/AccountImpl.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/AccountsClientImpl.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/AccountsImpl.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/ChannelImpl.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/ChannelTypeDescriptionListImpl.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/ChannelsClientImpl.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/ChannelsImpl.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/CheckNameAvailabilityResultImpl.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/EngagementFabricBuilder.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/EngagementFabricImpl.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/KeyDescriptionImpl.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/OperationImpl.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/OperationsClientImpl.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/OperationsImpl.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/ResourceProvidersClientImpl.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/ResourceProvidersImpl.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/SKUsClientImpl.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/SKUsImpl.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/SkuDescriptionImpl.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/Utils.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/package-info.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/Account.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/AccountList.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/AccountPatch.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/Accounts.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/Channel.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/ChannelList.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/ChannelTypeDescription.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/ChannelTypeDescriptionList.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/Channels.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/CheckNameAvailabilityParameter.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/CheckNameAvailabilityResult.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/CheckNameUnavailableReason.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/KeyDescription.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/KeyDescriptionList.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/KeyRank.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/Operation.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/OperationDisplay.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/OperationList.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/Operations.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/ProxyOnlyResource.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/RegenerateKeyParameter.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/ResourceProviders.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/SKUs.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/Sku.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/SkuDescription.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/SkuDescriptionList.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/SkuLocationInfoItem.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/package-info.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/package-info.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/module-info.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsCreateOrUpdateSamples.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsDeleteSamples.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsGetByResourceGroupSamples.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsListByResourceGroupSamples.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsListChannelTypesSamples.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsListKeysSamples.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsListSamples.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsRegenerateKeySamples.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsUpdateSamples.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/ChannelsCreateOrUpdateSamples.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/ChannelsDeleteSamples.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/ChannelsGetSamples.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/ChannelsListByAccountSamples.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/OperationsListSamples.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/ResourceProviderCheckNameAvailabilitySamples.java create mode 100644 sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/SKUsListSamples.java create mode 100644 sdk/engagementfabric/ci.yml create mode 100644 sdk/engagementfabric/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index e81b6ef0c200..ea8012dc866b 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -350,6 +350,7 @@ com.azure.resourcemanager:azure-resourcemanager-dynatrace;1.0.0-beta.1;1.0.0-bet com.azure.resourcemanager:azure-resourcemanager-deviceupdate;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-machinelearning;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-education;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-engagementfabric;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0-beta.1;1.0.0-beta.2 diff --git a/pom.xml b/pom.xml index 28f19ed8c5ca..143d15270a5d 100644 --- a/pom.xml +++ b/pom.xml @@ -899,6 +899,7 @@ sdk/edgeorder sdk/education sdk/elastic + sdk/engagementfabric sdk/eventgrid sdk/eventhubs sdk/extendedlocation diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/CHANGELOG.md b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/CHANGELOG.md new file mode 100644 index 000000000000..5c104b9fb280 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-06-10) + +- Azure Resource Manager EngagementFabric client library for Java. This package contains Microsoft Azure SDK for EngagementFabric Management SDK. Microsoft Customer Engagement Fabric. Package tag package-2018-09-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/README.md b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/README.md new file mode 100644 index 000000000000..96d75295fd74 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager EngagementFabric client library for Java + +Azure Resource Manager EngagementFabric client library for Java. + +This package contains Microsoft Azure SDK for EngagementFabric Management SDK. Microsoft Customer Engagement Fabric. Package tag package-2018-09-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-engagementfabric;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-engagementfabric + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +EngagementFabricManager manager = EngagementFabricManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/engagementfabric/azure-resourcemanager-engagementfabric/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/SAMPLE.md b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/SAMPLE.md new file mode 100644 index 000000000000..a39bab69b40d --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/SAMPLE.md @@ -0,0 +1,422 @@ +# Code snippets and samples + + +## Accounts + +- [CreateOrUpdate](#accounts_createorupdate) +- [Delete](#accounts_delete) +- [GetByResourceGroup](#accounts_getbyresourcegroup) +- [List](#accounts_list) +- [ListByResourceGroup](#accounts_listbyresourcegroup) +- [ListChannelTypes](#accounts_listchanneltypes) +- [ListKeys](#accounts_listkeys) +- [RegenerateKey](#accounts_regeneratekey) +- [Update](#accounts_update) + +## Channels + +- [CreateOrUpdate](#channels_createorupdate) +- [Delete](#channels_delete) +- [Get](#channels_get) +- [ListByAccount](#channels_listbyaccount) + +## Operations + +- [List](#operations_list) + +## ResourceProvider + +- [CheckNameAvailability](#resourceprovider_checknameavailability) + +## SKUs + +- [List](#skus_list) +### Accounts_CreateOrUpdate + +```java +import com.azure.resourcemanager.engagementfabric.models.Sku; + +/** Samples for Accounts CreateOrUpdate. */ +public final class AccountsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/engagementfabric/resource-manager/Microsoft.EngagementFabric/preview/2018-09-01/examples/AccountsCreateOrUpdateExample.json + */ + /** + * Sample code: AccountsCreateOrUpdateExample. + * + * @param manager Entry point to EngagementFabricManager. + */ + public static void accountsCreateOrUpdateExample( + com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager) { + manager + .accounts() + .define("ExampleAccount") + .withRegion("WestUS") + .withExistingResourceGroup("ExampleRg") + .withSku(new Sku().withName("B1")) + .create(); + } +} +``` + +### Accounts_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Accounts Delete. */ +public final class AccountsDeleteSamples { + /* + * x-ms-original-file: specification/engagementfabric/resource-manager/Microsoft.EngagementFabric/preview/2018-09-01/examples/AccountsDeleteExample.json + */ + /** + * Sample code: AccountsDeleteExample. + * + * @param manager Entry point to EngagementFabricManager. + */ + public static void accountsDeleteExample( + com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager) { + manager.accounts().deleteWithResponse("ExampleRg", "ExampleAccount", Context.NONE); + } +} +``` + +### Accounts_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Accounts GetByResourceGroup. */ +public final class AccountsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/engagementfabric/resource-manager/Microsoft.EngagementFabric/preview/2018-09-01/examples/AccountsGetExample.json + */ + /** + * Sample code: AccountsGetExample. + * + * @param manager Entry point to EngagementFabricManager. + */ + public static void accountsGetExample(com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager) { + manager.accounts().getByResourceGroupWithResponse("ExampleRg", "ExampleAccount", Context.NONE); + } +} +``` + +### Accounts_List + +```java +import com.azure.core.util.Context; + +/** Samples for Accounts List. */ +public final class AccountsListSamples { + /* + * x-ms-original-file: specification/engagementfabric/resource-manager/Microsoft.EngagementFabric/preview/2018-09-01/examples/AccountsListExample.json + */ + /** + * Sample code: AccountsListExample. + * + * @param manager Entry point to EngagementFabricManager. + */ + public static void accountsListExample(com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager) { + manager.accounts().list(Context.NONE); + } +} +``` + +### Accounts_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Accounts ListByResourceGroup. */ +public final class AccountsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/engagementfabric/resource-manager/Microsoft.EngagementFabric/preview/2018-09-01/examples/AccountsListByResourceGroupExample.json + */ + /** + * Sample code: AccountsListByResourceGroupExample. + * + * @param manager Entry point to EngagementFabricManager. + */ + public static void accountsListByResourceGroupExample( + com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager) { + manager.accounts().listByResourceGroup("ExampleRg", Context.NONE); + } +} +``` + +### Accounts_ListChannelTypes + +```java +import com.azure.core.util.Context; + +/** Samples for Accounts ListChannelTypes. */ +public final class AccountsListChannelTypesSamples { + /* + * x-ms-original-file: specification/engagementfabric/resource-manager/Microsoft.EngagementFabric/preview/2018-09-01/examples/AccountsListChannelTypesExample.json + */ + /** + * Sample code: AccountsListChannelTypesExample. + * + * @param manager Entry point to EngagementFabricManager. + */ + public static void accountsListChannelTypesExample( + com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager) { + manager.accounts().listChannelTypesWithResponse("ExampleRg", "ExampleAccount", Context.NONE); + } +} +``` + +### Accounts_ListKeys + +```java +import com.azure.core.util.Context; + +/** Samples for Accounts ListKeys. */ +public final class AccountsListKeysSamples { + /* + * x-ms-original-file: specification/engagementfabric/resource-manager/Microsoft.EngagementFabric/preview/2018-09-01/examples/AccountsListKeysExample.json + */ + /** + * Sample code: AccountsListKeysExample. + * + * @param manager Entry point to EngagementFabricManager. + */ + public static void accountsListKeysExample( + com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager) { + manager.accounts().listKeys("ExampleRg", "ExampleAccount", Context.NONE); + } +} +``` + +### Accounts_RegenerateKey + +```java +import com.azure.core.util.Context; + +/** Samples for Accounts RegenerateKey. */ +public final class AccountsRegenerateKeySamples { + /* + * x-ms-original-file: specification/engagementfabric/resource-manager/Microsoft.EngagementFabric/preview/2018-09-01/examples/AccountsRegenerateKeyExample.json + */ + /** + * Sample code: AccountsRegenerateKeyExample. + * + * @param manager Entry point to EngagementFabricManager. + */ + public static void accountsRegenerateKeyExample( + com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager) { + manager.accounts().regenerateKeyWithResponse("ExampleRg", "ExampleAccount", null, Context.NONE); + } +} +``` + +### Accounts_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.engagementfabric.models.Account; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Accounts Update. */ +public final class AccountsUpdateSamples { + /* + * x-ms-original-file: specification/engagementfabric/resource-manager/Microsoft.EngagementFabric/preview/2018-09-01/examples/AccountsUpdateExample.json + */ + /** + * Sample code: AccountsUpdateExample. + * + * @param manager Entry point to EngagementFabricManager. + */ + public static void accountsUpdateExample( + com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager) { + Account resource = + manager.accounts().getByResourceGroupWithResponse("ExampleRg", "ExampleAccount", Context.NONE).getValue(); + resource.update().withTags(mapOf("tagName", "tagValue")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Channels_CreateOrUpdate + +```java +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Channels CreateOrUpdate. */ +public final class ChannelsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/engagementfabric/resource-manager/Microsoft.EngagementFabric/preview/2018-09-01/examples/ChannelsCreateOrUpdateExample.json + */ + /** + * Sample code: ChannelsCreateOrUpdateExample. + * + * @param manager Entry point to EngagementFabricManager. + */ + public static void channelsCreateOrUpdateExample( + com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager) { + manager + .channels() + .define("ExampleChannel") + .withExistingAccount("ExampleRg", "ExampleAccount") + .withChannelType("MockChannel") + .withChannelFunctions(Arrays.asList("MockFunction1", "MockFunction2")) + .withCredentials(mapOf("AppId", "exampleApp", "AppKey", "exampleAppKey")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Channels_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Channels Delete. */ +public final class ChannelsDeleteSamples { + /* + * x-ms-original-file: specification/engagementfabric/resource-manager/Microsoft.EngagementFabric/preview/2018-09-01/examples/ChannelsDeleteExample.json + */ + /** + * Sample code: ChannelsDeleteExample. + * + * @param manager Entry point to EngagementFabricManager. + */ + public static void channelsDeleteExample( + com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager) { + manager.channels().deleteWithResponse("ExampleRg", "ExampleAccount", "ExampleChannel", Context.NONE); + } +} +``` + +### Channels_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Channels Get. */ +public final class ChannelsGetSamples { + /* + * x-ms-original-file: specification/engagementfabric/resource-manager/Microsoft.EngagementFabric/preview/2018-09-01/examples/ChannelsGetExample.json + */ + /** + * Sample code: ChannelsGetExample. + * + * @param manager Entry point to EngagementFabricManager. + */ + public static void channelsGetExample(com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager) { + manager.channels().getWithResponse("ExampleRg", "ExampleAccount", "ExampleChannel", Context.NONE); + } +} +``` + +### Channels_ListByAccount + +```java +import com.azure.core.util.Context; + +/** Samples for Channels ListByAccount. */ +public final class ChannelsListByAccountSamples { + /* + * x-ms-original-file: specification/engagementfabric/resource-manager/Microsoft.EngagementFabric/preview/2018-09-01/examples/ChannelsListExample.json + */ + /** + * Sample code: ChannelsListExample. + * + * @param manager Entry point to EngagementFabricManager. + */ + public static void channelsListExample(com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager) { + manager.channels().listByAccount("ExampleRg", "ExampleAccount", Context.NONE); + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/engagementfabric/resource-manager/Microsoft.EngagementFabric/preview/2018-09-01/examples/OperationsListExample.json + */ + /** + * Sample code: OperationsListExample. + * + * @param manager Entry point to EngagementFabricManager. + */ + public static void operationsListExample( + com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### ResourceProvider_CheckNameAvailability + +```java +import com.azure.core.util.Context; + +/** Samples for ResourceProvider CheckNameAvailability. */ +public final class ResourceProviderCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/engagementfabric/resource-manager/Microsoft.EngagementFabric/preview/2018-09-01/examples/CheckNameAvailabilityExample.json + */ + /** + * Sample code: CheckNameAvailabilityExample. + * + * @param manager Entry point to EngagementFabricManager. + */ + public static void checkNameAvailabilityExample( + com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager) { + manager.resourceProviders().checkNameAvailabilityWithResponse(null, null, Context.NONE); + } +} +``` + +### SKUs_List + +```java +import com.azure.core.util.Context; + +/** Samples for SKUs List. */ +public final class SKUsListSamples { + /* + * x-ms-original-file: specification/engagementfabric/resource-manager/Microsoft.EngagementFabric/preview/2018-09-01/examples/SKUsListExample.json + */ + /** + * Sample code: SKUsListExample. + * + * @param manager Entry point to EngagementFabricManager. + */ + public static void sKUsListExample(com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager) { + manager.sKUs().list(Context.NONE); + } +} +``` + diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/pom.xml b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/pom.xml new file mode 100644 index 000000000000..22ff1b52233e --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/pom.xml @@ -0,0 +1,55 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-engagementfabric + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for EngagementFabric Management + This package contains Microsoft Azure SDK for EngagementFabric Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft Customer Engagement Fabric. Package tag package-2018-09-preview. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.29.1 + + + com.azure + azure-core-management + 1.6.2 + + + diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/EngagementFabricManager.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/EngagementFabricManager.java new file mode 100644 index 000000000000..4d957300c10d --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/EngagementFabricManager.java @@ -0,0 +1,346 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.engagementfabric.fluent.EngagementFabric; +import com.azure.resourcemanager.engagementfabric.implementation.AccountsImpl; +import com.azure.resourcemanager.engagementfabric.implementation.ChannelsImpl; +import com.azure.resourcemanager.engagementfabric.implementation.EngagementFabricBuilder; +import com.azure.resourcemanager.engagementfabric.implementation.OperationsImpl; +import com.azure.resourcemanager.engagementfabric.implementation.ResourceProvidersImpl; +import com.azure.resourcemanager.engagementfabric.implementation.SKUsImpl; +import com.azure.resourcemanager.engagementfabric.models.Accounts; +import com.azure.resourcemanager.engagementfabric.models.Channels; +import com.azure.resourcemanager.engagementfabric.models.Operations; +import com.azure.resourcemanager.engagementfabric.models.ResourceProviders; +import com.azure.resourcemanager.engagementfabric.models.SKUs; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** Entry point to EngagementFabricManager. Microsoft Customer Engagement Fabric. */ +public final class EngagementFabricManager { + private Accounts accounts; + + private Channels channels; + + private ResourceProviders resourceProviders; + + private Operations operations; + + private SKUs sKUs; + + private final EngagementFabric clientObject; + + private EngagementFabricManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new EngagementFabricBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of EngagementFabric service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the EngagementFabric service API instance. + */ + public static EngagementFabricManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of EngagementFabric service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the EngagementFabric service API instance. + */ + public static EngagementFabricManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new EngagementFabricManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create EngagementFabricManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new EngagementFabricManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of EngagementFabric service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the EngagementFabric service API instance. + */ + public EngagementFabricManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.engagementfabric") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new EngagementFabricManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of Accounts. It manages Account. + * + * @return Resource collection API of Accounts. + */ + public Accounts accounts() { + if (this.accounts == null) { + this.accounts = new AccountsImpl(clientObject.getAccounts(), this); + } + return accounts; + } + + /** + * Gets the resource collection API of Channels. It manages Channel. + * + * @return Resource collection API of Channels. + */ + public Channels channels() { + if (this.channels == null) { + this.channels = new ChannelsImpl(clientObject.getChannels(), this); + } + return channels; + } + + /** + * Gets the resource collection API of ResourceProviders. + * + * @return Resource collection API of ResourceProviders. + */ + public ResourceProviders resourceProviders() { + if (this.resourceProviders == null) { + this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this); + } + return resourceProviders; + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of SKUs. + * + * @return Resource collection API of SKUs. + */ + public SKUs sKUs() { + if (this.sKUs == null) { + this.sKUs = new SKUsImpl(clientObject.getSKUs(), this); + } + return sKUs; + } + + /** + * @return Wrapped service client EngagementFabric providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + */ + public EngagementFabric serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/AccountsClient.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/AccountsClient.java new file mode 100644 index 000000000000..7e23462d068b --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/AccountsClient.java @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.engagementfabric.fluent.models.AccountInner; +import com.azure.resourcemanager.engagementfabric.fluent.models.ChannelTypeDescriptionListInner; +import com.azure.resourcemanager.engagementfabric.fluent.models.KeyDescriptionInner; +import com.azure.resourcemanager.engagementfabric.models.AccountPatch; +import com.azure.resourcemanager.engagementfabric.models.RegenerateKeyParameter; + +/** An instance of this class provides access to all the operations defined in AccountsClient. */ +public interface AccountsClient { + /** + * Get the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccountInner getByResourceGroup(String resourceGroupName, String accountName); + + /** + * Get the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String accountName, Context context); + + /** + * Create or Update the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param account The EngagementFabric account description. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccountInner createOrUpdate(String resourceGroupName, String accountName, AccountInner account); + + /** + * Create or Update the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param account The EngagementFabric account description. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String accountName, AccountInner account, Context context); + + /** + * Delete the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName); + + /** + * Delete the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * Update EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param accountPatch The account patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccountInner update(String resourceGroupName, String accountName, AccountPatch accountPatch); + + /** + * Update EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param accountPatch The account patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String accountName, AccountPatch accountPatch, Context context); + + /** + * List the EngagementFabric accounts in given subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric accounts as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List the EngagementFabric accounts in given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric accounts as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List EngagementFabric accounts in given resource group. + * + * @param resourceGroupName Resource Group Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric accounts as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List EngagementFabric accounts in given resource group. + * + * @param resourceGroupName Resource Group Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric accounts as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List keys of the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric account keys as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listKeys(String resourceGroupName, String accountName); + + /** + * List keys of the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric account keys as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listKeys(String resourceGroupName, String accountName, Context context); + + /** + * Regenerate key of the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param parameter Parameters specifying the key to be regenerated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of the EngagementFabric account key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KeyDescriptionInner regenerateKey(String resourceGroupName, String accountName, RegenerateKeyParameter parameter); + + /** + * Regenerate key of the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param parameter Parameters specifying the key to be regenerated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of the EngagementFabric account key along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response regenerateKeyWithResponse( + String resourceGroupName, String accountName, RegenerateKeyParameter parameter, Context context); + + /** + * List available EngagementFabric channel types and functions. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of the EngagementFabric channel descriptions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ChannelTypeDescriptionListInner listChannelTypes(String resourceGroupName, String accountName); + + /** + * List available EngagementFabric channel types and functions. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of the EngagementFabric channel descriptions along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listChannelTypesWithResponse( + String resourceGroupName, String accountName, Context context); +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/ChannelsClient.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/ChannelsClient.java new file mode 100644 index 000000000000..7bc0d3ed8d4e --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/ChannelsClient.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.engagementfabric.fluent.models.ChannelInner; + +/** An instance of this class provides access to all the operations defined in ChannelsClient. */ +public interface ChannelsClient { + /** + * Get the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param channelName Channel Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric channel. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ChannelInner get(String resourceGroupName, String accountName, String channelName); + + /** + * Get the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param channelName Channel Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric channel along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, String channelName, Context context); + + /** + * Create or Update the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param channelName Channel Name. + * @param channel The EngagementFabric channel description. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric channel. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ChannelInner createOrUpdate(String resourceGroupName, String accountName, String channelName, ChannelInner channel); + + /** + * Create or Update the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param channelName Channel Name. + * @param channel The EngagementFabric channel description. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric channel along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String accountName, String channelName, ChannelInner channel, Context context); + + /** + * Delete the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param channelName The EngagementFabric channel name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String channelName); + + /** + * Delete the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param channelName The EngagementFabric channel name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String accountName, String channelName, Context context); + + /** + * List the EngagementFabric channels. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric channels as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByAccount(String resourceGroupName, String accountName); + + /** + * List the EngagementFabric channels. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric channels as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByAccount(String resourceGroupName, String accountName, Context context); +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/EngagementFabric.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/EngagementFabric.java new file mode 100644 index 000000000000..8c5d312c75c3 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/EngagementFabric.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for EngagementFabric class. */ +public interface EngagementFabric { + /** + * Gets Subscription ID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the AccountsClient object to access its operations. + * + * @return the AccountsClient object. + */ + AccountsClient getAccounts(); + + /** + * Gets the ChannelsClient object to access its operations. + * + * @return the ChannelsClient object. + */ + ChannelsClient getChannels(); + + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + ResourceProvidersClient getResourceProviders(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the SKUsClient object to access its operations. + * + * @return the SKUsClient object. + */ + SKUsClient getSKUs(); +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/OperationsClient.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/OperationsClient.java new file mode 100644 index 000000000000..5661551dafd9 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/OperationsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.engagementfabric.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * List operation of EngagementFabric resources. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List operation of EngagementFabric resources. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/ResourceProvidersClient.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/ResourceProvidersClient.java new file mode 100644 index 000000000000..eaecc66a7096 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/ResourceProvidersClient.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.engagementfabric.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.engagementfabric.models.CheckNameAvailabilityParameter; + +/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ +public interface ResourceProvidersClient { + /** + * Check availability of EngagementFabric resource. + * + * @param resourceGroupName Resource Group Name. + * @param parameters Parameter describing the name to be checked. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of name availability check. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameAvailabilityResultInner checkNameAvailability( + String resourceGroupName, CheckNameAvailabilityParameter parameters); + + /** + * Check availability of EngagementFabric resource. + * + * @param resourceGroupName Resource Group Name. + * @param parameters Parameter describing the name to be checked. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of name availability check along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + String resourceGroupName, CheckNameAvailabilityParameter parameters, Context context); +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/SKUsClient.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/SKUsClient.java new file mode 100644 index 000000000000..29e1bbdba57f --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/SKUsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.engagementfabric.fluent.models.SkuDescriptionInner; + +/** An instance of this class provides access to all the operations defined in SKUsClient. */ +public interface SKUsClient { + /** + * List available SKUs of EngagementFabric resource. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric SKU descriptions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List available SKUs of EngagementFabric resource. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric SKU descriptions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/AccountInner.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/AccountInner.java new file mode 100644 index 000000000000..da1b9ecd0942 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/AccountInner.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.engagementfabric.models.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The EngagementFabric account. */ +@Fluent +public final class AccountInner extends Resource { + /* + * The SKU of the resource + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /** + * Get the sku property: The SKU of the resource. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU of the resource. + * + * @param sku the sku value to set. + * @return the AccountInner object itself. + */ + public AccountInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** {@inheritDoc} */ + @Override + public AccountInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public AccountInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property sku in model AccountInner")); + } else { + sku().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AccountInner.class); +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/ChannelInner.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/ChannelInner.java new file mode 100644 index 000000000000..86cb1852c352 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/ChannelInner.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.engagementfabric.models.ProxyOnlyResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The EngagementFabric channel. */ +@Fluent +public final class ChannelInner extends ProxyOnlyResource { + /* + * The properties of the channel + */ + @JsonProperty(value = "properties") + private ChannelProperties innerProperties; + + /** + * Get the innerProperties property: The properties of the channel. + * + * @return the innerProperties value. + */ + private ChannelProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the channelType property: The channel type. + * + * @return the channelType value. + */ + public String channelType() { + return this.innerProperties() == null ? null : this.innerProperties().channelType(); + } + + /** + * Set the channelType property: The channel type. + * + * @param channelType the channelType value to set. + * @return the ChannelInner object itself. + */ + public ChannelInner withChannelType(String channelType) { + if (this.innerProperties() == null) { + this.innerProperties = new ChannelProperties(); + } + this.innerProperties().withChannelType(channelType); + return this; + } + + /** + * Get the channelFunctions property: The functions to be enabled for the channel. + * + * @return the channelFunctions value. + */ + public List channelFunctions() { + return this.innerProperties() == null ? null : this.innerProperties().channelFunctions(); + } + + /** + * Set the channelFunctions property: The functions to be enabled for the channel. + * + * @param channelFunctions the channelFunctions value to set. + * @return the ChannelInner object itself. + */ + public ChannelInner withChannelFunctions(List channelFunctions) { + if (this.innerProperties() == null) { + this.innerProperties = new ChannelProperties(); + } + this.innerProperties().withChannelFunctions(channelFunctions); + return this; + } + + /** + * Get the credentials property: The channel credentials. + * + * @return the credentials value. + */ + public Map credentials() { + return this.innerProperties() == null ? null : this.innerProperties().credentials(); + } + + /** + * Set the credentials property: The channel credentials. + * + * @param credentials the credentials value to set. + * @return the ChannelInner object itself. + */ + public ChannelInner withCredentials(Map credentials) { + if (this.innerProperties() == null) { + this.innerProperties = new ChannelProperties(); + } + this.innerProperties().withCredentials(credentials); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/ChannelProperties.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/ChannelProperties.java new file mode 100644 index 000000000000..8485048c4d42 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/ChannelProperties.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The EngagementFabric channel properties. */ +@Fluent +public final class ChannelProperties { + /* + * The channel type + */ + @JsonProperty(value = "channelType", required = true) + private String channelType; + + /* + * The functions to be enabled for the channel + */ + @JsonProperty(value = "channelFunctions") + private List channelFunctions; + + /* + * The channel credentials + */ + @JsonProperty(value = "credentials") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map credentials; + + /** + * Get the channelType property: The channel type. + * + * @return the channelType value. + */ + public String channelType() { + return this.channelType; + } + + /** + * Set the channelType property: The channel type. + * + * @param channelType the channelType value to set. + * @return the ChannelProperties object itself. + */ + public ChannelProperties withChannelType(String channelType) { + this.channelType = channelType; + return this; + } + + /** + * Get the channelFunctions property: The functions to be enabled for the channel. + * + * @return the channelFunctions value. + */ + public List channelFunctions() { + return this.channelFunctions; + } + + /** + * Set the channelFunctions property: The functions to be enabled for the channel. + * + * @param channelFunctions the channelFunctions value to set. + * @return the ChannelProperties object itself. + */ + public ChannelProperties withChannelFunctions(List channelFunctions) { + this.channelFunctions = channelFunctions; + return this; + } + + /** + * Get the credentials property: The channel credentials. + * + * @return the credentials value. + */ + public Map credentials() { + return this.credentials; + } + + /** + * Set the credentials property: The channel credentials. + * + * @param credentials the credentials value to set. + * @return the ChannelProperties object itself. + */ + public ChannelProperties withCredentials(Map credentials) { + this.credentials = credentials; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (channelType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property channelType in model ChannelProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ChannelProperties.class); +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/ChannelTypeDescriptionListInner.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/ChannelTypeDescriptionListInner.java new file mode 100644 index 000000000000..9519910fbbc2 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/ChannelTypeDescriptionListInner.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.engagementfabric.models.ChannelTypeDescription; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of the EngagementFabric channel descriptions. */ +@Fluent +public final class ChannelTypeDescriptionListInner { + /* + * Channel descriptions + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: Channel descriptions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Channel descriptions. + * + * @param value the value value to set. + * @return the ChannelTypeDescriptionListInner object itself. + */ + public ChannelTypeDescriptionListInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/CheckNameAvailabilityResultInner.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/CheckNameAvailabilityResultInner.java new file mode 100644 index 000000000000..fed283a87470 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/CheckNameAvailabilityResultInner.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.engagementfabric.models.CheckNameUnavailableReason; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The result of name availability check. */ +@Immutable +public final class CheckNameAvailabilityResultInner { + /* + * The name to be checked + */ + @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean nameAvailable; + + /* + * The reason if name is unavailable + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private CheckNameUnavailableReason reason; + + /* + * The message if name is unavailable + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get the nameAvailable property: The name to be checked. + * + * @return the nameAvailable value. + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Get the reason property: The reason if name is unavailable. + * + * @return the reason value. + */ + public CheckNameUnavailableReason reason() { + return this.reason; + } + + /** + * Get the message property: The message if name is unavailable. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/KeyDescriptionInner.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/KeyDescriptionInner.java new file mode 100644 index 000000000000..45406465312f --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/KeyDescriptionInner.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.engagementfabric.models.KeyRank; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The description of the EngagementFabric account key. */ +@Immutable +public final class KeyDescriptionInner { + /* + * The name of the key + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The rank of the key + */ + @JsonProperty(value = "rank", access = JsonProperty.Access.WRITE_ONLY) + private KeyRank rank; + + /* + * The value of the key + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Get the name property: The name of the key. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the rank property: The rank of the key. + * + * @return the rank value. + */ + public KeyRank rank() { + return this.rank; + } + + /** + * Get the value property: The value of the key. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/OperationInner.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/OperationInner.java new file mode 100644 index 000000000000..ce982b9e8c94 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/OperationInner.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.engagementfabric.models.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The EngagementFabric operation. */ +@Immutable +public final class OperationInner { + /* + * The name of the EngagementFabric operation + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The display content of the EngagementFabric operation + */ + @JsonProperty(value = "display", access = JsonProperty.Access.WRITE_ONLY) + private OperationDisplay display; + + /** + * Get the name property: The name of the EngagementFabric operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the display property: The display content of the EngagementFabric operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/SkuDescriptionInner.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/SkuDescriptionInner.java new file mode 100644 index 000000000000..6134a4831cb0 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/SkuDescriptionInner.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.engagementfabric.models.SkuLocationInfoItem; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The EngagementFabric SKU description of given resource type. */ +@Immutable +public final class SkuDescriptionInner { + /* + * The fully qualified resource type + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /* + * The name of the SKU + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The price tier of the SKU + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private String tier; + + /* + * The set of locations that the SKU is available + */ + @JsonProperty(value = "locations", access = JsonProperty.Access.WRITE_ONLY) + private List locations; + + /* + * Locations and zones + */ + @JsonProperty(value = "locationInfo", access = JsonProperty.Access.WRITE_ONLY) + private List locationInfo; + + /* + * The restrictions because of which SKU cannot be used + */ + @JsonProperty(value = "restrictions", access = JsonProperty.Access.WRITE_ONLY) + private List restrictions; + + /** + * Get the resourceType property: The fully qualified resource type. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the name property: The name of the SKU. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the tier property: The price tier of the SKU. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Get the locations property: The set of locations that the SKU is available. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Get the locationInfo property: Locations and zones. + * + * @return the locationInfo value. + */ + public List locationInfo() { + return this.locationInfo; + } + + /** + * Get the restrictions property: The restrictions because of which SKU cannot be used. + * + * @return the restrictions value. + */ + public List restrictions() { + return this.restrictions; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (locationInfo() != null) { + locationInfo().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/package-info.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/package-info.java new file mode 100644 index 000000000000..037142e16375 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner data models for EngagementFabric. Microsoft Customer Engagement Fabric. */ +package com.azure.resourcemanager.engagementfabric.fluent.models; diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/package-info.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/package-info.java new file mode 100644 index 000000000000..36e4f48d8245 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the service clients for EngagementFabric. Microsoft Customer Engagement Fabric. */ +package com.azure.resourcemanager.engagementfabric.fluent; diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/AccountImpl.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/AccountImpl.java new file mode 100644 index 000000000000..c79a4c521607 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/AccountImpl.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.engagementfabric.fluent.models.AccountInner; +import com.azure.resourcemanager.engagementfabric.models.Account; +import com.azure.resourcemanager.engagementfabric.models.AccountPatch; +import com.azure.resourcemanager.engagementfabric.models.ChannelTypeDescriptionList; +import com.azure.resourcemanager.engagementfabric.models.KeyDescription; +import com.azure.resourcemanager.engagementfabric.models.RegenerateKeyParameter; +import com.azure.resourcemanager.engagementfabric.models.Sku; +import java.util.Collections; +import java.util.Map; + +public final class AccountImpl implements Account, Account.Definition, Account.Update { + private AccountInner innerObject; + + private final com.azure.resourcemanager.engagementfabric.EngagementFabricManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public AccountInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private AccountPatch updateAccountPatch; + + public AccountImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Account create() { + this.innerObject = + serviceManager + .serviceClient() + .getAccounts() + .createOrUpdateWithResponse(resourceGroupName, accountName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Account create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAccounts() + .createOrUpdateWithResponse(resourceGroupName, accountName, this.innerModel(), context) + .getValue(); + return this; + } + + AccountImpl(String name, com.azure.resourcemanager.engagementfabric.EngagementFabricManager serviceManager) { + this.innerObject = new AccountInner(); + this.serviceManager = serviceManager; + this.accountName = name; + } + + public AccountImpl update() { + this.updateAccountPatch = new AccountPatch(); + return this; + } + + public Account apply() { + this.innerObject = + serviceManager + .serviceClient() + .getAccounts() + .updateWithResponse(resourceGroupName, accountName, updateAccountPatch, Context.NONE) + .getValue(); + return this; + } + + public Account apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAccounts() + .updateWithResponse(resourceGroupName, accountName, updateAccountPatch, context) + .getValue(); + return this; + } + + AccountImpl( + AccountInner innerObject, com.azure.resourcemanager.engagementfabric.EngagementFabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "Accounts"); + } + + public Account refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getAccounts() + .getByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE) + .getValue(); + return this; + } + + public Account refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAccounts() + .getByResourceGroupWithResponse(resourceGroupName, accountName, context) + .getValue(); + return this; + } + + public PagedIterable listKeys() { + return serviceManager.accounts().listKeys(resourceGroupName, accountName); + } + + public PagedIterable listKeys(Context context) { + return serviceManager.accounts().listKeys(resourceGroupName, accountName, context); + } + + public KeyDescription regenerateKey(RegenerateKeyParameter parameter) { + return serviceManager.accounts().regenerateKey(resourceGroupName, accountName, parameter); + } + + public Response regenerateKeyWithResponse(RegenerateKeyParameter parameter, Context context) { + return serviceManager.accounts().regenerateKeyWithResponse(resourceGroupName, accountName, parameter, context); + } + + public ChannelTypeDescriptionList listChannelTypes() { + return serviceManager.accounts().listChannelTypes(resourceGroupName, accountName); + } + + public Response listChannelTypesWithResponse(Context context) { + return serviceManager.accounts().listChannelTypesWithResponse(resourceGroupName, accountName, context); + } + + public AccountImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public AccountImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public AccountImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } + + public AccountImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateAccountPatch.withTags(tags); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/AccountsClientImpl.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/AccountsClientImpl.java new file mode 100644 index 000000000000..3a9e40335db5 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/AccountsClientImpl.java @@ -0,0 +1,1555 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.engagementfabric.fluent.AccountsClient; +import com.azure.resourcemanager.engagementfabric.fluent.models.AccountInner; +import com.azure.resourcemanager.engagementfabric.fluent.models.ChannelTypeDescriptionListInner; +import com.azure.resourcemanager.engagementfabric.fluent.models.KeyDescriptionInner; +import com.azure.resourcemanager.engagementfabric.models.AccountList; +import com.azure.resourcemanager.engagementfabric.models.AccountPatch; +import com.azure.resourcemanager.engagementfabric.models.KeyDescriptionList; +import com.azure.resourcemanager.engagementfabric.models.RegenerateKeyParameter; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AccountsClient. */ +public final class AccountsClientImpl implements AccountsClient { + /** The proxy service used to perform REST calls. */ + private final AccountsService service; + + /** The service client containing this operation class. */ + private final EngagementFabricImpl client; + + /** + * Initializes an instance of AccountsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AccountsClientImpl(EngagementFabricImpl client) { + this.service = RestProxy.create(AccountsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for EngagementFabricAccounts to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "EngagementFabricAcco") + private interface AccountsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EngagementFabric" + + "/Accounts/{accountName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EngagementFabric" + + "/Accounts/{accountName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AccountInner account, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EngagementFabric" + + "/Accounts/{accountName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EngagementFabric" + + "/Accounts/{accountName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AccountPatch accountPatch, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.EngagementFabric/Accounts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EngagementFabric" + + "/Accounts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EngagementFabric" + + "/Accounts/{accountName}/listKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listKeys( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EngagementFabric" + + "/Accounts/{accountName}/regenerateKey") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regenerateKey( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RegenerateKeyParameter parameter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EngagementFabric" + + "/Accounts/{accountName}/listChannelTypes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listChannelTypes( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String accountName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, accountName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccountInner getByResourceGroup(String resourceGroupName, String accountName) { + return getByResourceGroupAsync(resourceGroupName, accountName).block(); + } + + /** + * Get the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String accountName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, accountName, context).block(); + } + + /** + * Create or Update the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param account The EngagementFabric account description. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String accountName, AccountInner account) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (account == null) { + return Mono.error(new IllegalArgumentException("Parameter account is required and cannot be null.")); + } else { + account.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + account, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or Update the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param account The EngagementFabric account description. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String accountName, AccountInner account, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (account == null) { + return Mono.error(new IllegalArgumentException("Parameter account is required and cannot be null.")); + } else { + account.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + account, + accept, + context); + } + + /** + * Create or Update the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param account The EngagementFabric account description. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String accountName, AccountInner account) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, account) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or Update the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param account The EngagementFabric account description. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccountInner createOrUpdate(String resourceGroupName, String accountName, AccountInner account) { + return createOrUpdateAsync(resourceGroupName, accountName, account).block(); + } + + /** + * Create or Update the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param account The EngagementFabric account description. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, String accountName, AccountInner account, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, account, context).block(); + } + + /** + * Delete the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName) { + return deleteWithResponseAsync(resourceGroupName, accountName).flatMap(ignored -> Mono.empty()); + } + + /** + * Delete the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName) { + deleteAsync(resourceGroupName, accountName).block(); + } + + /** + * Delete the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String accountName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, context).block(); + } + + /** + * Update EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param accountPatch The account patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String accountName, AccountPatch accountPatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (accountPatch == null) { + return Mono.error(new IllegalArgumentException("Parameter accountPatch is required and cannot be null.")); + } else { + accountPatch.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accountPatch, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param accountPatch The account patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String accountName, AccountPatch accountPatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (accountPatch == null) { + return Mono.error(new IllegalArgumentException("Parameter accountPatch is required and cannot be null.")); + } else { + accountPatch.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accountPatch, + accept, + context); + } + + /** + * Update EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param accountPatch The account patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String accountName, AccountPatch accountPatch) { + return updateWithResponseAsync(resourceGroupName, accountName, accountPatch) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Update EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param accountPatch The account patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccountInner update(String resourceGroupName, String accountName, AccountPatch accountPatch) { + return updateAsync(resourceGroupName, accountName, accountPatch).block(); + } + + /** + * Update EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param accountPatch The account patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String accountName, AccountPatch accountPatch, Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, accountPatch, context).block(); + } + + /** + * List the EngagementFabric accounts in given subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric accounts along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the EngagementFabric accounts in given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric accounts along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * List the EngagementFabric accounts in given subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric accounts as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync()); + } + + /** + * List the EngagementFabric accounts in given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric accounts as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context)); + } + + /** + * List the EngagementFabric accounts in given subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric accounts as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List the EngagementFabric accounts in given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric accounts as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List EngagementFabric accounts in given resource group. + * + * @param resourceGroupName Resource Group Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric accounts along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List EngagementFabric accounts in given resource group. + * + * @param resourceGroupName Resource Group Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric accounts along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * List EngagementFabric accounts in given resource group. + * + * @param resourceGroupName Resource Group Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric accounts as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName)); + } + + /** + * List EngagementFabric accounts in given resource group. + * + * @param resourceGroupName Resource Group Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric accounts as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context)); + } + + /** + * List EngagementFabric accounts in given resource group. + * + * @param resourceGroupName Resource Group Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric accounts as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List EngagementFabric accounts in given resource group. + * + * @param resourceGroupName Resource Group Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric accounts as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * List keys of the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric account keys along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysSinglePageAsync( + String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listKeys( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List keys of the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric account keys along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysSinglePageAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listKeys( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * List keys of the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric account keys as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listKeysAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listKeysSinglePageAsync(resourceGroupName, accountName)); + } + + /** + * List keys of the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric account keys as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listKeysAsync( + String resourceGroupName, String accountName, Context context) { + return new PagedFlux<>(() -> listKeysSinglePageAsync(resourceGroupName, accountName, context)); + } + + /** + * List keys of the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric account keys as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listKeys(String resourceGroupName, String accountName) { + return new PagedIterable<>(listKeysAsync(resourceGroupName, accountName)); + } + + /** + * List keys of the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric account keys as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listKeys(String resourceGroupName, String accountName, Context context) { + return new PagedIterable<>(listKeysAsync(resourceGroupName, accountName, context)); + } + + /** + * Regenerate key of the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param parameter Parameters specifying the key to be regenerated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of the EngagementFabric account key along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateKeyWithResponseAsync( + String resourceGroupName, String accountName, RegenerateKeyParameter parameter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (parameter == null) { + return Mono.error(new IllegalArgumentException("Parameter parameter is required and cannot be null.")); + } else { + parameter.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .regenerateKey( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + parameter, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Regenerate key of the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param parameter Parameters specifying the key to be regenerated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of the EngagementFabric account key along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateKeyWithResponseAsync( + String resourceGroupName, String accountName, RegenerateKeyParameter parameter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (parameter == null) { + return Mono.error(new IllegalArgumentException("Parameter parameter is required and cannot be null.")); + } else { + parameter.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .regenerateKey( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + parameter, + accept, + context); + } + + /** + * Regenerate key of the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param parameter Parameters specifying the key to be regenerated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of the EngagementFabric account key on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regenerateKeyAsync( + String resourceGroupName, String accountName, RegenerateKeyParameter parameter) { + return regenerateKeyWithResponseAsync(resourceGroupName, accountName, parameter) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Regenerate key of the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param parameter Parameters specifying the key to be regenerated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of the EngagementFabric account key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KeyDescriptionInner regenerateKey( + String resourceGroupName, String accountName, RegenerateKeyParameter parameter) { + return regenerateKeyAsync(resourceGroupName, accountName, parameter).block(); + } + + /** + * Regenerate key of the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param parameter Parameters specifying the key to be regenerated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of the EngagementFabric account key along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response regenerateKeyWithResponse( + String resourceGroupName, String accountName, RegenerateKeyParameter parameter, Context context) { + return regenerateKeyWithResponseAsync(resourceGroupName, accountName, parameter, context).block(); + } + + /** + * List available EngagementFabric channel types and functions. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of the EngagementFabric channel descriptions along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listChannelTypesWithResponseAsync( + String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listChannelTypes( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List available EngagementFabric channel types and functions. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of the EngagementFabric channel descriptions along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listChannelTypesWithResponseAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listChannelTypes( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * List available EngagementFabric channel types and functions. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of the EngagementFabric channel descriptions on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listChannelTypesAsync(String resourceGroupName, String accountName) { + return listChannelTypesWithResponseAsync(resourceGroupName, accountName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List available EngagementFabric channel types and functions. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of the EngagementFabric channel descriptions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ChannelTypeDescriptionListInner listChannelTypes(String resourceGroupName, String accountName) { + return listChannelTypesAsync(resourceGroupName, accountName).block(); + } + + /** + * List available EngagementFabric channel types and functions. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of the EngagementFabric channel descriptions along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listChannelTypesWithResponse( + String resourceGroupName, String accountName, Context context) { + return listChannelTypesWithResponseAsync(resourceGroupName, accountName, context).block(); + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/AccountsImpl.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/AccountsImpl.java new file mode 100644 index 000000000000..390ae3d0303d --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/AccountsImpl.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.engagementfabric.fluent.AccountsClient; +import com.azure.resourcemanager.engagementfabric.fluent.models.AccountInner; +import com.azure.resourcemanager.engagementfabric.fluent.models.ChannelTypeDescriptionListInner; +import com.azure.resourcemanager.engagementfabric.fluent.models.KeyDescriptionInner; +import com.azure.resourcemanager.engagementfabric.models.Account; +import com.azure.resourcemanager.engagementfabric.models.Accounts; +import com.azure.resourcemanager.engagementfabric.models.ChannelTypeDescriptionList; +import com.azure.resourcemanager.engagementfabric.models.KeyDescription; +import com.azure.resourcemanager.engagementfabric.models.RegenerateKeyParameter; + +public final class AccountsImpl implements Accounts { + private static final ClientLogger LOGGER = new ClientLogger(AccountsImpl.class); + + private final AccountsClient innerClient; + + private final com.azure.resourcemanager.engagementfabric.EngagementFabricManager serviceManager; + + public AccountsImpl( + AccountsClient innerClient, com.azure.resourcemanager.engagementfabric.EngagementFabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Account getByResourceGroup(String resourceGroupName, String accountName) { + AccountInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, accountName); + if (inner != null) { + return new AccountImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String accountName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, accountName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccountImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String accountName) { + this.serviceClient().delete(resourceGroupName, accountName); + } + + public Response deleteWithResponse(String resourceGroupName, String accountName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, context); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new AccountImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new AccountImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new AccountImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new AccountImpl(inner1, this.manager())); + } + + public PagedIterable listKeys(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().listKeys(resourceGroupName, accountName); + return Utils.mapPage(inner, inner1 -> new KeyDescriptionImpl(inner1, this.manager())); + } + + public PagedIterable listKeys(String resourceGroupName, String accountName, Context context) { + PagedIterable inner = + this.serviceClient().listKeys(resourceGroupName, accountName, context); + return Utils.mapPage(inner, inner1 -> new KeyDescriptionImpl(inner1, this.manager())); + } + + public KeyDescription regenerateKey( + String resourceGroupName, String accountName, RegenerateKeyParameter parameter) { + KeyDescriptionInner inner = this.serviceClient().regenerateKey(resourceGroupName, accountName, parameter); + if (inner != null) { + return new KeyDescriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response regenerateKeyWithResponse( + String resourceGroupName, String accountName, RegenerateKeyParameter parameter, Context context) { + Response inner = + this.serviceClient().regenerateKeyWithResponse(resourceGroupName, accountName, parameter, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new KeyDescriptionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ChannelTypeDescriptionList listChannelTypes(String resourceGroupName, String accountName) { + ChannelTypeDescriptionListInner inner = this.serviceClient().listChannelTypes(resourceGroupName, accountName); + if (inner != null) { + return new ChannelTypeDescriptionListImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listChannelTypesWithResponse( + String resourceGroupName, String accountName, Context context) { + Response inner = + this.serviceClient().listChannelTypesWithResponse(resourceGroupName, accountName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ChannelTypeDescriptionListImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Account getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "Accounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Accounts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "Accounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Accounts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, accountName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "Accounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Accounts'.", id))); + } + this.deleteWithResponse(resourceGroupName, accountName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "Accounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Accounts'.", id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, context); + } + + private AccountsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager() { + return this.serviceManager; + } + + public AccountImpl define(String name) { + return new AccountImpl(name, this.manager()); + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/ChannelImpl.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/ChannelImpl.java new file mode 100644 index 000000000000..942399d4460c --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/ChannelImpl.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.engagementfabric.fluent.models.ChannelInner; +import com.azure.resourcemanager.engagementfabric.models.Channel; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ChannelImpl implements Channel, Channel.Definition, Channel.Update { + private ChannelInner innerObject; + + private final com.azure.resourcemanager.engagementfabric.EngagementFabricManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String channelType() { + return this.innerModel().channelType(); + } + + public List channelFunctions() { + List inner = this.innerModel().channelFunctions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Map credentials() { + Map inner = this.innerModel().credentials(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ChannelInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String channelName; + + public ChannelImpl withExistingAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public Channel create() { + this.innerObject = + serviceManager + .serviceClient() + .getChannels() + .createOrUpdateWithResponse( + resourceGroupName, accountName, channelName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Channel create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getChannels() + .createOrUpdateWithResponse(resourceGroupName, accountName, channelName, this.innerModel(), context) + .getValue(); + return this; + } + + ChannelImpl(String name, com.azure.resourcemanager.engagementfabric.EngagementFabricManager serviceManager) { + this.innerObject = new ChannelInner(); + this.serviceManager = serviceManager; + this.channelName = name; + } + + public ChannelImpl update() { + return this; + } + + public Channel apply() { + this.innerObject = + serviceManager + .serviceClient() + .getChannels() + .createOrUpdateWithResponse( + resourceGroupName, accountName, channelName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Channel apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getChannels() + .createOrUpdateWithResponse(resourceGroupName, accountName, channelName, this.innerModel(), context) + .getValue(); + return this; + } + + ChannelImpl( + ChannelInner innerObject, com.azure.resourcemanager.engagementfabric.EngagementFabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "Accounts"); + this.channelName = Utils.getValueFromIdByName(innerObject.id(), "Channels"); + } + + public Channel refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getChannels() + .getWithResponse(resourceGroupName, accountName, channelName, Context.NONE) + .getValue(); + return this; + } + + public Channel refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getChannels() + .getWithResponse(resourceGroupName, accountName, channelName, context) + .getValue(); + return this; + } + + public ChannelImpl withChannelType(String channelType) { + this.innerModel().withChannelType(channelType); + return this; + } + + public ChannelImpl withChannelFunctions(List channelFunctions) { + this.innerModel().withChannelFunctions(channelFunctions); + return this; + } + + public ChannelImpl withCredentials(Map credentials) { + this.innerModel().withCredentials(credentials); + return this; + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/ChannelTypeDescriptionListImpl.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/ChannelTypeDescriptionListImpl.java new file mode 100644 index 000000000000..e6e9b5105fc9 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/ChannelTypeDescriptionListImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.implementation; + +import com.azure.resourcemanager.engagementfabric.fluent.models.ChannelTypeDescriptionListInner; +import com.azure.resourcemanager.engagementfabric.models.ChannelTypeDescription; +import com.azure.resourcemanager.engagementfabric.models.ChannelTypeDescriptionList; +import java.util.Collections; +import java.util.List; + +public final class ChannelTypeDescriptionListImpl implements ChannelTypeDescriptionList { + private ChannelTypeDescriptionListInner innerObject; + + private final com.azure.resourcemanager.engagementfabric.EngagementFabricManager serviceManager; + + ChannelTypeDescriptionListImpl( + ChannelTypeDescriptionListInner innerObject, + com.azure.resourcemanager.engagementfabric.EngagementFabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ChannelTypeDescriptionListInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/ChannelsClientImpl.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/ChannelsClientImpl.java new file mode 100644 index 000000000000..758613110bd8 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/ChannelsClientImpl.java @@ -0,0 +1,773 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.engagementfabric.fluent.ChannelsClient; +import com.azure.resourcemanager.engagementfabric.fluent.models.ChannelInner; +import com.azure.resourcemanager.engagementfabric.models.ChannelList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ChannelsClient. */ +public final class ChannelsClientImpl implements ChannelsClient { + /** The proxy service used to perform REST calls. */ + private final ChannelsService service; + + /** The service client containing this operation class. */ + private final EngagementFabricImpl client; + + /** + * Initializes an instance of ChannelsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ChannelsClientImpl(EngagementFabricImpl client) { + this.service = RestProxy.create(ChannelsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for EngagementFabricChannels to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "EngagementFabricChan") + private interface ChannelsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EngagementFabric" + + "/Accounts/{accountName}/Channels/{channelName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("channelName") String channelName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EngagementFabric" + + "/Accounts/{accountName}/Channels/{channelName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("channelName") String channelName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ChannelInner channel, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EngagementFabric" + + "/Accounts/{accountName}/Channels/{channelName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("channelName") String channelName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EngagementFabric" + + "/Accounts/{accountName}/Channels") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByAccount( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param channelName Channel Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric channel along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String channelName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (channelName == null) { + return Mono.error(new IllegalArgumentException("Parameter channelName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + channelName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param channelName Channel Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric channel along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String channelName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (channelName == null) { + return Mono.error(new IllegalArgumentException("Parameter channelName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + channelName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param channelName Channel Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric channel on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, String channelName) { + return getWithResponseAsync(resourceGroupName, accountName, channelName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param channelName Channel Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric channel. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ChannelInner get(String resourceGroupName, String accountName, String channelName) { + return getAsync(resourceGroupName, accountName, channelName).block(); + } + + /** + * Get the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param channelName Channel Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric channel along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String accountName, String channelName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, channelName, context).block(); + } + + /** + * Create or Update the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param channelName Channel Name. + * @param channel The EngagementFabric channel description. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric channel along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String accountName, String channelName, ChannelInner channel) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (channelName == null) { + return Mono.error(new IllegalArgumentException("Parameter channelName is required and cannot be null.")); + } + if (channel == null) { + return Mono.error(new IllegalArgumentException("Parameter channel is required and cannot be null.")); + } else { + channel.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + channelName, + this.client.getApiVersion(), + channel, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or Update the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param channelName Channel Name. + * @param channel The EngagementFabric channel description. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric channel along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String accountName, String channelName, ChannelInner channel, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (channelName == null) { + return Mono.error(new IllegalArgumentException("Parameter channelName is required and cannot be null.")); + } + if (channel == null) { + return Mono.error(new IllegalArgumentException("Parameter channel is required and cannot be null.")); + } else { + channel.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + channelName, + this.client.getApiVersion(), + channel, + accept, + context); + } + + /** + * Create or Update the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param channelName Channel Name. + * @param channel The EngagementFabric channel description. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric channel on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String accountName, String channelName, ChannelInner channel) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, channelName, channel) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or Update the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param channelName Channel Name. + * @param channel The EngagementFabric channel description. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric channel. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ChannelInner createOrUpdate( + String resourceGroupName, String accountName, String channelName, ChannelInner channel) { + return createOrUpdateAsync(resourceGroupName, accountName, channelName, channel).block(); + } + + /** + * Create or Update the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param channelName Channel Name. + * @param channel The EngagementFabric channel description. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric channel along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, String accountName, String channelName, ChannelInner channel, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, channelName, channel, context).block(); + } + + /** + * Delete the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param channelName The EngagementFabric channel name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String channelName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (channelName == null) { + return Mono.error(new IllegalArgumentException("Parameter channelName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + channelName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param channelName The EngagementFabric channel name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String channelName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (channelName == null) { + return Mono.error(new IllegalArgumentException("Parameter channelName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + channelName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param channelName The EngagementFabric channel name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String channelName) { + return deleteWithResponseAsync(resourceGroupName, accountName, channelName).flatMap(ignored -> Mono.empty()); + } + + /** + * Delete the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param channelName The EngagementFabric channel name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String channelName) { + deleteAsync(resourceGroupName, accountName, channelName).block(); + } + + /** + * Delete the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param channelName The EngagementFabric channel name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String accountName, String channelName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, channelName, context).block(); + } + + /** + * List the EngagementFabric channels. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric channels along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAccountSinglePageAsync( + String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByAccount( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the EngagementFabric channels. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric channels along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAccountSinglePageAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByAccount( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * List the EngagementFabric channels. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric channels as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByAccountAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listByAccountSinglePageAsync(resourceGroupName, accountName)); + } + + /** + * List the EngagementFabric channels. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric channels as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByAccountAsync(String resourceGroupName, String accountName, Context context) { + return new PagedFlux<>(() -> listByAccountSinglePageAsync(resourceGroupName, accountName, context)); + } + + /** + * List the EngagementFabric channels. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric channels as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByAccount(String resourceGroupName, String accountName) { + return new PagedIterable<>(listByAccountAsync(resourceGroupName, accountName)); + } + + /** + * List the EngagementFabric channels. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric channels as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByAccount(String resourceGroupName, String accountName, Context context) { + return new PagedIterable<>(listByAccountAsync(resourceGroupName, accountName, context)); + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/ChannelsImpl.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/ChannelsImpl.java new file mode 100644 index 000000000000..d3861eaa1b8c --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/ChannelsImpl.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.engagementfabric.fluent.ChannelsClient; +import com.azure.resourcemanager.engagementfabric.fluent.models.ChannelInner; +import com.azure.resourcemanager.engagementfabric.models.Channel; +import com.azure.resourcemanager.engagementfabric.models.Channels; + +public final class ChannelsImpl implements Channels { + private static final ClientLogger LOGGER = new ClientLogger(ChannelsImpl.class); + + private final ChannelsClient innerClient; + + private final com.azure.resourcemanager.engagementfabric.EngagementFabricManager serviceManager; + + public ChannelsImpl( + ChannelsClient innerClient, com.azure.resourcemanager.engagementfabric.EngagementFabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Channel get(String resourceGroupName, String accountName, String channelName) { + ChannelInner inner = this.serviceClient().get(resourceGroupName, accountName, channelName); + if (inner != null) { + return new ChannelImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String accountName, String channelName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, accountName, channelName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ChannelImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String channelName) { + this.serviceClient().delete(resourceGroupName, accountName, channelName); + } + + public Response deleteWithResponse( + String resourceGroupName, String accountName, String channelName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, channelName, context); + } + + public PagedIterable listByAccount(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().listByAccount(resourceGroupName, accountName); + return Utils.mapPage(inner, inner1 -> new ChannelImpl(inner1, this.manager())); + } + + public PagedIterable listByAccount(String resourceGroupName, String accountName, Context context) { + PagedIterable inner = this.serviceClient().listByAccount(resourceGroupName, accountName, context); + return Utils.mapPage(inner, inner1 -> new ChannelImpl(inner1, this.manager())); + } + + public Channel getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "Accounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Accounts'.", id))); + } + String channelName = Utils.getValueFromIdByName(id, "Channels"); + if (channelName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Channels'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, channelName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "Accounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Accounts'.", id))); + } + String channelName = Utils.getValueFromIdByName(id, "Channels"); + if (channelName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Channels'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, channelName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "Accounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Accounts'.", id))); + } + String channelName = Utils.getValueFromIdByName(id, "Channels"); + if (channelName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Channels'.", id))); + } + this.deleteWithResponse(resourceGroupName, accountName, channelName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "Accounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Accounts'.", id))); + } + String channelName = Utils.getValueFromIdByName(id, "Channels"); + if (channelName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Channels'.", id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, channelName, context); + } + + private ChannelsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager() { + return this.serviceManager; + } + + public ChannelImpl define(String name) { + return new ChannelImpl(name, this.manager()); + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/CheckNameAvailabilityResultImpl.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/CheckNameAvailabilityResultImpl.java new file mode 100644 index 000000000000..5a605dc254e2 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/CheckNameAvailabilityResultImpl.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.implementation; + +import com.azure.resourcemanager.engagementfabric.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.engagementfabric.models.CheckNameAvailabilityResult; +import com.azure.resourcemanager.engagementfabric.models.CheckNameUnavailableReason; + +public final class CheckNameAvailabilityResultImpl implements CheckNameAvailabilityResult { + private CheckNameAvailabilityResultInner innerObject; + + private final com.azure.resourcemanager.engagementfabric.EngagementFabricManager serviceManager; + + CheckNameAvailabilityResultImpl( + CheckNameAvailabilityResultInner innerObject, + com.azure.resourcemanager.engagementfabric.EngagementFabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean nameAvailable() { + return this.innerModel().nameAvailable(); + } + + public CheckNameUnavailableReason reason() { + return this.innerModel().reason(); + } + + public String message() { + return this.innerModel().message(); + } + + public CheckNameAvailabilityResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/EngagementFabricBuilder.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/EngagementFabricBuilder.java new file mode 100644 index 000000000000..3c820f06ad27 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/EngagementFabricBuilder.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the EngagementFabricImpl type. */ +@ServiceClientBuilder(serviceClients = {EngagementFabricImpl.class}) +public final class EngagementFabricBuilder { + /* + * Subscription ID + */ + private String subscriptionId; + + /** + * Sets Subscription ID. + * + * @param subscriptionId the subscriptionId value. + * @return the EngagementFabricBuilder. + */ + public EngagementFabricBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the EngagementFabricBuilder. + */ + public EngagementFabricBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the EngagementFabricBuilder. + */ + public EngagementFabricBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the EngagementFabricBuilder. + */ + public EngagementFabricBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the EngagementFabricBuilder. + */ + public EngagementFabricBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the EngagementFabricBuilder. + */ + public EngagementFabricBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of EngagementFabricImpl with the provided parameters. + * + * @return an instance of EngagementFabricImpl. + */ + public EngagementFabricImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (pipeline == null) { + this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + EngagementFabricImpl client = + new EngagementFabricImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/EngagementFabricImpl.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/EngagementFabricImpl.java new file mode 100644 index 000000000000..8c15c591f287 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/EngagementFabricImpl.java @@ -0,0 +1,346 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.engagementfabric.fluent.AccountsClient; +import com.azure.resourcemanager.engagementfabric.fluent.ChannelsClient; +import com.azure.resourcemanager.engagementfabric.fluent.EngagementFabric; +import com.azure.resourcemanager.engagementfabric.fluent.OperationsClient; +import com.azure.resourcemanager.engagementfabric.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.engagementfabric.fluent.SKUsClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the EngagementFabricImpl type. */ +@ServiceClient(builder = EngagementFabricBuilder.class) +public final class EngagementFabricImpl implements EngagementFabric { + /** Subscription ID. */ + private final String subscriptionId; + + /** + * Gets Subscription ID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The AccountsClient object to access its operations. */ + private final AccountsClient accounts; + + /** + * Gets the AccountsClient object to access its operations. + * + * @return the AccountsClient object. + */ + public AccountsClient getAccounts() { + return this.accounts; + } + + /** The ChannelsClient object to access its operations. */ + private final ChannelsClient channels; + + /** + * Gets the ChannelsClient object to access its operations. + * + * @return the ChannelsClient object. + */ + public ChannelsClient getChannels() { + return this.channels; + } + + /** The ResourceProvidersClient object to access its operations. */ + private final ResourceProvidersClient resourceProviders; + + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + public ResourceProvidersClient getResourceProviders() { + return this.resourceProviders; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The SKUsClient object to access its operations. */ + private final SKUsClient sKUs; + + /** + * Gets the SKUsClient object to access its operations. + * + * @return the SKUsClient object. + */ + public SKUsClient getSKUs() { + return this.sKUs; + } + + /** + * Initializes an instance of EngagementFabric client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId Subscription ID. + * @param endpoint server parameter. + */ + EngagementFabricImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2018-09-01-preview"; + this.accounts = new AccountsClientImpl(this); + this.channels = new ChannelsClientImpl(this); + this.resourceProviders = new ResourceProvidersClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.sKUs = new SKUsClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EngagementFabricImpl.class); +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/KeyDescriptionImpl.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/KeyDescriptionImpl.java new file mode 100644 index 000000000000..331700f76770 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/KeyDescriptionImpl.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.implementation; + +import com.azure.resourcemanager.engagementfabric.fluent.models.KeyDescriptionInner; +import com.azure.resourcemanager.engagementfabric.models.KeyDescription; +import com.azure.resourcemanager.engagementfabric.models.KeyRank; + +public final class KeyDescriptionImpl implements KeyDescription { + private KeyDescriptionInner innerObject; + + private final com.azure.resourcemanager.engagementfabric.EngagementFabricManager serviceManager; + + KeyDescriptionImpl( + KeyDescriptionInner innerObject, + com.azure.resourcemanager.engagementfabric.EngagementFabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public KeyRank rank() { + return this.innerModel().rank(); + } + + public String value() { + return this.innerModel().value(); + } + + public KeyDescriptionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/OperationImpl.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/OperationImpl.java new file mode 100644 index 000000000000..a96b674436b7 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/OperationImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.implementation; + +import com.azure.resourcemanager.engagementfabric.fluent.models.OperationInner; +import com.azure.resourcemanager.engagementfabric.models.Operation; +import com.azure.resourcemanager.engagementfabric.models.OperationDisplay; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.engagementfabric.EngagementFabricManager serviceManager; + + OperationImpl( + OperationInner innerObject, com.azure.resourcemanager.engagementfabric.EngagementFabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/OperationsClientImpl.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..1de9820a8186 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/OperationsClientImpl.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.engagementfabric.fluent.OperationsClient; +import com.azure.resourcemanager.engagementfabric.fluent.models.OperationInner; +import com.azure.resourcemanager.engagementfabric.models.OperationList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final EngagementFabricImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(EngagementFabricImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for EngagementFabricOperations to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "EngagementFabricOper") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.EngagementFabric/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List operation of EngagementFabric resources. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List operation of EngagementFabric resources. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * List operation of EngagementFabric resources. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync()); + } + + /** + * List operation of EngagementFabric resources. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context)); + } + + /** + * List operation of EngagementFabric resources. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List operation of EngagementFabric resources. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/OperationsImpl.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/OperationsImpl.java new file mode 100644 index 000000000000..f4c581f09183 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/OperationsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.engagementfabric.fluent.OperationsClient; +import com.azure.resourcemanager.engagementfabric.fluent.models.OperationInner; +import com.azure.resourcemanager.engagementfabric.models.Operation; +import com.azure.resourcemanager.engagementfabric.models.Operations; + +public final class OperationsImpl implements Operations { + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.engagementfabric.EngagementFabricManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, + com.azure.resourcemanager.engagementfabric.EngagementFabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/ResourceProvidersClientImpl.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/ResourceProvidersClientImpl.java new file mode 100644 index 000000000000..86d8cde04343 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/ResourceProvidersClientImpl.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.engagementfabric.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.engagementfabric.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.engagementfabric.models.CheckNameAvailabilityParameter; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ +public final class ResourceProvidersClientImpl implements ResourceProvidersClient { + /** The proxy service used to perform REST calls. */ + private final ResourceProvidersService service; + + /** The service client containing this operation class. */ + private final EngagementFabricImpl client; + + /** + * Initializes an instance of ResourceProvidersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ResourceProvidersClientImpl(EngagementFabricImpl client) { + this.service = + RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for EngagementFabricResourceProviders to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "EngagementFabricReso") + private interface ResourceProvidersService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EngagementFabric" + + "/checkNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CheckNameAvailabilityParameter parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Check availability of EngagementFabric resource. + * + * @param resourceGroupName Resource Group Name. + * @param parameters Parameter describing the name to be checked. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of name availability check along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String resourceGroupName, CheckNameAvailabilityParameter parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Check availability of EngagementFabric resource. + * + * @param resourceGroupName Resource Group Name. + * @param parameters Parameter describing the name to be checked. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of name availability check along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String resourceGroupName, CheckNameAvailabilityParameter parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Check availability of EngagementFabric resource. + * + * @param resourceGroupName Resource Group Name. + * @param parameters Parameter describing the name to be checked. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of name availability check on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + String resourceGroupName, CheckNameAvailabilityParameter parameters) { + return checkNameAvailabilityWithResponseAsync(resourceGroupName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Check availability of EngagementFabric resource. + * + * @param resourceGroupName Resource Group Name. + * @param parameters Parameter describing the name to be checked. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of name availability check. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameAvailabilityResultInner checkNameAvailability( + String resourceGroupName, CheckNameAvailabilityParameter parameters) { + return checkNameAvailabilityAsync(resourceGroupName, parameters).block(); + } + + /** + * Check availability of EngagementFabric resource. + * + * @param resourceGroupName Resource Group Name. + * @param parameters Parameter describing the name to be checked. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of name availability check along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + String resourceGroupName, CheckNameAvailabilityParameter parameters, Context context) { + return checkNameAvailabilityWithResponseAsync(resourceGroupName, parameters, context).block(); + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/ResourceProvidersImpl.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/ResourceProvidersImpl.java new file mode 100644 index 000000000000..77e367c18841 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/ResourceProvidersImpl.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.engagementfabric.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.engagementfabric.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.engagementfabric.models.CheckNameAvailabilityParameter; +import com.azure.resourcemanager.engagementfabric.models.CheckNameAvailabilityResult; +import com.azure.resourcemanager.engagementfabric.models.ResourceProviders; + +public final class ResourceProvidersImpl implements ResourceProviders { + private static final ClientLogger LOGGER = new ClientLogger(ResourceProvidersImpl.class); + + private final ResourceProvidersClient innerClient; + + private final com.azure.resourcemanager.engagementfabric.EngagementFabricManager serviceManager; + + public ResourceProvidersImpl( + ResourceProvidersClient innerClient, + com.azure.resourcemanager.engagementfabric.EngagementFabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public CheckNameAvailabilityResult checkNameAvailability( + String resourceGroupName, CheckNameAvailabilityParameter parameters) { + CheckNameAvailabilityResultInner inner = + this.serviceClient().checkNameAvailability(resourceGroupName, parameters); + if (inner != null) { + return new CheckNameAvailabilityResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithResponse( + String resourceGroupName, CheckNameAvailabilityParameter parameters, Context context) { + Response inner = + this.serviceClient().checkNameAvailabilityWithResponse(resourceGroupName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckNameAvailabilityResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ResourceProvidersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/SKUsClientImpl.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/SKUsClientImpl.java new file mode 100644 index 000000000000..9015a4501258 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/SKUsClientImpl.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.engagementfabric.fluent.SKUsClient; +import com.azure.resourcemanager.engagementfabric.fluent.models.SkuDescriptionInner; +import com.azure.resourcemanager.engagementfabric.models.SkuDescriptionList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SKUsClient. */ +public final class SKUsClientImpl implements SKUsClient { + /** The proxy service used to perform REST calls. */ + private final SKUsService service; + + /** The service client containing this operation class. */ + private final EngagementFabricImpl client; + + /** + * Initializes an instance of SKUsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SKUsClientImpl(EngagementFabricImpl client) { + this.service = RestProxy.create(SKUsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for EngagementFabricSKUs to be used by the proxy service to perform REST + * calls. + */ + @Host("{$host}") + @ServiceInterface(name = "EngagementFabricSKUs") + private interface SKUsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.EngagementFabric/skus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List available SKUs of EngagementFabric resource. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric SKU descriptions along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List available SKUs of EngagementFabric resource. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric SKU descriptions along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * List available SKUs of EngagementFabric resource. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric SKU descriptions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync()); + } + + /** + * List available SKUs of EngagementFabric resource. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric SKU descriptions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context)); + } + + /** + * List available SKUs of EngagementFabric resource. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric SKU descriptions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List available SKUs of EngagementFabric resource. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric SKU descriptions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/SKUsImpl.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/SKUsImpl.java new file mode 100644 index 000000000000..1ddce64e4b7d --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/SKUsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.engagementfabric.fluent.SKUsClient; +import com.azure.resourcemanager.engagementfabric.fluent.models.SkuDescriptionInner; +import com.azure.resourcemanager.engagementfabric.models.SKUs; +import com.azure.resourcemanager.engagementfabric.models.SkuDescription; + +public final class SKUsImpl implements SKUs { + private static final ClientLogger LOGGER = new ClientLogger(SKUsImpl.class); + + private final SKUsClient innerClient; + + private final com.azure.resourcemanager.engagementfabric.EngagementFabricManager serviceManager; + + public SKUsImpl( + SKUsClient innerClient, com.azure.resourcemanager.engagementfabric.EngagementFabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new SkuDescriptionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new SkuDescriptionImpl(inner1, this.manager())); + } + + private SKUsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/SkuDescriptionImpl.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/SkuDescriptionImpl.java new file mode 100644 index 000000000000..e0c846342564 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/SkuDescriptionImpl.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.implementation; + +import com.azure.resourcemanager.engagementfabric.fluent.models.SkuDescriptionInner; +import com.azure.resourcemanager.engagementfabric.models.SkuDescription; +import com.azure.resourcemanager.engagementfabric.models.SkuLocationInfoItem; +import java.util.Collections; +import java.util.List; + +public final class SkuDescriptionImpl implements SkuDescription { + private SkuDescriptionInner innerObject; + + private final com.azure.resourcemanager.engagementfabric.EngagementFabricManager serviceManager; + + SkuDescriptionImpl( + SkuDescriptionInner innerObject, + com.azure.resourcemanager.engagementfabric.EngagementFabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String resourceType() { + return this.innerModel().resourceType(); + } + + public String name() { + return this.innerModel().name(); + } + + public String tier() { + return this.innerModel().tier(); + } + + public List locations() { + List inner = this.innerModel().locations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List locationInfo() { + List inner = this.innerModel().locationInfo(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List restrictions() { + List inner = this.innerModel().restrictions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SkuDescriptionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/Utils.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/Utils.java new file mode 100644 index 000000000000..ed3b7490dbd9 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/package-info.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/package-info.java new file mode 100644 index 000000000000..2a1f4102a22a --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/implementation/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the implementations for EngagementFabric. Microsoft Customer Engagement Fabric. */ +package com.azure.resourcemanager.engagementfabric.implementation; diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/Account.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/Account.java new file mode 100644 index 000000000000..ae5bbb684076 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/Account.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.engagementfabric.fluent.models.AccountInner; +import java.util.Map; + +/** An immutable client-side representation of Account. */ +public interface Account { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the sku property: The SKU of the resource. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.engagementfabric.fluent.models.AccountInner object. + * + * @return the inner object. + */ + AccountInner innerModel(); + + /** The entirety of the Account definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithSku, + DefinitionStages.WithCreate { + } + /** The Account definition stages. */ + interface DefinitionStages { + /** The first stage of the Account definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Account definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the Account definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName Resource Group Name. + * @return the next definition stage. + */ + WithSku withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the Account definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The SKU of the resource. + * + * @param sku The SKU of the resource. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + /** + * The stage of the Account definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags { + /** + * Executes the create request. + * + * @return the created resource. + */ + Account create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Account create(Context context); + } + /** The stage of the Account definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + } + /** + * Begins update for the Account resource. + * + * @return the stage of resource update. + */ + Account.Update update(); + + /** The template for Account update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Account apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Account apply(Context context); + } + /** The Account update stages. */ + interface UpdateStages { + /** The stage of the Account update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The tags of the resource. + * + * @param tags The tags of the resource. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Account refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Account refresh(Context context); + + /** + * List keys of the EngagementFabric account. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric account keys as paginated response with {@link PagedIterable}. + */ + PagedIterable listKeys(); + + /** + * List keys of the EngagementFabric account. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric account keys as paginated response with {@link PagedIterable}. + */ + PagedIterable listKeys(Context context); + + /** + * Regenerate key of the EngagementFabric account. + * + * @param parameter Parameters specifying the key to be regenerated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of the EngagementFabric account key. + */ + KeyDescription regenerateKey(RegenerateKeyParameter parameter); + + /** + * Regenerate key of the EngagementFabric account. + * + * @param parameter Parameters specifying the key to be regenerated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of the EngagementFabric account key along with {@link Response}. + */ + Response regenerateKeyWithResponse(RegenerateKeyParameter parameter, Context context); + + /** + * List available EngagementFabric channel types and functions. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of the EngagementFabric channel descriptions. + */ + ChannelTypeDescriptionList listChannelTypes(); + + /** + * List available EngagementFabric channel types and functions. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of the EngagementFabric channel descriptions along with {@link Response}. + */ + Response listChannelTypesWithResponse(Context context); +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/AccountList.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/AccountList.java new file mode 100644 index 000000000000..258f35162e34 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/AccountList.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.engagementfabric.fluent.models.AccountInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of the EngagementFabric accounts. */ +@Fluent +public final class AccountList { + /* + * EngagementFabric accounts + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: EngagementFabric accounts. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: EngagementFabric accounts. + * + * @param value the value value to set. + * @return the AccountList object itself. + */ + public AccountList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/AccountPatch.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/AccountPatch.java new file mode 100644 index 000000000000..f366046508f3 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/AccountPatch.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The patch of EngagementFabric account. */ +@Fluent +public final class AccountPatch { + /* + * The tags of the resource + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Get the tags property: The tags of the resource. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The tags of the resource. + * + * @param tags the tags value to set. + * @return the AccountPatch object itself. + */ + public AccountPatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/Accounts.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/Accounts.java new file mode 100644 index 000000000000..c35a6931947c --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/Accounts.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Accounts. */ +public interface Accounts { + /** + * Get the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric account. + */ + Account getByResourceGroup(String resourceGroupName, String accountName); + + /** + * Get the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric account along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * Delete the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String accountName); + + /** + * Delete the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * List the EngagementFabric accounts in given subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric accounts as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List the EngagementFabric accounts in given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric accounts as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List EngagementFabric accounts in given resource group. + * + * @param resourceGroupName Resource Group Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric accounts as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List EngagementFabric accounts in given resource group. + * + * @param resourceGroupName Resource Group Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric accounts as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List keys of the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric account keys as paginated response with {@link PagedIterable}. + */ + PagedIterable listKeys(String resourceGroupName, String accountName); + + /** + * List keys of the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric account keys as paginated response with {@link PagedIterable}. + */ + PagedIterable listKeys(String resourceGroupName, String accountName, Context context); + + /** + * Regenerate key of the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param parameter Parameters specifying the key to be regenerated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of the EngagementFabric account key. + */ + KeyDescription regenerateKey(String resourceGroupName, String accountName, RegenerateKeyParameter parameter); + + /** + * Regenerate key of the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param parameter Parameters specifying the key to be regenerated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of the EngagementFabric account key along with {@link Response}. + */ + Response regenerateKeyWithResponse( + String resourceGroupName, String accountName, RegenerateKeyParameter parameter, Context context); + + /** + * List available EngagementFabric channel types and functions. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of the EngagementFabric channel descriptions. + */ + ChannelTypeDescriptionList listChannelTypes(String resourceGroupName, String accountName); + + /** + * List available EngagementFabric channel types and functions. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of the EngagementFabric channel descriptions along with {@link Response}. + */ + Response listChannelTypesWithResponse( + String resourceGroupName, String accountName, Context context); + + /** + * Get the EngagementFabric account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric account along with {@link Response}. + */ + Account getById(String id); + + /** + * Get the EngagementFabric account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric account along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the EngagementFabric account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete the EngagementFabric account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Account resource. + * + * @param name resource name. + * @return the first stage of the new Account definition. + */ + Account.DefinitionStages.Blank define(String name); +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/Channel.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/Channel.java new file mode 100644 index 000000000000..121d4c121fa6 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/Channel.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.engagementfabric.fluent.models.ChannelInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of Channel. */ +public interface Channel { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the channelType property: The channel type. + * + * @return the channelType value. + */ + String channelType(); + + /** + * Gets the channelFunctions property: The functions to be enabled for the channel. + * + * @return the channelFunctions value. + */ + List channelFunctions(); + + /** + * Gets the credentials property: The channel credentials. + * + * @return the credentials value. + */ + Map credentials(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.engagementfabric.fluent.models.ChannelInner object. + * + * @return the inner object. + */ + ChannelInner innerModel(); + + /** The entirety of the Channel definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Channel definition stages. */ + interface DefinitionStages { + /** The first stage of the Channel definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Channel definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @return the next definition stage. + */ + WithCreate withExistingAccount(String resourceGroupName, String accountName); + } + /** + * The stage of the Channel definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithChannelType, + DefinitionStages.WithChannelFunctions, + DefinitionStages.WithCredentials { + /** + * Executes the create request. + * + * @return the created resource. + */ + Channel create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Channel create(Context context); + } + /** The stage of the Channel definition allowing to specify channelType. */ + interface WithChannelType { + /** + * Specifies the channelType property: The channel type. + * + * @param channelType The channel type. + * @return the next definition stage. + */ + WithCreate withChannelType(String channelType); + } + /** The stage of the Channel definition allowing to specify channelFunctions. */ + interface WithChannelFunctions { + /** + * Specifies the channelFunctions property: The functions to be enabled for the channel. + * + * @param channelFunctions The functions to be enabled for the channel. + * @return the next definition stage. + */ + WithCreate withChannelFunctions(List channelFunctions); + } + /** The stage of the Channel definition allowing to specify credentials. */ + interface WithCredentials { + /** + * Specifies the credentials property: The channel credentials. + * + * @param credentials The channel credentials. + * @return the next definition stage. + */ + WithCreate withCredentials(Map credentials); + } + } + /** + * Begins update for the Channel resource. + * + * @return the stage of resource update. + */ + Channel.Update update(); + + /** The template for Channel update. */ + interface Update + extends UpdateStages.WithChannelType, UpdateStages.WithChannelFunctions, UpdateStages.WithCredentials { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Channel apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Channel apply(Context context); + } + /** The Channel update stages. */ + interface UpdateStages { + /** The stage of the Channel update allowing to specify channelType. */ + interface WithChannelType { + /** + * Specifies the channelType property: The channel type. + * + * @param channelType The channel type. + * @return the next definition stage. + */ + Update withChannelType(String channelType); + } + /** The stage of the Channel update allowing to specify channelFunctions. */ + interface WithChannelFunctions { + /** + * Specifies the channelFunctions property: The functions to be enabled for the channel. + * + * @param channelFunctions The functions to be enabled for the channel. + * @return the next definition stage. + */ + Update withChannelFunctions(List channelFunctions); + } + /** The stage of the Channel update allowing to specify credentials. */ + interface WithCredentials { + /** + * Specifies the credentials property: The channel credentials. + * + * @param credentials The channel credentials. + * @return the next definition stage. + */ + Update withCredentials(Map credentials); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Channel refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Channel refresh(Context context); +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/ChannelList.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/ChannelList.java new file mode 100644 index 000000000000..c28276219ac8 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/ChannelList.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.engagementfabric.fluent.models.ChannelInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of the EngagementFabric channels. */ +@Fluent +public final class ChannelList { + /* + * EngagementFabric channels + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: EngagementFabric channels. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: EngagementFabric channels. + * + * @param value the value value to set. + * @return the ChannelList object itself. + */ + public ChannelList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/ChannelTypeDescription.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/ChannelTypeDescription.java new file mode 100644 index 000000000000..f2ebd11bb714 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/ChannelTypeDescription.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** EngagementFabric channel description. */ +@Fluent +public final class ChannelTypeDescription { + /* + * Channel type + */ + @JsonProperty(value = "channelType") + private String channelType; + + /* + * Text description for the channel + */ + @JsonProperty(value = "channelDescription") + private String channelDescription; + + /* + * All the available functions for the channel + */ + @JsonProperty(value = "channelFunctions") + private List channelFunctions; + + /** + * Get the channelType property: Channel type. + * + * @return the channelType value. + */ + public String channelType() { + return this.channelType; + } + + /** + * Set the channelType property: Channel type. + * + * @param channelType the channelType value to set. + * @return the ChannelTypeDescription object itself. + */ + public ChannelTypeDescription withChannelType(String channelType) { + this.channelType = channelType; + return this; + } + + /** + * Get the channelDescription property: Text description for the channel. + * + * @return the channelDescription value. + */ + public String channelDescription() { + return this.channelDescription; + } + + /** + * Set the channelDescription property: Text description for the channel. + * + * @param channelDescription the channelDescription value to set. + * @return the ChannelTypeDescription object itself. + */ + public ChannelTypeDescription withChannelDescription(String channelDescription) { + this.channelDescription = channelDescription; + return this; + } + + /** + * Get the channelFunctions property: All the available functions for the channel. + * + * @return the channelFunctions value. + */ + public List channelFunctions() { + return this.channelFunctions; + } + + /** + * Set the channelFunctions property: All the available functions for the channel. + * + * @param channelFunctions the channelFunctions value to set. + * @return the ChannelTypeDescription object itself. + */ + public ChannelTypeDescription withChannelFunctions(List channelFunctions) { + this.channelFunctions = channelFunctions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/ChannelTypeDescriptionList.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/ChannelTypeDescriptionList.java new file mode 100644 index 000000000000..6624089ed49f --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/ChannelTypeDescriptionList.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.models; + +import com.azure.resourcemanager.engagementfabric.fluent.models.ChannelTypeDescriptionListInner; +import java.util.List; + +/** An immutable client-side representation of ChannelTypeDescriptionList. */ +public interface ChannelTypeDescriptionList { + /** + * Gets the value property: Channel descriptions. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.engagementfabric.fluent.models.ChannelTypeDescriptionListInner object. + * + * @return the inner object. + */ + ChannelTypeDescriptionListInner innerModel(); +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/Channels.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/Channels.java new file mode 100644 index 000000000000..833923b51976 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/Channels.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Channels. */ +public interface Channels { + /** + * Get the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param channelName Channel Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric channel. + */ + Channel get(String resourceGroupName, String accountName, String channelName); + + /** + * Get the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param channelName Channel Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric channel along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String accountName, String channelName, Context context); + + /** + * Delete the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param channelName The EngagementFabric channel name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String channelName); + + /** + * Delete the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param channelName The EngagementFabric channel name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse( + String resourceGroupName, String accountName, String channelName, Context context); + + /** + * List the EngagementFabric channels. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric channels as paginated response with {@link PagedIterable}. + */ + PagedIterable listByAccount(String resourceGroupName, String accountName); + + /** + * List the EngagementFabric channels. + * + * @param resourceGroupName Resource Group Name. + * @param accountName Account Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric channels as paginated response with {@link PagedIterable}. + */ + PagedIterable listByAccount(String resourceGroupName, String accountName, Context context); + + /** + * Get the EngagementFabric channel. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric channel along with {@link Response}. + */ + Channel getById(String id); + + /** + * Get the EngagementFabric channel. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the EngagementFabric channel along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the EngagementFabric channel. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete the EngagementFabric channel. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Channel resource. + * + * @param name resource name. + * @return the first stage of the new Channel definition. + */ + Channel.DefinitionStages.Blank define(String name); +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/CheckNameAvailabilityParameter.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/CheckNameAvailabilityParameter.java new file mode 100644 index 000000000000..f06417b8af8e --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/CheckNameAvailabilityParameter.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameter for name availability check. */ +@Fluent +public final class CheckNameAvailabilityParameter { + /* + * The name to be checked + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The fully qualified resource type for the name to be checked + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Get the name property: The name to be checked. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name to be checked. + * + * @param name the name value to set. + * @return the CheckNameAvailabilityParameter object itself. + */ + public CheckNameAvailabilityParameter withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The fully qualified resource type for the name to be checked. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The fully qualified resource type for the name to be checked. + * + * @param type the type value to set. + * @return the CheckNameAvailabilityParameter object itself. + */ + public CheckNameAvailabilityParameter withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model CheckNameAvailabilityParameter")); + } + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property type in model CheckNameAvailabilityParameter")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CheckNameAvailabilityParameter.class); +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/CheckNameAvailabilityResult.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/CheckNameAvailabilityResult.java new file mode 100644 index 000000000000..f594e3117879 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/CheckNameAvailabilityResult.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.models; + +import com.azure.resourcemanager.engagementfabric.fluent.models.CheckNameAvailabilityResultInner; + +/** An immutable client-side representation of CheckNameAvailabilityResult. */ +public interface CheckNameAvailabilityResult { + /** + * Gets the nameAvailable property: The name to be checked. + * + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * Gets the reason property: The reason if name is unavailable. + * + * @return the reason value. + */ + CheckNameUnavailableReason reason(); + + /** + * Gets the message property: The message if name is unavailable. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.engagementfabric.fluent.models.CheckNameAvailabilityResultInner object. + * + * @return the inner object. + */ + CheckNameAvailabilityResultInner innerModel(); +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/CheckNameUnavailableReason.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/CheckNameUnavailableReason.java new file mode 100644 index 000000000000..6d3ea092d3bf --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/CheckNameUnavailableReason.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CheckNameUnavailableReason. */ +public final class CheckNameUnavailableReason extends ExpandableStringEnum { + /** Static value Invalid for CheckNameUnavailableReason. */ + public static final CheckNameUnavailableReason INVALID = fromString("Invalid"); + + /** Static value AlreadyExists for CheckNameUnavailableReason. */ + public static final CheckNameUnavailableReason ALREADY_EXISTS = fromString("AlreadyExists"); + + /** + * Creates or finds a CheckNameUnavailableReason from its string representation. + * + * @param name a name to look for. + * @return the corresponding CheckNameUnavailableReason. + */ + @JsonCreator + public static CheckNameUnavailableReason fromString(String name) { + return fromString(name, CheckNameUnavailableReason.class); + } + + /** + * Gets known CheckNameUnavailableReason values. + * + * @return known CheckNameUnavailableReason values. + */ + public static Collection values() { + return values(CheckNameUnavailableReason.class); + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/KeyDescription.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/KeyDescription.java new file mode 100644 index 000000000000..5ef59aee3a60 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/KeyDescription.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.models; + +import com.azure.resourcemanager.engagementfabric.fluent.models.KeyDescriptionInner; + +/** An immutable client-side representation of KeyDescription. */ +public interface KeyDescription { + /** + * Gets the name property: The name of the key. + * + * @return the name value. + */ + String name(); + + /** + * Gets the rank property: The rank of the key. + * + * @return the rank value. + */ + KeyRank rank(); + + /** + * Gets the value property: The value of the key. + * + * @return the value value. + */ + String value(); + + /** + * Gets the inner com.azure.resourcemanager.engagementfabric.fluent.models.KeyDescriptionInner object. + * + * @return the inner object. + */ + KeyDescriptionInner innerModel(); +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/KeyDescriptionList.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/KeyDescriptionList.java new file mode 100644 index 000000000000..067de1164cb0 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/KeyDescriptionList.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.engagementfabric.fluent.models.KeyDescriptionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of the EngagementFabric account keys. */ +@Immutable +public final class KeyDescriptionList { + /* + * Account keys + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get the value property: Account keys. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/KeyRank.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/KeyRank.java new file mode 100644 index 000000000000..26350f3ac7b8 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/KeyRank.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for KeyRank. */ +public final class KeyRank extends ExpandableStringEnum { + /** Static value PrimaryKey for KeyRank. */ + public static final KeyRank PRIMARY_KEY = fromString("PrimaryKey"); + + /** Static value SecondaryKey for KeyRank. */ + public static final KeyRank SECONDARY_KEY = fromString("SecondaryKey"); + + /** + * Creates or finds a KeyRank from its string representation. + * + * @param name a name to look for. + * @return the corresponding KeyRank. + */ + @JsonCreator + public static KeyRank fromString(String name) { + return fromString(name, KeyRank.class); + } + + /** + * Gets known KeyRank values. + * + * @return known KeyRank values. + */ + public static Collection values() { + return values(KeyRank.class); + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/Operation.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/Operation.java new file mode 100644 index 000000000000..4f79cb74fa0c --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/Operation.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.models; + +import com.azure.resourcemanager.engagementfabric.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: The name of the EngagementFabric operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: The display content of the EngagementFabric operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the inner com.azure.resourcemanager.engagementfabric.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/OperationDisplay.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/OperationDisplay.java new file mode 100644 index 000000000000..c0c1c5325ea9 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/OperationDisplay.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The display information of the EngagementFabric operation. */ +@Immutable +public final class OperationDisplay { + /* + * The resource provider namespace of the EngagementFabric operation + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /* + * The resource type of the EngagementFabric operation + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /* + * The name of the EngagementFabric operation + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /* + * The description of the EngagementFabric operation + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get the provider property: The resource provider namespace of the EngagementFabric operation. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The resource type of the EngagementFabric operation. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The name of the EngagementFabric operation. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The description of the EngagementFabric operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/OperationList.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/OperationList.java new file mode 100644 index 000000000000..89f9fbfcb2cc --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/OperationList.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.engagementfabric.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of the EngagementFabric operations. */ +@Immutable +public final class OperationList { + /* + * The EngagementFabric operations + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get the value property: The EngagementFabric operations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/Operations.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/Operations.java new file mode 100644 index 000000000000..4482083e2e7d --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/Operations.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * List operation of EngagementFabric resources. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric operations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List operation of EngagementFabric resources. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric operations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/ProxyOnlyResource.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/ProxyOnlyResource.java new file mode 100644 index 000000000000..68204f172f9f --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/ProxyOnlyResource.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; + +/** The base model for the proxy-only Azure resource. */ +@Immutable +public class ProxyOnlyResource extends ProxyResource { + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/RegenerateKeyParameter.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/RegenerateKeyParameter.java new file mode 100644 index 000000000000..0ff1fc5e7c0e --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/RegenerateKeyParameter.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameter to regenerate single EngagementFabric account key. */ +@Fluent +public final class RegenerateKeyParameter { + /* + * The name of key to be regenerated + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The rank of the key to be regenerated + */ + @JsonProperty(value = "rank", required = true) + private KeyRank rank; + + /** + * Get the name property: The name of key to be regenerated. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of key to be regenerated. + * + * @param name the name value to set. + * @return the RegenerateKeyParameter object itself. + */ + public RegenerateKeyParameter withName(String name) { + this.name = name; + return this; + } + + /** + * Get the rank property: The rank of the key to be regenerated. + * + * @return the rank value. + */ + public KeyRank rank() { + return this.rank; + } + + /** + * Set the rank property: The rank of the key to be regenerated. + * + * @param rank the rank value to set. + * @return the RegenerateKeyParameter object itself. + */ + public RegenerateKeyParameter withRank(KeyRank rank) { + this.rank = rank; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model RegenerateKeyParameter")); + } + if (rank() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property rank in model RegenerateKeyParameter")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RegenerateKeyParameter.class); +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/ResourceProviders.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/ResourceProviders.java new file mode 100644 index 000000000000..eef181ff9da0 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/ResourceProviders.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ResourceProviders. */ +public interface ResourceProviders { + /** + * Check availability of EngagementFabric resource. + * + * @param resourceGroupName Resource Group Name. + * @param parameters Parameter describing the name to be checked. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of name availability check. + */ + CheckNameAvailabilityResult checkNameAvailability( + String resourceGroupName, CheckNameAvailabilityParameter parameters); + + /** + * Check availability of EngagementFabric resource. + * + * @param resourceGroupName Resource Group Name. + * @param parameters Parameter describing the name to be checked. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of name availability check along with {@link Response}. + */ + Response checkNameAvailabilityWithResponse( + String resourceGroupName, CheckNameAvailabilityParameter parameters, Context context); +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/SKUs.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/SKUs.java new file mode 100644 index 000000000000..2fd16f658677 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/SKUs.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of SKUs. */ +public interface SKUs { + /** + * List available SKUs of EngagementFabric resource. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric SKU descriptions as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List available SKUs of EngagementFabric resource. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric SKU descriptions as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/Sku.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/Sku.java new file mode 100644 index 000000000000..44a3f7f4ace9 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/Sku.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The EngagementFabric SKU. */ +@Fluent +public final class Sku { + /* + * The name of the SKU + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The price tier of the SKU + */ + @JsonProperty(value = "tier") + private String tier; + + /** + * Get the name property: The name of the SKU. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the SKU. + * + * @param name the name value to set. + * @return the Sku object itself. + */ + public Sku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier property: The price tier of the SKU. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier property: The price tier of the SKU. + * + * @param tier the tier value to set. + * @return the Sku object itself. + */ + public Sku withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Sku.class); +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/SkuDescription.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/SkuDescription.java new file mode 100644 index 000000000000..efe9097ffca0 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/SkuDescription.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.models; + +import com.azure.resourcemanager.engagementfabric.fluent.models.SkuDescriptionInner; +import java.util.List; + +/** An immutable client-side representation of SkuDescription. */ +public interface SkuDescription { + /** + * Gets the resourceType property: The fully qualified resource type. + * + * @return the resourceType value. + */ + String resourceType(); + + /** + * Gets the name property: The name of the SKU. + * + * @return the name value. + */ + String name(); + + /** + * Gets the tier property: The price tier of the SKU. + * + * @return the tier value. + */ + String tier(); + + /** + * Gets the locations property: The set of locations that the SKU is available. + * + * @return the locations value. + */ + List locations(); + + /** + * Gets the locationInfo property: Locations and zones. + * + * @return the locationInfo value. + */ + List locationInfo(); + + /** + * Gets the restrictions property: The restrictions because of which SKU cannot be used. + * + * @return the restrictions value. + */ + List restrictions(); + + /** + * Gets the inner com.azure.resourcemanager.engagementfabric.fluent.models.SkuDescriptionInner object. + * + * @return the inner object. + */ + SkuDescriptionInner innerModel(); +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/SkuDescriptionList.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/SkuDescriptionList.java new file mode 100644 index 000000000000..d9f54087fd6e --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/SkuDescriptionList.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.engagementfabric.fluent.models.SkuDescriptionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of the EngagementFabric SKU descriptions. */ +@Immutable +public final class SkuDescriptionList { + /* + * SKU descriptions + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get the value property: SKU descriptions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/SkuLocationInfoItem.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/SkuLocationInfoItem.java new file mode 100644 index 000000000000..c4ef4e6366dc --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/SkuLocationInfoItem.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The Locations and zones info for SKU. */ +@Fluent +public final class SkuLocationInfoItem { + /* + * The available location of the SKU + */ + @JsonProperty(value = "location") + private String location; + + /* + * The available zone of the SKU + */ + @JsonProperty(value = "zones") + private List zones; + + /** + * Get the location property: The available location of the SKU. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The available location of the SKU. + * + * @param location the location value to set. + * @return the SkuLocationInfoItem object itself. + */ + public SkuLocationInfoItem withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the zones property: The available zone of the SKU. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: The available zone of the SKU. + * + * @param zones the zones value to set. + * @return the SkuLocationInfoItem object itself. + */ + public SkuLocationInfoItem withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/package-info.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/package-info.java new file mode 100644 index 000000000000..55777dd7b15f --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for EngagementFabric. Microsoft Customer Engagement Fabric. */ +package com.azure.resourcemanager.engagementfabric.models; diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/package-info.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/package-info.java new file mode 100644 index 000000000000..bb72025d3f8a --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/com/azure/resourcemanager/engagementfabric/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for EngagementFabric. Microsoft Customer Engagement Fabric. */ +package com.azure.resourcemanager.engagementfabric; diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/module-info.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/module-info.java new file mode 100644 index 000000000000..f1f78ab55fc1 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.engagementfabric { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.engagementfabric; + exports com.azure.resourcemanager.engagementfabric.fluent; + exports com.azure.resourcemanager.engagementfabric.fluent.models; + exports com.azure.resourcemanager.engagementfabric.models; + + opens com.azure.resourcemanager.engagementfabric.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.engagementfabric.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsCreateOrUpdateSamples.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..7bcbe81a1578 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsCreateOrUpdateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.generated; + +import com.azure.resourcemanager.engagementfabric.models.Sku; + +/** Samples for Accounts CreateOrUpdate. */ +public final class AccountsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/engagementfabric/resource-manager/Microsoft.EngagementFabric/preview/2018-09-01/examples/AccountsCreateOrUpdateExample.json + */ + /** + * Sample code: AccountsCreateOrUpdateExample. + * + * @param manager Entry point to EngagementFabricManager. + */ + public static void accountsCreateOrUpdateExample( + com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager) { + manager + .accounts() + .define("ExampleAccount") + .withRegion("WestUS") + .withExistingResourceGroup("ExampleRg") + .withSku(new Sku().withName("B1")) + .create(); + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsDeleteSamples.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsDeleteSamples.java new file mode 100644 index 000000000000..623d5528ef94 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.generated; + +import com.azure.core.util.Context; + +/** Samples for Accounts Delete. */ +public final class AccountsDeleteSamples { + /* + * x-ms-original-file: specification/engagementfabric/resource-manager/Microsoft.EngagementFabric/preview/2018-09-01/examples/AccountsDeleteExample.json + */ + /** + * Sample code: AccountsDeleteExample. + * + * @param manager Entry point to EngagementFabricManager. + */ + public static void accountsDeleteExample( + com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager) { + manager.accounts().deleteWithResponse("ExampleRg", "ExampleAccount", Context.NONE); + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsGetByResourceGroupSamples.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..38367abe9b45 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.generated; + +import com.azure.core.util.Context; + +/** Samples for Accounts GetByResourceGroup. */ +public final class AccountsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/engagementfabric/resource-manager/Microsoft.EngagementFabric/preview/2018-09-01/examples/AccountsGetExample.json + */ + /** + * Sample code: AccountsGetExample. + * + * @param manager Entry point to EngagementFabricManager. + */ + public static void accountsGetExample(com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager) { + manager.accounts().getByResourceGroupWithResponse("ExampleRg", "ExampleAccount", Context.NONE); + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsListByResourceGroupSamples.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsListByResourceGroupSamples.java new file mode 100644 index 000000000000..29b83428d112 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.generated; + +import com.azure.core.util.Context; + +/** Samples for Accounts ListByResourceGroup. */ +public final class AccountsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/engagementfabric/resource-manager/Microsoft.EngagementFabric/preview/2018-09-01/examples/AccountsListByResourceGroupExample.json + */ + /** + * Sample code: AccountsListByResourceGroupExample. + * + * @param manager Entry point to EngagementFabricManager. + */ + public static void accountsListByResourceGroupExample( + com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager) { + manager.accounts().listByResourceGroup("ExampleRg", Context.NONE); + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsListChannelTypesSamples.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsListChannelTypesSamples.java new file mode 100644 index 000000000000..45ea803f6301 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsListChannelTypesSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.generated; + +import com.azure.core.util.Context; + +/** Samples for Accounts ListChannelTypes. */ +public final class AccountsListChannelTypesSamples { + /* + * x-ms-original-file: specification/engagementfabric/resource-manager/Microsoft.EngagementFabric/preview/2018-09-01/examples/AccountsListChannelTypesExample.json + */ + /** + * Sample code: AccountsListChannelTypesExample. + * + * @param manager Entry point to EngagementFabricManager. + */ + public static void accountsListChannelTypesExample( + com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager) { + manager.accounts().listChannelTypesWithResponse("ExampleRg", "ExampleAccount", Context.NONE); + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsListKeysSamples.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsListKeysSamples.java new file mode 100644 index 000000000000..f9ad2d97bf0a --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsListKeysSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.generated; + +import com.azure.core.util.Context; + +/** Samples for Accounts ListKeys. */ +public final class AccountsListKeysSamples { + /* + * x-ms-original-file: specification/engagementfabric/resource-manager/Microsoft.EngagementFabric/preview/2018-09-01/examples/AccountsListKeysExample.json + */ + /** + * Sample code: AccountsListKeysExample. + * + * @param manager Entry point to EngagementFabricManager. + */ + public static void accountsListKeysExample( + com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager) { + manager.accounts().listKeys("ExampleRg", "ExampleAccount", Context.NONE); + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsListSamples.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsListSamples.java new file mode 100644 index 000000000000..a40623c2112e --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.generated; + +import com.azure.core.util.Context; + +/** Samples for Accounts List. */ +public final class AccountsListSamples { + /* + * x-ms-original-file: specification/engagementfabric/resource-manager/Microsoft.EngagementFabric/preview/2018-09-01/examples/AccountsListExample.json + */ + /** + * Sample code: AccountsListExample. + * + * @param manager Entry point to EngagementFabricManager. + */ + public static void accountsListExample(com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager) { + manager.accounts().list(Context.NONE); + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsRegenerateKeySamples.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsRegenerateKeySamples.java new file mode 100644 index 000000000000..126384369191 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsRegenerateKeySamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.generated; + +import com.azure.core.util.Context; + +/** Samples for Accounts RegenerateKey. */ +public final class AccountsRegenerateKeySamples { + /* + * x-ms-original-file: specification/engagementfabric/resource-manager/Microsoft.EngagementFabric/preview/2018-09-01/examples/AccountsRegenerateKeyExample.json + */ + /** + * Sample code: AccountsRegenerateKeyExample. + * + * @param manager Entry point to EngagementFabricManager. + */ + public static void accountsRegenerateKeyExample( + com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager) { + manager.accounts().regenerateKeyWithResponse("ExampleRg", "ExampleAccount", null, Context.NONE); + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsUpdateSamples.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsUpdateSamples.java new file mode 100644 index 000000000000..bad7cb9b21c6 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/AccountsUpdateSamples.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.engagementfabric.models.Account; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Accounts Update. */ +public final class AccountsUpdateSamples { + /* + * x-ms-original-file: specification/engagementfabric/resource-manager/Microsoft.EngagementFabric/preview/2018-09-01/examples/AccountsUpdateExample.json + */ + /** + * Sample code: AccountsUpdateExample. + * + * @param manager Entry point to EngagementFabricManager. + */ + public static void accountsUpdateExample( + com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager) { + Account resource = + manager.accounts().getByResourceGroupWithResponse("ExampleRg", "ExampleAccount", Context.NONE).getValue(); + resource.update().withTags(mapOf("tagName", "tagValue")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/ChannelsCreateOrUpdateSamples.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/ChannelsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..f47a0b8d0fc2 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/ChannelsCreateOrUpdateSamples.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.generated; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Channels CreateOrUpdate. */ +public final class ChannelsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/engagementfabric/resource-manager/Microsoft.EngagementFabric/preview/2018-09-01/examples/ChannelsCreateOrUpdateExample.json + */ + /** + * Sample code: ChannelsCreateOrUpdateExample. + * + * @param manager Entry point to EngagementFabricManager. + */ + public static void channelsCreateOrUpdateExample( + com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager) { + manager + .channels() + .define("ExampleChannel") + .withExistingAccount("ExampleRg", "ExampleAccount") + .withChannelType("MockChannel") + .withChannelFunctions(Arrays.asList("MockFunction1", "MockFunction2")) + .withCredentials(mapOf("AppId", "exampleApp", "AppKey", "exampleAppKey")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/ChannelsDeleteSamples.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/ChannelsDeleteSamples.java new file mode 100644 index 000000000000..61cd1eada48b --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/ChannelsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.generated; + +import com.azure.core.util.Context; + +/** Samples for Channels Delete. */ +public final class ChannelsDeleteSamples { + /* + * x-ms-original-file: specification/engagementfabric/resource-manager/Microsoft.EngagementFabric/preview/2018-09-01/examples/ChannelsDeleteExample.json + */ + /** + * Sample code: ChannelsDeleteExample. + * + * @param manager Entry point to EngagementFabricManager. + */ + public static void channelsDeleteExample( + com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager) { + manager.channels().deleteWithResponse("ExampleRg", "ExampleAccount", "ExampleChannel", Context.NONE); + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/ChannelsGetSamples.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/ChannelsGetSamples.java new file mode 100644 index 000000000000..f30957a28f7a --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/ChannelsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.generated; + +import com.azure.core.util.Context; + +/** Samples for Channels Get. */ +public final class ChannelsGetSamples { + /* + * x-ms-original-file: specification/engagementfabric/resource-manager/Microsoft.EngagementFabric/preview/2018-09-01/examples/ChannelsGetExample.json + */ + /** + * Sample code: ChannelsGetExample. + * + * @param manager Entry point to EngagementFabricManager. + */ + public static void channelsGetExample(com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager) { + manager.channels().getWithResponse("ExampleRg", "ExampleAccount", "ExampleChannel", Context.NONE); + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/ChannelsListByAccountSamples.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/ChannelsListByAccountSamples.java new file mode 100644 index 000000000000..1756d5dc7f94 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/ChannelsListByAccountSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.generated; + +import com.azure.core.util.Context; + +/** Samples for Channels ListByAccount. */ +public final class ChannelsListByAccountSamples { + /* + * x-ms-original-file: specification/engagementfabric/resource-manager/Microsoft.EngagementFabric/preview/2018-09-01/examples/ChannelsListExample.json + */ + /** + * Sample code: ChannelsListExample. + * + * @param manager Entry point to EngagementFabricManager. + */ + public static void channelsListExample(com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager) { + manager.channels().listByAccount("ExampleRg", "ExampleAccount", Context.NONE); + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/OperationsListSamples.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/OperationsListSamples.java new file mode 100644 index 000000000000..44b0557f6571 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/OperationsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/engagementfabric/resource-manager/Microsoft.EngagementFabric/preview/2018-09-01/examples/OperationsListExample.json + */ + /** + * Sample code: OperationsListExample. + * + * @param manager Entry point to EngagementFabricManager. + */ + public static void operationsListExample( + com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/ResourceProviderCheckNameAvailabilitySamples.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/ResourceProviderCheckNameAvailabilitySamples.java new file mode 100644 index 000000000000..985c4d894f4d --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/ResourceProviderCheckNameAvailabilitySamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.generated; + +import com.azure.core.util.Context; + +/** Samples for ResourceProvider CheckNameAvailability. */ +public final class ResourceProviderCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/engagementfabric/resource-manager/Microsoft.EngagementFabric/preview/2018-09-01/examples/CheckNameAvailabilityExample.json + */ + /** + * Sample code: CheckNameAvailabilityExample. + * + * @param manager Entry point to EngagementFabricManager. + */ + public static void checkNameAvailabilityExample( + com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager) { + manager.resourceProviders().checkNameAvailabilityWithResponse(null, null, Context.NONE); + } +} diff --git a/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/SKUsListSamples.java b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/SKUsListSamples.java new file mode 100644 index 000000000000..600d6ab4a4a1 --- /dev/null +++ b/sdk/engagementfabric/azure-resourcemanager-engagementfabric/src/samples/java/com/azure/resourcemanager/engagementfabric/generated/SKUsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.engagementfabric.generated; + +import com.azure.core.util.Context; + +/** Samples for SKUs List. */ +public final class SKUsListSamples { + /* + * x-ms-original-file: specification/engagementfabric/resource-manager/Microsoft.EngagementFabric/preview/2018-09-01/examples/SKUsListExample.json + */ + /** + * Sample code: SKUsListExample. + * + * @param manager Entry point to EngagementFabricManager. + */ + public static void sKUsListExample(com.azure.resourcemanager.engagementfabric.EngagementFabricManager manager) { + manager.sKUs().list(Context.NONE); + } +} diff --git a/sdk/engagementfabric/ci.yml b/sdk/engagementfabric/ci.yml new file mode 100644 index 000000000000..57468c339a2d --- /dev/null +++ b/sdk/engagementfabric/ci.yml @@ -0,0 +1,39 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/engagementfabric/ci.yml + - sdk/engagementfabric/azure-resourcemanager-engagementfabric/ + exclude: + - sdk/engagementfabric/pom.xml + - sdk/engagementfabric/azure-resourcemanager-engagementfabric/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/engagementfabric/ci.yml + - sdk/engagementfabric/azure-resourcemanager-engagementfabric/ + exclude: + - sdk/engagementfabric/pom.xml + - sdk/engagementfabric/azure-resourcemanager-engagementfabric/pom.xml + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: engagementfabric + Artifacts: + - name: azure-resourcemanager-engagementfabric + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerengagementfabric diff --git a/sdk/engagementfabric/pom.xml b/sdk/engagementfabric/pom.xml new file mode 100644 index 000000000000..8b8f43856982 --- /dev/null +++ b/sdk/engagementfabric/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-engagementfabric-service + pom + 1.0.0 + + + + coverage + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + report-aggregate + verify + + report-aggregate + + + ${project.reporting.outputDirectory}/test-coverage + + + + + + + + + default + + true + + + azure-resourcemanager-engagementfabric + + + +