From 0b69ef5801f9f713b33ab222143dde260525f4bc Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 9 Jan 2023 06:57:27 +0000 Subject: [PATCH] CodeGen from PR 22099 in Azure/azure-rest-api-specs Merge 1f09b0dd258b09ffe43800c42e1dc9d1f503b534 into 9bfb9a0eca48d80d69453973e7597a31a0ecc9c2 --- .../CHANGELOG.md | 4 +- .../README.md | 27 +- .../SAMPLE.md | 723 +++- .../pom.xml | 2 +- .../servicelinker/ServiceLinkerManager.java | 53 +- .../ConfigurationNamesOperationsClient.java | 40 + .../fluent/ConnectorsClient.java | 685 ++++ .../servicelinker/fluent/LinkersClient.java | 76 +- .../fluent/LinkersOperationsClient.java | 249 ++ .../fluent/ServiceLinkerManagementClient.java | 21 + .../models/ConfigurationNameItemInner.java | 138 + .../fluent/models/ConfigurationNames.java | 135 + ...ner.java => ConfigurationResultInner.java} | 10 +- .../fluent/models/DryrunProperties.java | 108 + .../fluent/models/DryrunResourceInner.java | 113 + .../fluent/models/LinkerProperties.java | 70 +- .../fluent/models/LinkerResourceInner.java | 62 +- .../fluent/models/OperationInner.java | 26 +- .../models/ValidateOperationResultInner.java | 16 +- .../fluent/models/ValidateResult.java | 12 +- .../ConfigurationNameItemImpl.java | 55 + ...onfigurationNamesOperationsClientImpl.java | 316 ++ .../ConfigurationNamesOperationsImpl.java | 46 + ...Impl.java => ConfigurationResultImpl.java} | 14 +- .../implementation/ConnectorsClientImpl.java | 3326 +++++++++++++++++ .../implementation/ConnectorsImpl.java | 475 +++ .../implementation/DryrunResourceImpl.java | 184 + .../implementation/LinkerResourceImpl.java | 117 +- .../implementation/LinkersClientImpl.java | 184 +- .../implementation/LinkersImpl.java | 172 +- .../LinkersOperationsClientImpl.java | 1239 ++++++ .../implementation/LinkersOperationsImpl.java | 144 + .../implementation/OperationsClientImpl.java | 8 +- .../ServiceLinkerManagementClientBuilder.java | 29 +- .../ServiceLinkerManagementClientImpl.java | 44 +- .../models/AccessKeyInfoBase.java | 63 + .../models/AccessKeyPermissions.java | 47 + .../servicelinker/models/ActionType.java | 8 +- .../servicelinker/models/AllowType.java | 38 + .../servicelinker/models/AuthInfoBase.java | 8 +- .../servicelinker/models/AuthType.java | 8 +- .../models/AzureKeyVaultProperties.java | 4 + .../servicelinker/models/AzureResource.java | 4 + .../models/AzureResourcePropertiesBase.java | 4 + .../models/AzureResourceType.java | 2 +- .../BasicErrorDryrunPrerequisiteResult.java | 82 + .../servicelinker/models/ClientType.java | 5 +- .../models/ConfigurationInfo.java | 145 + .../models/ConfigurationName.java | 76 + .../models/ConfigurationNameItem.java | 46 + .../models/ConfigurationNameResult.java | 70 + .../models/ConfigurationNamesOperations.java | 35 + ...onResult.java => ConfigurationResult.java} | 10 +- .../models/ConfluentBootstrapServer.java | 4 + .../models/ConfluentSchemaRegistry.java | 4 + .../servicelinker/models/Connectors.java | 361 ++ .../CreateOrUpdateDryrunParameters.java | 273 ++ .../models/DatabaseAadAuthInfo.java | 50 + .../models/DeleteOrUpdateBehavior.java | 38 + .../models/DryrunActionName.java | 35 + .../servicelinker/models/DryrunList.java | 81 + .../models/DryrunOperationPreview.java | 159 + .../models/DryrunParameters.java | 33 + .../servicelinker/models/DryrunPatch.java | 94 + .../models/DryrunPrerequisiteResult.java | 36 + .../models/DryrunPrerequisiteResultType.java | 38 + .../models/DryrunPreviewOperationType.java | 41 + .../servicelinker/models/DryrunResource.java | 187 + .../servicelinker/models/FirewallRules.java | 109 + .../KeyVaultSecretReferenceSecretInfo.java | 4 + .../models/KeyVaultSecretUriSecretInfo.java | 4 + .../servicelinker/models/LinkerPatch.java | 54 +- .../servicelinker/models/LinkerResource.java | 118 +- .../servicelinker/models/Linkers.java | 102 +- .../models/LinkersOperations.java | 167 + .../models/OperationDisplay.java | 20 +- .../models/OperationListResult.java | 4 + .../servicelinker/models/Origin.java | 5 +- ...ssionsMissingDryrunPrerequisiteResult.java | 109 + .../models/PublicNetworkSolution.java | 112 + .../{LinkerList.java => ResourceList.java} | 20 +- .../servicelinker/models/SecretAuthInfo.java | 4 + .../servicelinker/models/SecretInfoBase.java | 4 + .../servicelinker/models/SecretStore.java | 32 + .../servicelinker/models/SecretType.java | 2 +- .../models/SelfHostedServer.java | 56 + .../ServicePrincipalCertificateAuthInfo.java | 60 + .../ServicePrincipalSecretAuthInfo.java | 85 + .../models/SourceConfiguration.java | 4 + .../SystemAssignedIdentityAuthInfo.java | 90 +- .../models/TargetServiceBase.java | 5 + .../models/TargetServiceType.java | 5 +- .../models/UserAccountAuthInfo.java | 137 + .../models/UserAssignedIdentityAuthInfo.java | 85 + .../servicelinker/models/VNetSolution.java | 32 + .../models/VNetSolutionType.java | 2 +- .../models/ValidateOperationResult.java | 4 +- .../models/ValidationResultItem.java | 6 +- .../models/ValidationResultStatus.java | 2 +- .../servicelinker/models/ValueSecretInfo.java | 4 + ...onfigurationNamesOperationListSamples.java | 22 + .../ConnectorCreateDryrunSamples.java | 39 + .../ConnectorCreateOrUpdateSamples.java | 34 + .../ConnectorDeleteDryrunSamples.java | 25 + .../generated/ConnectorDeleteSamples.java | 24 + ...onnectorGenerateConfigurationsSamples.java | 45 + .../generated/ConnectorGetDryrunSamples.java | 25 + .../generated/ConnectorGetSamples.java | 25 + .../generated/ConnectorListDryrunSamples.java | 22 + .../generated/ConnectorListSamples.java | 22 + .../ConnectorUpdateDryrunSamples.java | 45 + .../generated/ConnectorUpdateSamples.java | 42 + .../generated/ConnectorValidateSamples.java | 24 + .../LinkerCreateOrUpdateSamples.java | 88 +- .../generated/LinkerDeleteSamples.java | 6 +- .../generated/LinkerGetSamples.java | 6 +- .../LinkerListConfigurationsSamples.java | 2 +- .../generated/LinkerListSamples.java | 6 +- .../generated/LinkerUpdateSamples.java | 41 +- .../generated/LinkerValidateSamples.java | 6 +- .../LinkersOperationCreateDryrunSamples.java | 43 + .../LinkersOperationDeleteDryrunSamples.java | 27 + ...perationGenerateConfigurationsSamples.java | 43 + .../LinkersOperationGetDryrunSamples.java | 27 + .../LinkersOperationListDryrunSamples.java | 26 + .../LinkersOperationUpdateDryrunSamples.java | 43 + .../generated/OperationsListSamples.java | 2 +- 127 files changed, 12575 insertions(+), 644 deletions(-) create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/ConfigurationNamesOperationsClient.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/ConnectorsClient.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/LinkersOperationsClient.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/ConfigurationNameItemInner.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/ConfigurationNames.java rename sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/{SourceConfigurationResultInner.java => ConfigurationResultInner.java} (82%) create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/DryrunProperties.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/DryrunResourceInner.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ConfigurationNameItemImpl.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ConfigurationNamesOperationsClientImpl.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ConfigurationNamesOperationsImpl.java rename sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/{SourceConfigurationResultImpl.java => ConfigurationResultImpl.java} (70%) create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ConnectorsClientImpl.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ConnectorsImpl.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/DryrunResourceImpl.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkersOperationsClientImpl.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkersOperationsImpl.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AccessKeyInfoBase.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AccessKeyPermissions.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AllowType.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/BasicErrorDryrunPrerequisiteResult.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfigurationInfo.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfigurationName.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfigurationNameItem.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfigurationNameResult.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfigurationNamesOperations.java rename sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/{SourceConfigurationResult.java => ConfigurationResult.java} (64%) create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/Connectors.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/CreateOrUpdateDryrunParameters.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DatabaseAadAuthInfo.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DeleteOrUpdateBehavior.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunActionName.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunList.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunOperationPreview.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunParameters.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunPatch.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunPrerequisiteResult.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunPrerequisiteResultType.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunPreviewOperationType.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunResource.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/FirewallRules.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/LinkersOperations.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/PermissionsMissingDryrunPrerequisiteResult.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/PublicNetworkSolution.java rename sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/{LinkerList.java => ResourceList.java} (72%) create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SelfHostedServer.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/UserAccountAuthInfo.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConfigurationNamesOperationListSamples.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorCreateDryrunSamples.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorCreateOrUpdateSamples.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorDeleteDryrunSamples.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorDeleteSamples.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorGenerateConfigurationsSamples.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorGetDryrunSamples.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorGetSamples.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorListDryrunSamples.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorListSamples.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorUpdateDryrunSamples.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorUpdateSamples.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorValidateSamples.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkersOperationCreateDryrunSamples.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkersOperationDeleteDryrunSamples.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkersOperationGenerateConfigurationsSamples.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkersOperationGetDryrunSamples.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkersOperationListDryrunSamples.java create mode 100644 sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkersOperationUpdateDryrunSamples.java diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/CHANGELOG.md b/sdk/servicelinker/azure-resourcemanager-servicelinker/CHANGELOG.md index 3bc971f567b4..aa6ef920b624 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/CHANGELOG.md +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.1 (2023-01-09) + +- Azure Resource Manager ServiceLinker client library for Java. This package contains Microsoft Azure SDK for ServiceLinker Management SDK. Microsoft.ServiceLinker provider. Package tag package-2022-11-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/README.md b/sdk/servicelinker/azure-resourcemanager-servicelinker/README.md index 886c1e1a1116..bc2917689343 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/README.md +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/README.md @@ -2,7 +2,7 @@ Azure Resource Manager ServiceLinker client library for Java. -This package contains Microsoft Azure SDK for ServiceLinker Management SDK. Microsoft.ServiceLinker provider. Package tag package-2022-05-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for ServiceLinker Management SDK. Microsoft.ServiceLinker provider. Package tag package-2022-11-01-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 @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-servicelinker - 1.0.0-beta.2 + 1.0.0-beta.3 ``` [//]: # ({x-version-update-end}) @@ -41,19 +41,19 @@ Various documentation is available to help you get started 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. +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. ### Authentication -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. +By default, Azure Active Directory token authentication depends on correct configuration of the 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`. +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -With above configuration, `azure` client can be authenticated by following code: +With above configuration, `azure` client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -83,13 +83,13 @@ See [API design][design] for general introduction on design and key concepts on ## Contributing -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). +For details on contributing to this repository, see the [contributing guide][cg]. -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 +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS @@ -100,3 +100,6 @@ For details on contributing to this repository, see the [contributing guide](htt [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 +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/SAMPLE.md b/sdk/servicelinker/azure-resourcemanager-servicelinker/SAMPLE.md index 3f1dc36c95da..910d78403544 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/SAMPLE.md +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/SAMPLE.md @@ -1,6 +1,25 @@ # Code snippets and samples +## ConfigurationNamesOperation + +- [List](#configurationnamesoperation_list) + +## Connector + +- [CreateDryrun](#connector_createdryrun) +- [CreateOrUpdate](#connector_createorupdate) +- [Delete](#connector_delete) +- [DeleteDryrun](#connector_deletedryrun) +- [GenerateConfigurations](#connector_generateconfigurations) +- [Get](#connector_get) +- [GetDryrun](#connector_getdryrun) +- [List](#connector_list) +- [ListDryrun](#connector_listdryrun) +- [Update](#connector_update) +- [UpdateDryrun](#connector_updatedryrun) +- [Validate](#connector_validate) + ## Linker - [CreateOrUpdate](#linker_createorupdate) @@ -11,99 +30,435 @@ - [Update](#linker_update) - [Validate](#linker_validate) +## LinkersOperation + +- [CreateDryrun](#linkersoperation_createdryrun) +- [DeleteDryrun](#linkersoperation_deletedryrun) +- [GenerateConfigurations](#linkersoperation_generateconfigurations) +- [GetDryrun](#linkersoperation_getdryrun) +- [ListDryrun](#linkersoperation_listdryrun) +- [UpdateDryrun](#linkersoperation_updatedryrun) + ## Operations - [List](#operations_list) -### Linker_CreateOrUpdate +### ConfigurationNamesOperation_List + +```java +import com.azure.core.util.Context; + +/** Samples for ConfigurationNamesOperation List. */ +public final class ConfigurationNamesOperationListSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/ConfigurationNamesList.json + */ + /** + * Sample code: GetConfigurationNames. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void getConfigurationNames(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager.configurationNamesOperations().list(null, null, Context.NONE); + } +} +``` + +### Connector_CreateDryrun ```java import com.azure.resourcemanager.servicelinker.models.AzureResource; -import com.azure.resourcemanager.servicelinker.models.KeyVaultSecretUriSecretInfo; +import com.azure.resourcemanager.servicelinker.models.CreateOrUpdateDryrunParameters; import com.azure.resourcemanager.servicelinker.models.SecretAuthInfo; -import com.azure.resourcemanager.servicelinker.models.SecretStore; -import com.azure.resourcemanager.servicelinker.models.VNetSolution; -import com.azure.resourcemanager.servicelinker.models.VNetSolutionType; import com.azure.resourcemanager.servicelinker.models.ValueSecretInfo; -/** Samples for Linker CreateOrUpdate. */ -public final class LinkerCreateOrUpdateSamples { +/** Samples for Connector CreateDryrun. */ +public final class ConnectorCreateDryrunSamples { /* - * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/PutLinkWithSecretStore.json + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/ConnectorDryrunCreate.json */ /** - * Sample code: PutLinkWithSecretStore. + * Sample code: ConnectorDryrunCreate. * * @param manager Entry point to ServiceLinkerManager. */ - public static void putLinkWithSecretStore(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + public static void connectorDryrunCreate(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { manager - .linkers() - .define("linkName") - .withExistingResourceUri( - "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app") + .connectors() + .defineDryrun("dryrunName") + .withExistingLocation("00000000-0000-0000-0000-000000000000", "test-rg", "westus") + .withParameters( + new CreateOrUpdateDryrunParameters() + .withTargetService( + new AzureResource() + .withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db")) + .withAuthInfo( + new SecretAuthInfo() + .withName("name") + .withSecretInfo(new ValueSecretInfo().withValue("secret")))) + .create(); + } +} +``` + +### Connector_CreateOrUpdate + +```java +import com.azure.resourcemanager.servicelinker.models.AzureResource; +import com.azure.resourcemanager.servicelinker.models.SecretAuthInfo; +import com.azure.resourcemanager.servicelinker.models.SecretStore; + +/** Samples for Connector CreateOrUpdate. */ +public final class ConnectorCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/PutConnector.json + */ + /** + * Sample code: PutConnector. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void putConnector(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager + .connectors() + .define("connectorName") + .withExistingLocation("00000000-0000-0000-0000-000000000000", "test-rg", "westus") .withTargetService( new AzureResource() .withId( "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db")) .withAuthInfo(new SecretAuthInfo()) - .withSecretStore( - new SecretStore() - .withKeyVaultId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.KeyVault/vaults/test-kv")) + .withSecretStore(new SecretStore().withKeyVaultId("fakeTokenPlaceholder")) .create(); } +} +``` + +### Connector_Delete + +```java +import com.azure.core.util.Context; +/** Samples for Connector Delete. */ +public final class ConnectorDeleteSamples { /* - * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/PutLinkWithServiceEndpoint.json + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/DeleteConnector.json */ /** - * Sample code: PutLinkWithServiceEndpoint. + * Sample code: DeleteConnector. * * @param manager Entry point to ServiceLinkerManager. */ - public static void putLinkWithServiceEndpoint( - com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + public static void deleteConnector(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { manager - .linkers() - .define("linkName") - .withExistingResourceUri( - "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app") + .connectors() + .delete("00000000-0000-0000-0000-000000000000", "test-rg", "westus", "connectorName", Context.NONE); + } +} +``` + +### Connector_DeleteDryrun + +```java +import com.azure.core.util.Context; + +/** Samples for Connector DeleteDryrun. */ +public final class ConnectorDeleteDryrunSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/ConnectorDryrunDelete.json + */ + /** + * Sample code: ConnectorDryrunDelete. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void connectorDryrunDelete(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager + .connectors() + .deleteDryrunWithResponse( + "00000000-0000-0000-0000-000000000000", "test-rg", "westus", "dryrunName", Context.NONE); + } +} +``` + +### Connector_GenerateConfigurations + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicelinker.models.ConfigurationInfo; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Connector GenerateConfigurations. */ +public final class ConnectorGenerateConfigurationsSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/GenerateConfigurations.json + */ + /** + * Sample code: GenerateConfiguration. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void generateConfiguration(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager + .connectors() + .generateConfigurationsWithResponse( + "00000000-0000-0000-0000-000000000000", + "test-rg", + "westus", + "connectorName", + new ConfigurationInfo() + .withCustomizedKeys(mapOf("ASL_DocumentDb_ConnectionString", "MyConnectionstring")), + Context.NONE); + } + + @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; + } +} +``` + +### Connector_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Connector Get. */ +public final class ConnectorGetSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/Connectors.json + */ + /** + * Sample code: Connector. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void connector(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager + .connectors() + .getWithResponse( + "00000000-0000-0000-0000-000000000000", "test-rg", "westus", "connectorName", Context.NONE); + } +} +``` + +### Connector_GetDryrun + +```java +import com.azure.core.util.Context; + +/** Samples for Connector GetDryrun. */ +public final class ConnectorGetDryrunSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/ConnectorDryrunGet.json + */ + /** + * Sample code: ConnectorDryrunGet. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void connectorDryrunGet(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager + .connectors() + .getDryrunWithResponse( + "00000000-0000-0000-0000-000000000000", "test-rg", "westus", "dryrunName", Context.NONE); + } +} +``` + +### Connector_List + +```java +import com.azure.core.util.Context; + +/** Samples for Connector List. */ +public final class ConnectorListSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/ConnectorList.json + */ + /** + * Sample code: ConnectorList. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void connectorList(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager.connectors().list("00000000-0000-0000-0000-000000000000", "test-rg", "westus", Context.NONE); + } +} +``` + +### Connector_ListDryrun + +```java +import com.azure.core.util.Context; + +/** Samples for Connector ListDryrun. */ +public final class ConnectorListDryrunSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/ConnectorDryrunList.json + */ + /** + * Sample code: ConnectorDryrunList. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void connectorDryrunList(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager.connectors().listDryrun("00000000-0000-0000-0000-000000000000", "test-rg", "westus", Context.NONE); + } +} +``` + +### Connector_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicelinker.models.AzureResource; +import com.azure.resourcemanager.servicelinker.models.LinkerResource; +import com.azure.resourcemanager.servicelinker.models.ServicePrincipalSecretAuthInfo; + +/** Samples for Connector Update. */ +public final class ConnectorUpdateSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/PatchConnector.json + */ + /** + * Sample code: PatchConnector. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void patchConnector(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + LinkerResource resource = + manager + .connectors() + .getWithResponse( + "00000000-0000-0000-0000-000000000000", "test-rg", "westus", "connectorName", Context.NONE) + .getValue(); + resource + .update() .withTargetService( new AzureResource() .withId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DBforPostgreSQL/servers/test-pg/databases/test-db")) + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db")) .withAuthInfo( - new SecretAuthInfo() - .withName("name") - .withSecretInfo( - new KeyVaultSecretUriSecretInfo() - .withValue( - "https://vault-name.vault.azure.net/secrets/secret-name/00000000000000000000000000000000"))) - .withVNetSolution(new VNetSolution().withType(VNetSolutionType.SERVICE_ENDPOINT)) - .create(); + new ServicePrincipalSecretAuthInfo() + .withClientId("name") + .withPrincipalId("id") + .withSecret("fakeTokenPlaceholder")) + .apply(); + } +} +``` + +### Connector_UpdateDryrun + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicelinker.models.AzureResource; +import com.azure.resourcemanager.servicelinker.models.CreateOrUpdateDryrunParameters; +import com.azure.resourcemanager.servicelinker.models.DryrunResource; +import com.azure.resourcemanager.servicelinker.models.SecretAuthInfo; +import com.azure.resourcemanager.servicelinker.models.ValueSecretInfo; + +/** Samples for Connector UpdateDryrun. */ +public final class ConnectorUpdateDryrunSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/ConnectorDryrunUpdate.json + */ + /** + * Sample code: ConnectorDryrunUpdate. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void connectorDryrunUpdate(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + DryrunResource resource = + manager + .connectors() + .getDryrunWithResponse( + "00000000-0000-0000-0000-000000000000", "test-rg", "westus", "dryrunName", Context.NONE) + .getValue(); + resource + .update() + .withParameters( + new CreateOrUpdateDryrunParameters() + .withTargetService( + new AzureResource() + .withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db")) + .withAuthInfo( + new SecretAuthInfo() + .withName("name") + .withSecretInfo(new ValueSecretInfo().withValue("secret")))) + .apply(); } +} +``` +### Connector_Validate + +```java +import com.azure.core.util.Context; + +/** Samples for Connector Validate. */ +public final class ConnectorValidateSamples { /* - * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/PutLink.json + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/ValidateConnectorSuccess.json */ /** - * Sample code: PutLink. + * Sample code: ValidateConnectorSuccess. * * @param manager Entry point to ServiceLinkerManager. */ - public static void putLink(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + public static void validateConnectorSuccess(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager + .connectors() + .validate("00000000-0000-0000-0000-000000000000", "test-rg", "westus", "connectorName", Context.NONE); + } +} +``` + +### Linker_CreateOrUpdate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicelinker.fluent.models.LinkerResourceInner; +import com.azure.resourcemanager.servicelinker.models.AzureResource; +import com.azure.resourcemanager.servicelinker.models.SecretAuthInfo; +import com.azure.resourcemanager.servicelinker.models.VNetSolution; +import com.azure.resourcemanager.servicelinker.models.VNetSolutionType; +import com.azure.resourcemanager.servicelinker.models.ValueSecretInfo; + +/** Samples for Linker CreateOrUpdate. */ +public final class LinkerCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/PutLinker.json + */ + /** + * Sample code: PutLinker. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void putLinker(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { manager .linkers() - .define("linkName") - .withExistingResourceUri( - "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app") - .withTargetService( - new AzureResource() - .withId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DBforPostgreSQL/servers/test-pg/databases/test-db")) - .withAuthInfo( - new SecretAuthInfo().withName("name").withSecretInfo(new ValueSecretInfo().withValue("secret"))) - .create(); + .createOrUpdate( + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", + "linkName", + new LinkerResourceInner() + .withTargetService( + new AzureResource() + .withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DBforPostgreSQL/servers/test-pg/databases/test-db")) + .withAuthInfo( + new SecretAuthInfo().withName("name").withSecretInfo(new ValueSecretInfo().withValue("secret"))) + .withVNetSolution(new VNetSolution().withType(VNetSolutionType.SERVICE_ENDPOINT)), + Context.NONE); } } ``` @@ -116,14 +471,14 @@ import com.azure.core.util.Context; /** Samples for Linker Delete. */ public final class LinkerDeleteSamples { /* - * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/DeleteLink.json + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/DeleteLinker.json */ /** - * Sample code: DeleteLink. + * Sample code: DeleteLinker. * * @param manager Entry point to ServiceLinkerManager. */ - public static void deleteLink(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + public static void deleteLinker(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { manager .linkers() .delete( @@ -142,14 +497,14 @@ import com.azure.core.util.Context; /** Samples for Linker Get. */ public final class LinkerGetSamples { /* - * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/Link.json + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/Linker.json */ /** - * Sample code: Link. + * Sample code: Linker. * * @param manager Entry point to ServiceLinkerManager. */ - public static void link(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + public static void linker(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { manager .linkers() .getWithResponse( @@ -168,14 +523,14 @@ import com.azure.core.util.Context; /** Samples for Linker List. */ public final class LinkerListSamples { /* - * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/LinkList.json + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/LinkerList.json */ /** - * Sample code: LinkList. + * Sample code: LinkerList. * * @param manager Entry point to ServiceLinkerManager. */ - public static void linkList(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + public static void linkerList(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { manager .linkers() .list( @@ -193,7 +548,7 @@ import com.azure.core.util.Context; /** Samples for Linker ListConfigurations. */ public final class LinkerListConfigurationsSamples { /* - * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/GetConfigurations.json + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/GetConfigurations.json */ /** * Sample code: GetConfiguration. @@ -216,37 +571,36 @@ public final class LinkerListConfigurationsSamples { ```java import com.azure.core.util.Context; import com.azure.resourcemanager.servicelinker.models.AzureResource; -import com.azure.resourcemanager.servicelinker.models.LinkerResource; +import com.azure.resourcemanager.servicelinker.models.LinkerPatch; import com.azure.resourcemanager.servicelinker.models.ServicePrincipalSecretAuthInfo; /** Samples for Linker Update. */ public final class LinkerUpdateSamples { /* - * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/PatchLink.json + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/PatchLinker.json */ /** - * Sample code: PatchLink. + * Sample code: PatchLinker. * * @param manager Entry point to ServiceLinkerManager. */ - public static void patchLink(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { - LinkerResource resource = - manager - .linkers() - .getWithResponse( - "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", - "linkName", - Context.NONE) - .getValue(); - resource - .update() - .withTargetService( - new AzureResource() - .withId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db")) - .withAuthInfo( - new ServicePrincipalSecretAuthInfo().withClientId("name").withPrincipalId("id").withSecret("secret")) - .apply(); + public static void patchLinker(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager + .linkers() + .update( + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", + "linkName", + new LinkerPatch() + .withTargetService( + new AzureResource() + .withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db")) + .withAuthInfo( + new ServicePrincipalSecretAuthInfo() + .withClientId("name") + .withPrincipalId("id") + .withSecret("fakeTokenPlaceholder")), + Context.NONE); } } ``` @@ -259,14 +613,14 @@ import com.azure.core.util.Context; /** Samples for Linker Validate. */ public final class LinkerValidateSamples { /* - * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/ValidateLinkSuccess.json + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/ValidateLinkerSuccess.json */ /** - * Sample code: ValidateLinkSuccess. + * Sample code: ValidateLinkerSuccess. * * @param manager Entry point to ServiceLinkerManager. */ - public static void validateLinkSuccess(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + public static void validateLinkerSuccess(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { manager .linkers() .validate( @@ -277,6 +631,209 @@ public final class LinkerValidateSamples { } ``` +### LinkersOperation_CreateDryrun + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicelinker.fluent.models.DryrunResourceInner; +import com.azure.resourcemanager.servicelinker.models.AzureResource; +import com.azure.resourcemanager.servicelinker.models.CreateOrUpdateDryrunParameters; +import com.azure.resourcemanager.servicelinker.models.SecretAuthInfo; +import com.azure.resourcemanager.servicelinker.models.ValueSecretInfo; + +/** Samples for LinkersOperation CreateDryrun. */ +public final class LinkersOperationCreateDryrunSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/PutDryrun.json + */ + /** + * Sample code: PutDryrun. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void putDryrun(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager + .linkersOperations() + .createDryrun( + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", + "dryrunName", + new DryrunResourceInner() + .withParameters( + new CreateOrUpdateDryrunParameters() + .withTargetService( + new AzureResource() + .withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db")) + .withAuthInfo( + new SecretAuthInfo() + .withName("name") + .withSecretInfo(new ValueSecretInfo().withValue("secret")))), + Context.NONE); + } +} +``` + +### LinkersOperation_DeleteDryrun + +```java +import com.azure.core.util.Context; + +/** Samples for LinkersOperation DeleteDryrun. */ +public final class LinkersOperationDeleteDryrunSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/DeleteDryrun.json + */ + /** + * Sample code: DeleteDryrun. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void deleteDryrun(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager + .linkersOperations() + .deleteDryrunWithResponse( + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", + "dryrunName", + Context.NONE); + } +} +``` + +### LinkersOperation_GenerateConfigurations + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicelinker.models.ConfigurationInfo; +import java.util.HashMap; +import java.util.Map; + +/** Samples for LinkersOperation GenerateConfigurations. */ +public final class LinkersOperationGenerateConfigurationsSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/LinkerGenerateConfigurations.json + */ + /** + * Sample code: GenerateConfiguration. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void generateConfiguration(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager + .linkersOperations() + .generateConfigurationsWithResponse( + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", + "linkName", + new ConfigurationInfo() + .withCustomizedKeys(mapOf("ASL_DocumentDb_ConnectionString", "MyConnectionstring")), + Context.NONE); + } + + @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; + } +} +``` + +### LinkersOperation_GetDryrun + +```java +import com.azure.core.util.Context; + +/** Samples for LinkersOperation GetDryrun. */ +public final class LinkersOperationGetDryrunSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/GetDryrun.json + */ + /** + * Sample code: GetDryrun. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void getDryrun(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager + .linkersOperations() + .getDryrunWithResponse( + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", + "dryrunName", + Context.NONE); + } +} +``` + +### LinkersOperation_ListDryrun + +```java +import com.azure.core.util.Context; + +/** Samples for LinkersOperation ListDryrun. */ +public final class LinkersOperationListDryrunSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/ListDryrun.json + */ + /** + * Sample code: ListDryrun. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void listDryrun(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager + .linkersOperations() + .listDryrun( + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", + Context.NONE); + } +} +``` + +### LinkersOperation_UpdateDryrun + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicelinker.models.AzureResource; +import com.azure.resourcemanager.servicelinker.models.CreateOrUpdateDryrunParameters; +import com.azure.resourcemanager.servicelinker.models.DryrunPatch; +import com.azure.resourcemanager.servicelinker.models.SecretAuthInfo; +import com.azure.resourcemanager.servicelinker.models.ValueSecretInfo; + +/** Samples for LinkersOperation UpdateDryrun. */ +public final class LinkersOperationUpdateDryrunSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/PatchDryrun.json + */ + /** + * Sample code: PatchDryrun. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void patchDryrun(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager + .linkersOperations() + .updateDryrun( + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", + "dryrunName", + new DryrunPatch() + .withParameters( + new CreateOrUpdateDryrunParameters() + .withTargetService( + new AzureResource() + .withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db")) + .withAuthInfo( + new SecretAuthInfo() + .withName("name") + .withSecretInfo(new ValueSecretInfo().withValue("secret")))), + Context.NONE); + } +} +``` + ### Operations_List ```java @@ -285,7 +842,7 @@ import com.azure.core.util.Context; /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/OperationsList.json + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/OperationsList.json */ /** * Sample code: GetConfiguration. diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/pom.xml b/sdk/servicelinker/azure-resourcemanager-servicelinker/pom.xml index bde5c8ee95d5..15ef203847e4 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/pom.xml +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/pom.xml @@ -13,7 +13,7 @@ jar Microsoft Azure SDK for ServiceLinker Management - This package contains Microsoft Azure SDK for ServiceLinker Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft.ServiceLinker provider. Package tag package-2022-05-01. + This package contains Microsoft Azure SDK for ServiceLinker Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft.ServiceLinker provider. Package tag package-2022-11-01-preview. https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/ServiceLinkerManager.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/ServiceLinkerManager.java index d2ca08ad1a68..e80923936ef2 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/ServiceLinkerManager.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/ServiceLinkerManager.java @@ -24,10 +24,16 @@ import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.servicelinker.fluent.ServiceLinkerManagementClient; +import com.azure.resourcemanager.servicelinker.implementation.ConfigurationNamesOperationsImpl; +import com.azure.resourcemanager.servicelinker.implementation.ConnectorsImpl; import com.azure.resourcemanager.servicelinker.implementation.LinkersImpl; +import com.azure.resourcemanager.servicelinker.implementation.LinkersOperationsImpl; import com.azure.resourcemanager.servicelinker.implementation.OperationsImpl; import com.azure.resourcemanager.servicelinker.implementation.ServiceLinkerManagementClientBuilder; +import com.azure.resourcemanager.servicelinker.models.ConfigurationNamesOperations; +import com.azure.resourcemanager.servicelinker.models.Connectors; import com.azure.resourcemanager.servicelinker.models.Linkers; +import com.azure.resourcemanager.servicelinker.models.LinkersOperations; import com.azure.resourcemanager.servicelinker.models.Operations; import java.time.Duration; import java.time.temporal.ChronoUnit; @@ -38,10 +44,16 @@ /** Entry point to ServiceLinkerManager. Microsoft.ServiceLinker provider. */ public final class ServiceLinkerManager { + private Connectors connectors; + private Linkers linkers; + private LinkersOperations linkersOperations; + private Operations operations; + private ConfigurationNamesOperations configurationNamesOperations; + private final ServiceLinkerManagementClient clientObject; private ServiceLinkerManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -206,7 +218,7 @@ public ServiceLinkerManager authenticate(TokenCredential credential, AzureProfil .append("-") .append("com.azure.resourcemanager.servicelinker") .append("/") - .append("1.0.0-beta.2"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -264,7 +276,19 @@ public ServiceLinkerManager authenticate(TokenCredential credential, AzureProfil } /** - * Gets the resource collection API of Linkers. It manages LinkerResource. + * Gets the resource collection API of Connectors. It manages DryrunResource, LinkerResource. + * + * @return Resource collection API of Connectors. + */ + public Connectors connectors() { + if (this.connectors == null) { + this.connectors = new ConnectorsImpl(clientObject.getConnectors(), this); + } + return connectors; + } + + /** + * Gets the resource collection API of Linkers. * * @return Resource collection API of Linkers. */ @@ -275,6 +299,18 @@ public Linkers linkers() { return linkers; } + /** + * Gets the resource collection API of LinkersOperations. + * + * @return Resource collection API of LinkersOperations. + */ + public LinkersOperations linkersOperations() { + if (this.linkersOperations == null) { + this.linkersOperations = new LinkersOperationsImpl(clientObject.getLinkersOperations(), this); + } + return linkersOperations; + } + /** * Gets the resource collection API of Operations. * @@ -287,6 +323,19 @@ public Operations operations() { return operations; } + /** + * Gets the resource collection API of ConfigurationNamesOperations. + * + * @return Resource collection API of ConfigurationNamesOperations. + */ + public ConfigurationNamesOperations configurationNamesOperations() { + if (this.configurationNamesOperations == null) { + this.configurationNamesOperations = + new ConfigurationNamesOperationsImpl(clientObject.getConfigurationNamesOperations(), this); + } + return configurationNamesOperations; + } + /** * @return Wrapped service client ServiceLinkerManagementClient providing direct access to the underlying * auto-generated API implementation, based on Azure REST API. diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/ConfigurationNamesOperationsClient.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/ConfigurationNamesOperationsClient.java new file mode 100644 index 000000000000..c19b18d6cbae --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/ConfigurationNamesOperationsClient.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.servicelinker.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.servicelinker.fluent.models.ConfigurationNameItemInner; + +/** An instance of this class provides access to all the operations defined in ConfigurationNamesOperationsClient. */ +public interface ConfigurationNamesOperationsClient { + /** + * Lists the configuration names generated by Service Connector for all target, client types, auth types. + * + * @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 configuration Name list which will be set based on different target resource, client type, auth type as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists the configuration names generated by Service Connector for all target, client types, auth types. + * + * @param filter OData filter options. + * @param skipToken OData skipToken option for pagination. + * @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 configuration Name list which will be set based on different target resource, client type, auth type as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String filter, String skipToken, Context context); +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/ConnectorsClient.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/ConnectorsClient.java new file mode 100644 index 000000000000..4376a040306a --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/ConnectorsClient.java @@ -0,0 +1,685 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.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.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.servicelinker.fluent.models.ConfigurationResultInner; +import com.azure.resourcemanager.servicelinker.fluent.models.DryrunResourceInner; +import com.azure.resourcemanager.servicelinker.fluent.models.LinkerResourceInner; +import com.azure.resourcemanager.servicelinker.fluent.models.ValidateOperationResultInner; +import com.azure.resourcemanager.servicelinker.models.ConfigurationInfo; +import com.azure.resourcemanager.servicelinker.models.DryrunPatch; +import com.azure.resourcemanager.servicelinker.models.LinkerPatch; + +/** An instance of this class provides access to all the operations defined in ConnectorsClient. */ +public interface ConnectorsClient { + /** + * list dryrun jobs. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @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 dryrun as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listDryrun(String subscriptionId, String resourceGroupName, String location); + + /** + * list dryrun jobs. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @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 dryrun as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listDryrun( + String subscriptionId, String resourceGroupName, String location, Context context); + + /** + * get a dryrun job. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @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 a dryrun job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getDryrunWithResponse( + String subscriptionId, String resourceGroupName, String location, String dryrunName, Context context); + + /** + * get a dryrun job. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @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 a dryrun job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DryrunResourceInner getDryrun(String subscriptionId, String resourceGroupName, String location, String dryrunName); + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @param parameters dryrun resource. + * @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 SyncPoller} for polling of a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DryrunResourceInner> beginCreateDryrun( + String subscriptionId, + String resourceGroupName, + String location, + String dryrunName, + DryrunResourceInner parameters); + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @param parameters dryrun 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 {@link SyncPoller} for polling of a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DryrunResourceInner> beginCreateDryrun( + String subscriptionId, + String resourceGroupName, + String location, + String dryrunName, + DryrunResourceInner parameters, + Context context); + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @param parameters dryrun resource. + * @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 a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DryrunResourceInner createDryrun( + String subscriptionId, + String resourceGroupName, + String location, + String dryrunName, + DryrunResourceInner parameters); + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @param parameters dryrun 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 a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DryrunResourceInner createDryrun( + String subscriptionId, + String resourceGroupName, + String location, + String dryrunName, + DryrunResourceInner parameters, + Context context); + + /** + * update a dryrun job to do necessary check before actual creation. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @param parameters dryrun resource. + * @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 SyncPoller} for polling of a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DryrunResourceInner> beginUpdateDryrun( + String subscriptionId, String resourceGroupName, String location, String dryrunName, DryrunPatch parameters); + + /** + * update a dryrun job to do necessary check before actual creation. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @param parameters dryrun 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 {@link SyncPoller} for polling of a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DryrunResourceInner> beginUpdateDryrun( + String subscriptionId, + String resourceGroupName, + String location, + String dryrunName, + DryrunPatch parameters, + Context context); + + /** + * update a dryrun job to do necessary check before actual creation. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @param parameters dryrun resource. + * @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 a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DryrunResourceInner updateDryrun( + String subscriptionId, String resourceGroupName, String location, String dryrunName, DryrunPatch parameters); + + /** + * update a dryrun job to do necessary check before actual creation. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @param parameters dryrun 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 a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DryrunResourceInner updateDryrun( + String subscriptionId, + String resourceGroupName, + String location, + String dryrunName, + DryrunPatch parameters, + Context context); + + /** + * delete a dryrun job. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @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 deleteDryrunWithResponse( + String subscriptionId, String resourceGroupName, String location, String dryrunName, Context context); + + /** + * delete a dryrun job. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @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 deleteDryrun(String subscriptionId, String resourceGroupName, String location, String dryrunName); + + /** + * Returns list of connector which connects to the resource, which supports to config the target service during the + * resource provision. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @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 Linker as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String subscriptionId, String resourceGroupName, String location); + + /** + * Returns list of connector which connects to the resource, which supports to config the target service during the + * resource provision. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @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 Linker as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String subscriptionId, String resourceGroupName, String location, Context context); + + /** + * Returns Connector resource for a given name. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of 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 linker of source and target resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String subscriptionId, String resourceGroupName, String location, String connectorName, Context context); + + /** + * Returns Connector resource for a given name. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @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 linker of source and target resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LinkerResourceInner get(String subscriptionId, String resourceGroupName, String location, String connectorName); + + /** + * Create or update Connector resource. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @param parameters Connector details. + * @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 SyncPoller} for polling of linker of source and target resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LinkerResourceInner> beginCreateOrUpdate( + String subscriptionId, + String resourceGroupName, + String location, + String connectorName, + LinkerResourceInner parameters); + + /** + * Create or update Connector resource. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @param parameters Connector details. + * @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 SyncPoller} for polling of linker of source and target resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LinkerResourceInner> beginCreateOrUpdate( + String subscriptionId, + String resourceGroupName, + String location, + String connectorName, + LinkerResourceInner parameters, + Context context); + + /** + * Create or update Connector resource. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @param parameters Connector details. + * @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 linker of source and target resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LinkerResourceInner createOrUpdate( + String subscriptionId, + String resourceGroupName, + String location, + String connectorName, + LinkerResourceInner parameters); + + /** + * Create or update Connector resource. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @param parameters Connector details. + * @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 linker of source and target resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LinkerResourceInner createOrUpdate( + String subscriptionId, + String resourceGroupName, + String location, + String connectorName, + LinkerResourceInner parameters, + Context context); + + /** + * Delete a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String subscriptionId, String resourceGroupName, String location, String connectorName); + + /** + * Delete a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String subscriptionId, String resourceGroupName, String location, String connectorName, Context context); + + /** + * Delete a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @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 subscriptionId, String resourceGroupName, String location, String connectorName); + + /** + * Delete a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String subscriptionId, String resourceGroupName, String location, String connectorName, Context context); + + /** + * Operation to update an existing Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @param parameters Connector details. + * @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 SyncPoller} for polling of linker of source and target resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LinkerResourceInner> beginUpdate( + String subscriptionId, String resourceGroupName, String location, String connectorName, LinkerPatch parameters); + + /** + * Operation to update an existing Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @param parameters Connector details. + * @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 SyncPoller} for polling of linker of source and target resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LinkerResourceInner> beginUpdate( + String subscriptionId, + String resourceGroupName, + String location, + String connectorName, + LinkerPatch parameters, + Context context); + + /** + * Operation to update an existing Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @param parameters Connector details. + * @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 linker of source and target resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LinkerResourceInner update( + String subscriptionId, String resourceGroupName, String location, String connectorName, LinkerPatch parameters); + + /** + * Operation to update an existing Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @param parameters Connector details. + * @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 linker of source and target resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LinkerResourceInner update( + String subscriptionId, + String resourceGroupName, + String location, + String connectorName, + LinkerPatch parameters, + Context context); + + /** + * Validate a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @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 SyncPoller} for polling of the validation operation result for a Linker. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ValidateOperationResultInner> beginValidate( + String subscriptionId, String resourceGroupName, String location, String connectorName); + + /** + * Validate a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of 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 {@link SyncPoller} for polling of the validation operation result for a Linker. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ValidateOperationResultInner> beginValidate( + String subscriptionId, String resourceGroupName, String location, String connectorName, Context context); + + /** + * Validate a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @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 validation operation result for a Linker. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidateOperationResultInner validate( + String subscriptionId, String resourceGroupName, String location, String connectorName); + + /** + * Validate a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of 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 validation operation result for a Linker. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidateOperationResultInner validate( + String subscriptionId, String resourceGroupName, String location, String connectorName, Context context); + + /** + * Generate configurations for a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @param parameters Connection Info, including format, secret store, etc. + * @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 configurations for source resource, include appSettings, connectionString and serviceBindings along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response generateConfigurationsWithResponse( + String subscriptionId, + String resourceGroupName, + String location, + String connectorName, + ConfigurationInfo parameters, + Context context); + + /** + * Generate configurations for a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @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 configurations for source resource, include appSettings, connectionString and serviceBindings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigurationResultInner generateConfigurations( + String subscriptionId, String resourceGroupName, String location, String connectorName); +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/LinkersClient.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/LinkersClient.java index 5c11981acda7..0483f34ed2d7 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/LinkersClient.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/LinkersClient.java @@ -11,15 +11,16 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.servicelinker.fluent.models.ConfigurationResultInner; import com.azure.resourcemanager.servicelinker.fluent.models.LinkerResourceInner; -import com.azure.resourcemanager.servicelinker.fluent.models.SourceConfigurationResultInner; import com.azure.resourcemanager.servicelinker.fluent.models.ValidateOperationResultInner; import com.azure.resourcemanager.servicelinker.models.LinkerPatch; /** An instance of this class provides access to all the operations defined in LinkersClient. */ public interface LinkersClient { /** - * Returns list of Linkers which connects to the resource. + * Returns list of Linkers which connects to the resource. which supports to config both application and target + * service during the resource provision. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -31,7 +32,8 @@ public interface LinkersClient { PagedIterable list(String resourceUri); /** - * Returns list of Linkers which connects to the resource. + * Returns list of Linkers which connects to the resource. which supports to config both application and target + * service during the resource provision. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param context The context to associate with this operation. @@ -48,30 +50,30 @@ public interface LinkersClient { * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker 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 linker of source and target resource. + * @return linker of source and target resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - LinkerResourceInner get(String resourceUri, String linkerName); + Response getWithResponse(String resourceUri, String linkerName, Context context); /** * Returns Linker resource for a given name. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker 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 linker of source and target resource along with {@link Response}. + * @return linker of source and target resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceUri, String linkerName, Context context); + LinkerResourceInner get(String resourceUri, String linkerName); /** - * Create or update linker resource. + * Create or update Linker resource. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -86,7 +88,7 @@ SyncPoller, LinkerResourceInner> beginCreateOrUp String resourceUri, String linkerName, LinkerResourceInner parameters); /** - * Create or update linker resource. + * Create or update Linker resource. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -102,7 +104,7 @@ SyncPoller, LinkerResourceInner> beginCreateOrUp String resourceUri, String linkerName, LinkerResourceInner parameters, Context context); /** - * Create or update linker resource. + * Create or update Linker resource. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -116,7 +118,7 @@ SyncPoller, LinkerResourceInner> beginCreateOrUp LinkerResourceInner createOrUpdate(String resourceUri, String linkerName, LinkerResourceInner parameters); /** - * Create or update linker resource. + * Create or update Linker resource. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -132,7 +134,7 @@ LinkerResourceInner createOrUpdate( String resourceUri, String linkerName, LinkerResourceInner parameters, Context context); /** - * Delete a link. + * Delete a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -145,7 +147,7 @@ LinkerResourceInner createOrUpdate( SyncPoller, Void> beginDelete(String resourceUri, String linkerName); /** - * Delete a link. + * Delete a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -159,7 +161,7 @@ LinkerResourceInner createOrUpdate( SyncPoller, Void> beginDelete(String resourceUri, String linkerName, Context context); /** - * Delete a link. + * Delete a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -171,7 +173,7 @@ LinkerResourceInner createOrUpdate( void delete(String resourceUri, String linkerName); /** - * Delete a link. + * Delete a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -184,7 +186,7 @@ LinkerResourceInner createOrUpdate( void delete(String resourceUri, String linkerName, Context context); /** - * Operation to update an existing link. + * Operation to update an existing Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -199,7 +201,7 @@ SyncPoller, LinkerResourceInner> beginUpdate( String resourceUri, String linkerName, LinkerPatch parameters); /** - * Operation to update an existing link. + * Operation to update an existing Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -215,7 +217,7 @@ SyncPoller, LinkerResourceInner> beginUpdate( String resourceUri, String linkerName, LinkerPatch parameters, Context context); /** - * Operation to update an existing link. + * Operation to update an existing Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -229,7 +231,7 @@ SyncPoller, LinkerResourceInner> beginUpdate( LinkerResourceInner update(String resourceUri, String linkerName, LinkerPatch parameters); /** - * Operation to update an existing link. + * Operation to update an existing Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -244,21 +246,21 @@ SyncPoller, LinkerResourceInner> beginUpdate( LinkerResourceInner update(String resourceUri, String linkerName, LinkerPatch parameters, Context context); /** - * Validate a link. + * Validate a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. * @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 SyncPoller} for polling of the validation operation result for a linker. + * @return the {@link SyncPoller} for polling of the validation operation result for a Linker. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ValidateOperationResultInner> beginValidate( String resourceUri, String linkerName); /** - * Validate a link. + * Validate a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -266,27 +268,27 @@ SyncPoller, ValidateOperationResultInne * @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 SyncPoller} for polling of the validation operation result for a linker. + * @return the {@link SyncPoller} for polling of the validation operation result for a Linker. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ValidateOperationResultInner> beginValidate( String resourceUri, String linkerName, Context context); /** - * Validate a link. + * Validate a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. * @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 validation operation result for a linker. + * @return the validation operation result for a Linker. */ @ServiceMethod(returns = ReturnType.SINGLE) ValidateOperationResultInner validate(String resourceUri, String linkerName); /** - * Validate a link. + * Validate a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -294,37 +296,37 @@ SyncPoller, ValidateOperationResultInne * @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 validation operation result for a linker. + * @return the validation operation result for a Linker. */ @ServiceMethod(returns = ReturnType.SINGLE) ValidateOperationResultInner validate(String resourceUri, String linkerName, Context context); /** - * list source configurations for a linker. + * list source configurations for a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker 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 configurations for source resource, include appSettings, connectionString and serviceBindings. + * @return configurations for source resource, include appSettings, connectionString and serviceBindings along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - SourceConfigurationResultInner listConfigurations(String resourceUri, String linkerName); + Response listConfigurationsWithResponse( + String resourceUri, String linkerName, Context context); /** - * list source configurations for a linker. + * list source configurations for a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker 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 configurations for source resource, include appSettings, connectionString and serviceBindings along with - * {@link Response}. + * @return configurations for source resource, include appSettings, connectionString and serviceBindings. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listConfigurationsWithResponse( - String resourceUri, String linkerName, Context context); + ConfigurationResultInner listConfigurations(String resourceUri, String linkerName); } diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/LinkersOperationsClient.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/LinkersOperationsClient.java new file mode 100644 index 000000000000..3a3c0c0ea299 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/LinkersOperationsClient.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.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.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.servicelinker.fluent.models.ConfigurationResultInner; +import com.azure.resourcemanager.servicelinker.fluent.models.DryrunResourceInner; +import com.azure.resourcemanager.servicelinker.models.ConfigurationInfo; +import com.azure.resourcemanager.servicelinker.models.DryrunPatch; + +/** An instance of this class provides access to all the operations defined in LinkersOperationsClient. */ +public interface LinkersOperationsClient { + /** + * list dryrun jobs. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @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 dryrun as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listDryrun(String resourceUri); + + /** + * list dryrun jobs. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @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 dryrun as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listDryrun(String resourceUri, Context context); + + /** + * get a dryrun job. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @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 a dryrun job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getDryrunWithResponse(String resourceUri, String dryrunName, Context context); + + /** + * get a dryrun job. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @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 a dryrun job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DryrunResourceInner getDryrun(String resourceUri, String dryrunName); + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @param parameters dryrun resource. + * @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 SyncPoller} for polling of a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DryrunResourceInner> beginCreateDryrun( + String resourceUri, String dryrunName, DryrunResourceInner parameters); + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @param parameters dryrun 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 {@link SyncPoller} for polling of a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DryrunResourceInner> beginCreateDryrun( + String resourceUri, String dryrunName, DryrunResourceInner parameters, Context context); + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @param parameters dryrun resource. + * @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 a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DryrunResourceInner createDryrun(String resourceUri, String dryrunName, DryrunResourceInner parameters); + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @param parameters dryrun 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 a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DryrunResourceInner createDryrun( + String resourceUri, String dryrunName, DryrunResourceInner parameters, Context context); + + /** + * add a dryrun job to do necessary check before actual creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @param parameters dryrun resource. + * @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 SyncPoller} for polling of a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DryrunResourceInner> beginUpdateDryrun( + String resourceUri, String dryrunName, DryrunPatch parameters); + + /** + * add a dryrun job to do necessary check before actual creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @param parameters dryrun 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 {@link SyncPoller} for polling of a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DryrunResourceInner> beginUpdateDryrun( + String resourceUri, String dryrunName, DryrunPatch parameters, Context context); + + /** + * add a dryrun job to do necessary check before actual creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @param parameters dryrun resource. + * @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 a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DryrunResourceInner updateDryrun(String resourceUri, String dryrunName, DryrunPatch parameters); + + /** + * add a dryrun job to do necessary check before actual creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @param parameters dryrun 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 a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DryrunResourceInner updateDryrun(String resourceUri, String dryrunName, DryrunPatch parameters, Context context); + + /** + * delete a dryrun job. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @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 deleteDryrunWithResponse(String resourceUri, String dryrunName, Context context); + + /** + * delete a dryrun job. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @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 deleteDryrun(String resourceUri, String dryrunName); + + /** + * Generate configurations for a Linker. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param linkerName The name Linker resource. + * @param parameters Connection Info, including format, secret store, etc. + * @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 configurations for source resource, include appSettings, connectionString and serviceBindings along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response generateConfigurationsWithResponse( + String resourceUri, String linkerName, ConfigurationInfo parameters, Context context); + + /** + * Generate configurations for a Linker. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param linkerName The name Linker resource. + * @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 configurations for source resource, include appSettings, connectionString and serviceBindings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigurationResultInner generateConfigurations(String resourceUri, String linkerName); +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/ServiceLinkerManagementClient.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/ServiceLinkerManagementClient.java index 51e97f1c051c..cd1a1d4c9f70 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/ServiceLinkerManagementClient.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/ServiceLinkerManagementClient.java @@ -37,6 +37,13 @@ public interface ServiceLinkerManagementClient { */ Duration getDefaultPollInterval(); + /** + * Gets the ConnectorsClient object to access its operations. + * + * @return the ConnectorsClient object. + */ + ConnectorsClient getConnectors(); + /** * Gets the LinkersClient object to access its operations. * @@ -44,10 +51,24 @@ public interface ServiceLinkerManagementClient { */ LinkersClient getLinkers(); + /** + * Gets the LinkersOperationsClient object to access its operations. + * + * @return the LinkersOperationsClient object. + */ + LinkersOperationsClient getLinkersOperations(); + /** * Gets the OperationsClient object to access its operations. * * @return the OperationsClient object. */ OperationsClient getOperations(); + + /** + * Gets the ConfigurationNamesOperationsClient object to access its operations. + * + * @return the ConfigurationNamesOperationsClient object. + */ + ConfigurationNamesOperationsClient getConfigurationNamesOperations(); } diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/ConfigurationNameItemInner.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/ConfigurationNameItemInner.java new file mode 100644 index 000000000000..19e7a502a0a3 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/ConfigurationNameItemInner.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicelinker.models.AuthType; +import com.azure.resourcemanager.servicelinker.models.ClientType; +import com.azure.resourcemanager.servicelinker.models.ConfigurationName; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ConfigurationNameItem model. */ +@Fluent +public final class ConfigurationNameItemInner { + /* + * The result detail. + */ + @JsonProperty(value = "properties") + private ConfigurationNames innerProperties; + + /** Creates an instance of ConfigurationNameItemInner class. */ + public ConfigurationNameItemInner() { + } + + /** + * Get the innerProperties property: The result detail. + * + * @return the innerProperties value. + */ + private ConfigurationNames innerProperties() { + return this.innerProperties; + } + + /** + * Get the targetService property: The target service provider name and resource name. + * + * @return the targetService value. + */ + public String targetService() { + return this.innerProperties() == null ? null : this.innerProperties().targetService(); + } + + /** + * Set the targetService property: The target service provider name and resource name. + * + * @param targetService the targetService value to set. + * @return the ConfigurationNameItemInner object itself. + */ + public ConfigurationNameItemInner withTargetService(String targetService) { + if (this.innerProperties() == null) { + this.innerProperties = new ConfigurationNames(); + } + this.innerProperties().withTargetService(targetService); + return this; + } + + /** + * Get the clientType property: The client type for configuration names. + * + * @return the clientType value. + */ + public ClientType clientType() { + return this.innerProperties() == null ? null : this.innerProperties().clientType(); + } + + /** + * Set the clientType property: The client type for configuration names. + * + * @param clientType the clientType value to set. + * @return the ConfigurationNameItemInner object itself. + */ + public ConfigurationNameItemInner withClientType(ClientType clientType) { + if (this.innerProperties() == null) { + this.innerProperties = new ConfigurationNames(); + } + this.innerProperties().withClientType(clientType); + return this; + } + + /** + * Get the authType property: The auth type. + * + * @return the authType value. + */ + public AuthType authType() { + return this.innerProperties() == null ? null : this.innerProperties().authType(); + } + + /** + * Set the authType property: The auth type. + * + * @param authType the authType value to set. + * @return the ConfigurationNameItemInner object itself. + */ + public ConfigurationNameItemInner withAuthType(AuthType authType) { + if (this.innerProperties() == null) { + this.innerProperties = new ConfigurationNames(); + } + this.innerProperties().withAuthType(authType); + return this; + } + + /** + * Get the names property: The configuration names to be set in compute service environment. + * + * @return the names value. + */ + public List names() { + return this.innerProperties() == null ? null : this.innerProperties().names(); + } + + /** + * Set the names property: The configuration names to be set in compute service environment. + * + * @param names the names value to set. + * @return the ConfigurationNameItemInner object itself. + */ + public ConfigurationNameItemInner withNames(List names) { + if (this.innerProperties() == null) { + this.innerProperties = new ConfigurationNames(); + } + this.innerProperties().withNames(names); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/ConfigurationNames.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/ConfigurationNames.java new file mode 100644 index 000000000000..b1906cc37b40 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/ConfigurationNames.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicelinker.models.AuthType; +import com.azure.resourcemanager.servicelinker.models.ClientType; +import com.azure.resourcemanager.servicelinker.models.ConfigurationName; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The configuration names which will be set based on specific target resource, client type, auth type. */ +@Fluent +public final class ConfigurationNames { + /* + * The target service provider name and resource name. + */ + @JsonProperty(value = "targetService") + private String targetService; + + /* + * The client type for configuration names. + */ + @JsonProperty(value = "clientType") + private ClientType clientType; + + /* + * The auth type. + */ + @JsonProperty(value = "authType") + private AuthType authType; + + /* + * The configuration names to be set in compute service environment. + */ + @JsonProperty(value = "names") + private List names; + + /** Creates an instance of ConfigurationNames class. */ + public ConfigurationNames() { + } + + /** + * Get the targetService property: The target service provider name and resource name. + * + * @return the targetService value. + */ + public String targetService() { + return this.targetService; + } + + /** + * Set the targetService property: The target service provider name and resource name. + * + * @param targetService the targetService value to set. + * @return the ConfigurationNames object itself. + */ + public ConfigurationNames withTargetService(String targetService) { + this.targetService = targetService; + return this; + } + + /** + * Get the clientType property: The client type for configuration names. + * + * @return the clientType value. + */ + public ClientType clientType() { + return this.clientType; + } + + /** + * Set the clientType property: The client type for configuration names. + * + * @param clientType the clientType value to set. + * @return the ConfigurationNames object itself. + */ + public ConfigurationNames withClientType(ClientType clientType) { + this.clientType = clientType; + return this; + } + + /** + * Get the authType property: The auth type. + * + * @return the authType value. + */ + public AuthType authType() { + return this.authType; + } + + /** + * Set the authType property: The auth type. + * + * @param authType the authType value to set. + * @return the ConfigurationNames object itself. + */ + public ConfigurationNames withAuthType(AuthType authType) { + this.authType = authType; + return this; + } + + /** + * Get the names property: The configuration names to be set in compute service environment. + * + * @return the names value. + */ + public List names() { + return this.names; + } + + /** + * Set the names property: The configuration names to be set in compute service environment. + * + * @param names the names value to set. + * @return the ConfigurationNames object itself. + */ + public ConfigurationNames withNames(List names) { + this.names = names; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (names() != null) { + names().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/SourceConfigurationResultInner.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/ConfigurationResultInner.java similarity index 82% rename from sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/SourceConfigurationResultInner.java rename to sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/ConfigurationResultInner.java index aa517497546a..e7d80f161911 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/SourceConfigurationResultInner.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/ConfigurationResultInner.java @@ -11,13 +11,17 @@ /** Configurations for source resource, include appSettings, connectionString and serviceBindings. */ @Fluent -public final class SourceConfigurationResultInner { +public final class ConfigurationResultInner { /* * The configuration properties for source resource. */ @JsonProperty(value = "configurations") private List configurations; + /** Creates an instance of ConfigurationResultInner class. */ + public ConfigurationResultInner() { + } + /** * Get the configurations property: The configuration properties for source resource. * @@ -31,9 +35,9 @@ public List configurations() { * Set the configurations property: The configuration properties for source resource. * * @param configurations the configurations value to set. - * @return the SourceConfigurationResultInner object itself. + * @return the ConfigurationResultInner object itself. */ - public SourceConfigurationResultInner withConfigurations(List configurations) { + public ConfigurationResultInner withConfigurations(List configurations) { this.configurations = configurations; return this; } diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/DryrunProperties.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/DryrunProperties.java new file mode 100644 index 000000000000..592c717ceda4 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/DryrunProperties.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicelinker.models.DryrunOperationPreview; +import com.azure.resourcemanager.servicelinker.models.DryrunParameters; +import com.azure.resourcemanager.servicelinker.models.DryrunPrerequisiteResult; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties of the dryrun job. */ +@Fluent +public final class DryrunProperties { + /* + * The parameters of the dryrun + */ + @JsonProperty(value = "parameters") + private DryrunParameters parameters; + + /* + * the result of the dryrun + */ + @JsonProperty(value = "prerequisiteResults", access = JsonProperty.Access.WRITE_ONLY) + private List prerequisiteResults; + + /* + * the preview of the operations for creation + */ + @JsonProperty(value = "operationPreviews", access = JsonProperty.Access.WRITE_ONLY) + private List operationPreviews; + + /* + * The provisioning state. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** Creates an instance of DryrunProperties class. */ + public DryrunProperties() { + } + + /** + * Get the parameters property: The parameters of the dryrun. + * + * @return the parameters value. + */ + public DryrunParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: The parameters of the dryrun. + * + * @param parameters the parameters value to set. + * @return the DryrunProperties object itself. + */ + public DryrunProperties withParameters(DryrunParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the prerequisiteResults property: the result of the dryrun. + * + * @return the prerequisiteResults value. + */ + public List prerequisiteResults() { + return this.prerequisiteResults; + } + + /** + * Get the operationPreviews property: the preview of the operations for creation. + * + * @return the operationPreviews value. + */ + public List operationPreviews() { + return this.operationPreviews; + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (parameters() != null) { + parameters().validate(); + } + if (prerequisiteResults() != null) { + prerequisiteResults().forEach(e -> e.validate()); + } + if (operationPreviews() != null) { + operationPreviews().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/DryrunResourceInner.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/DryrunResourceInner.java new file mode 100644 index 000000000000..bb2a5db0f39a --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/DryrunResourceInner.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.servicelinker.models.DryrunOperationPreview; +import com.azure.resourcemanager.servicelinker.models.DryrunParameters; +import com.azure.resourcemanager.servicelinker.models.DryrunPrerequisiteResult; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** a dryrun job resource. */ +@Fluent +public final class DryrunResourceInner extends ProxyResource { + /* + * The properties of the dryrun job. + */ + @JsonProperty(value = "properties") + private DryrunProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of DryrunResourceInner class. */ + public DryrunResourceInner() { + } + + /** + * Get the innerProperties property: The properties of the dryrun job. + * + * @return the innerProperties value. + */ + private DryrunProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the parameters property: The parameters of the dryrun. + * + * @return the parameters value. + */ + public DryrunParameters parameters() { + return this.innerProperties() == null ? null : this.innerProperties().parameters(); + } + + /** + * Set the parameters property: The parameters of the dryrun. + * + * @param parameters the parameters value to set. + * @return the DryrunResourceInner object itself. + */ + public DryrunResourceInner withParameters(DryrunParameters parameters) { + if (this.innerProperties() == null) { + this.innerProperties = new DryrunProperties(); + } + this.innerProperties().withParameters(parameters); + return this; + } + + /** + * Get the prerequisiteResults property: the result of the dryrun. + * + * @return the prerequisiteResults value. + */ + public List prerequisiteResults() { + return this.innerProperties() == null ? null : this.innerProperties().prerequisiteResults(); + } + + /** + * Get the operationPreviews property: the preview of the operations for creation. + * + * @return the operationPreviews value. + */ + public List operationPreviews() { + return this.innerProperties() == null ? null : this.innerProperties().operationPreviews(); + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/LinkerProperties.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/LinkerProperties.java index 44ef47e9ee44..96ba211961d3 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/LinkerProperties.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/LinkerProperties.java @@ -7,14 +7,16 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.servicelinker.models.AuthInfoBase; import com.azure.resourcemanager.servicelinker.models.ClientType; +import com.azure.resourcemanager.servicelinker.models.ConfigurationInfo; +import com.azure.resourcemanager.servicelinker.models.PublicNetworkSolution; import com.azure.resourcemanager.servicelinker.models.SecretStore; import com.azure.resourcemanager.servicelinker.models.TargetServiceBase; import com.azure.resourcemanager.servicelinker.models.VNetSolution; import com.fasterxml.jackson.annotation.JsonProperty; -/** The properties of the linker. */ +/** The properties of the Linker. */ @Fluent -public final class LinkerProperties { +public class LinkerProperties { /* * The target service properties */ @@ -57,6 +59,22 @@ public final class LinkerProperties { @JsonProperty(value = "scope") private String scope; + /* + * The network solution. + */ + @JsonProperty(value = "publicNetworkSolution") + private PublicNetworkSolution publicNetworkSolution; + + /* + * The connection information consumed by applications, including secrets, connection strings. + */ + @JsonProperty(value = "configurationInfo") + private ConfigurationInfo configurationInfo; + + /** Creates an instance of LinkerProperties class. */ + public LinkerProperties() { + } + /** * Get the targetService property: The target service properties. * @@ -186,6 +204,48 @@ public LinkerProperties withScope(String scope) { return this; } + /** + * Get the publicNetworkSolution property: The network solution. + * + * @return the publicNetworkSolution value. + */ + public PublicNetworkSolution publicNetworkSolution() { + return this.publicNetworkSolution; + } + + /** + * Set the publicNetworkSolution property: The network solution. + * + * @param publicNetworkSolution the publicNetworkSolution value to set. + * @return the LinkerProperties object itself. + */ + public LinkerProperties withPublicNetworkSolution(PublicNetworkSolution publicNetworkSolution) { + this.publicNetworkSolution = publicNetworkSolution; + return this; + } + + /** + * Get the configurationInfo property: The connection information consumed by applications, including secrets, + * connection strings. + * + * @return the configurationInfo value. + */ + public ConfigurationInfo configurationInfo() { + return this.configurationInfo; + } + + /** + * Set the configurationInfo property: The connection information consumed by applications, including secrets, + * connection strings. + * + * @param configurationInfo the configurationInfo value to set. + * @return the LinkerProperties object itself. + */ + public LinkerProperties withConfigurationInfo(ConfigurationInfo configurationInfo) { + this.configurationInfo = configurationInfo; + return this; + } + /** * Validates the instance. * @@ -204,5 +264,11 @@ public void validate() { if (secretStore() != null) { secretStore().validate(); } + if (publicNetworkSolution() != null) { + publicNetworkSolution().validate(); + } + if (configurationInfo() != null) { + configurationInfo().validate(); + } } } diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/LinkerResourceInner.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/LinkerResourceInner.java index 44f17614df63..0057565c9e87 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/LinkerResourceInner.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/LinkerResourceInner.java @@ -10,6 +10,8 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.servicelinker.models.AuthInfoBase; import com.azure.resourcemanager.servicelinker.models.ClientType; +import com.azure.resourcemanager.servicelinker.models.ConfigurationInfo; +import com.azure.resourcemanager.servicelinker.models.PublicNetworkSolution; import com.azure.resourcemanager.servicelinker.models.SecretStore; import com.azure.resourcemanager.servicelinker.models.TargetServiceBase; import com.azure.resourcemanager.servicelinker.models.VNetSolution; @@ -19,19 +21,23 @@ @Fluent public final class LinkerResourceInner extends ProxyResource { /* - * The properties of the linker. + * The properties of the Linker. */ @JsonProperty(value = "properties", required = true) private LinkerProperties innerProperties = new LinkerProperties(); /* - * The system data. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /** Creates an instance of LinkerResourceInner class. */ + public LinkerResourceInner() { + } + /** - * Get the innerProperties property: The properties of the linker. + * Get the innerProperties property: The properties of the Linker. * * @return the innerProperties value. */ @@ -40,7 +46,7 @@ private LinkerProperties innerProperties() { } /** - * Get the systemData property: The system data. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -195,6 +201,54 @@ public LinkerResourceInner withScope(String scope) { return this; } + /** + * Get the publicNetworkSolution property: The network solution. + * + * @return the publicNetworkSolution value. + */ + public PublicNetworkSolution publicNetworkSolution() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkSolution(); + } + + /** + * Set the publicNetworkSolution property: The network solution. + * + * @param publicNetworkSolution the publicNetworkSolution value to set. + * @return the LinkerResourceInner object itself. + */ + public LinkerResourceInner withPublicNetworkSolution(PublicNetworkSolution publicNetworkSolution) { + if (this.innerProperties() == null) { + this.innerProperties = new LinkerProperties(); + } + this.innerProperties().withPublicNetworkSolution(publicNetworkSolution); + return this; + } + + /** + * Get the configurationInfo property: The connection information consumed by applications, including secrets, + * connection strings. + * + * @return the configurationInfo value. + */ + public ConfigurationInfo configurationInfo() { + return this.innerProperties() == null ? null : this.innerProperties().configurationInfo(); + } + + /** + * Set the configurationInfo property: The connection information consumed by applications, including secrets, + * connection strings. + * + * @param configurationInfo the configurationInfo value to set. + * @return the LinkerResourceInner object itself. + */ + public LinkerResourceInner withConfigurationInfo(ConfigurationInfo configurationInfo) { + if (this.innerProperties() == null) { + this.innerProperties = new LinkerProperties(); + } + this.innerProperties().withConfigurationInfo(configurationInfo); + return this; + } + /** * Validates the instance. * diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/OperationInner.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/OperationInner.java index 3d520cb77233..e9d065fb7e7a 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/OperationInner.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/OperationInner.java @@ -10,20 +10,23 @@ import com.azure.resourcemanager.servicelinker.models.Origin; import com.fasterxml.jackson.annotation.JsonProperty; -/** REST API Operation Details of a REST API operation, returned from the Resource Provider Operations API. */ +/** + * REST API Operation + * + *

Details of a REST API operation, returned from the Resource Provider Operations API. + */ @Fluent public final class OperationInner { /* - * The name of the operation, as per Resource-Based Access Control (RBAC). - * Examples: "Microsoft.Compute/virtualMachines/write", - * "Microsoft.Compute/virtualMachines/capture/action" + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" */ @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* - * Whether the operation applies to data-plane. This is "true" for - * data-plane operations and "false" for ARM/control-plane operations. + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for + * ARM/control-plane operations. */ @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) private Boolean isDataAction; @@ -35,19 +38,22 @@ public final class OperationInner { private OperationDisplay display; /* - * The intended executor of the operation; as in Resource Based Access - * Control (RBAC) and audit logs UX. Default value is "user,system" + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" */ @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) private Origin origin; /* - * Enum. Indicates the action type. "Internal" refers to actions that are - * for internal only APIs. + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) private ActionType actionType; + /** Creates an instance of OperationInner class. */ + public OperationInner() { + } + /** * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/ValidateOperationResultInner.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/ValidateOperationResultInner.java index 5d622571c49f..2df3a38b7164 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/ValidateOperationResultInner.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/ValidateOperationResultInner.java @@ -11,7 +11,7 @@ import java.time.OffsetDateTime; import java.util.List; -/** The validation operation result for a linker. */ +/** The validation operation result for a Linker. */ @Fluent public final class ValidateOperationResultInner { /* @@ -21,7 +21,7 @@ public final class ValidateOperationResultInner { private ValidateResult innerProperties; /* - * Validated linker id. + * Validated Linker id. */ @JsonProperty(value = "resourceId") private String resourceId; @@ -32,6 +32,10 @@ public final class ValidateOperationResultInner { @JsonProperty(value = "status") private String status; + /** Creates an instance of ValidateOperationResultInner class. */ + public ValidateOperationResultInner() { + } + /** * Get the innerProperties property: The validation result detail. * @@ -42,7 +46,7 @@ private ValidateResult innerProperties() { } /** - * Get the resourceId property: Validated linker id. + * Get the resourceId property: Validated Linker id. * * @return the resourceId value. */ @@ -51,7 +55,7 @@ public String resourceId() { } /** - * Set the resourceId property: Validated linker id. + * Set the resourceId property: Validated Linker id. * * @param resourceId the resourceId value to set. * @return the ValidateOperationResultInner object itself. @@ -174,7 +178,7 @@ public ValidateOperationResultInner withReportEndTimeUtc(OffsetDateTime reportEn } /** - * Get the sourceId property: The resource id of the linker source application. + * Get the sourceId property: The resource id of the Linker source application. * * @return the sourceId value. */ @@ -183,7 +187,7 @@ public String sourceId() { } /** - * Set the sourceId property: The resource id of the linker source application. + * Set the sourceId property: The resource id of the Linker source application. * * @param sourceId the sourceId value to set. * @return the ValidateOperationResultInner object itself. diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/ValidateResult.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/ValidateResult.java index 77eda44f84be..c2a2bbbfeea0 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/ValidateResult.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/ValidateResult.java @@ -11,7 +11,7 @@ import java.time.OffsetDateTime; import java.util.List; -/** The validation result for a linker. */ +/** The validation result for a Linker. */ @Fluent public final class ValidateResult { /* @@ -39,7 +39,7 @@ public final class ValidateResult { private OffsetDateTime reportEndTimeUtc; /* - * The resource id of the linker source application. + * The resource id of the Linker source application. */ @JsonProperty(value = "sourceId") private String sourceId; @@ -62,6 +62,10 @@ public final class ValidateResult { @JsonProperty(value = "validationDetail") private List validationDetail; + /** Creates an instance of ValidateResult class. */ + public ValidateResult() { + } + /** * Get the linkerName property: The linker name. * @@ -143,7 +147,7 @@ public ValidateResult withReportEndTimeUtc(OffsetDateTime reportEndTimeUtc) { } /** - * Get the sourceId property: The resource id of the linker source application. + * Get the sourceId property: The resource id of the Linker source application. * * @return the sourceId value. */ @@ -152,7 +156,7 @@ public String sourceId() { } /** - * Set the sourceId property: The resource id of the linker source application. + * Set the sourceId property: The resource id of the Linker source application. * * @param sourceId the sourceId value to set. * @return the ValidateResult object itself. diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ConfigurationNameItemImpl.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ConfigurationNameItemImpl.java new file mode 100644 index 000000000000..7f33b55f2b36 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ConfigurationNameItemImpl.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.implementation; + +import com.azure.resourcemanager.servicelinker.fluent.models.ConfigurationNameItemInner; +import com.azure.resourcemanager.servicelinker.models.AuthType; +import com.azure.resourcemanager.servicelinker.models.ClientType; +import com.azure.resourcemanager.servicelinker.models.ConfigurationName; +import com.azure.resourcemanager.servicelinker.models.ConfigurationNameItem; +import java.util.Collections; +import java.util.List; + +public final class ConfigurationNameItemImpl implements ConfigurationNameItem { + private ConfigurationNameItemInner innerObject; + + private final com.azure.resourcemanager.servicelinker.ServiceLinkerManager serviceManager; + + ConfigurationNameItemImpl( + ConfigurationNameItemInner innerObject, + com.azure.resourcemanager.servicelinker.ServiceLinkerManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String targetService() { + return this.innerModel().targetService(); + } + + public ClientType clientType() { + return this.innerModel().clientType(); + } + + public AuthType authType() { + return this.innerModel().authType(); + } + + public List names() { + List inner = this.innerModel().names(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ConfigurationNameItemInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ConfigurationNamesOperationsClientImpl.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ConfigurationNamesOperationsClientImpl.java new file mode 100644 index 000000000000..7eec3b8b1253 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ConfigurationNamesOperationsClientImpl.java @@ -0,0 +1,316 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.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.servicelinker.fluent.ConfigurationNamesOperationsClient; +import com.azure.resourcemanager.servicelinker.fluent.models.ConfigurationNameItemInner; +import com.azure.resourcemanager.servicelinker.models.ConfigurationNameResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ConfigurationNamesOperationsClient. */ +public final class ConfigurationNamesOperationsClientImpl implements ConfigurationNamesOperationsClient { + /** The proxy service used to perform REST calls. */ + private final ConfigurationNamesOperationsService service; + + /** The service client containing this operation class. */ + private final ServiceLinkerManagementClientImpl client; + + /** + * Initializes an instance of ConfigurationNamesOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ConfigurationNamesOperationsClientImpl(ServiceLinkerManagementClientImpl client) { + this.service = + RestProxy + .create( + ConfigurationNamesOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceLinkerManagementClientConfigurationNamesOperations to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceLinkerManagem") + public interface ConfigurationNamesOperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.ServiceLinker/configurationNames") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @QueryParam("$skipToken") String skipToken, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists the configuration names generated by Service Connector for all target, client types, auth types. + * + * @param filter OData filter options. + * @param skipToken OData skipToken option for pagination. + * @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 configuration Name list which will be set based on different target resource, client type, auth type + * along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String filter, String skipToken) { + 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(), filter, skipToken, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the configuration names generated by Service Connector for all target, client types, auth types. + * + * @param filter OData filter options. + * @param skipToken OData skipToken option for pagination. + * @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 configuration Name list which will be set based on different target resource, client type, auth type + * along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String filter, String skipToken, 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(), filter, skipToken, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the configuration names generated by Service Connector for all target, client types, auth types. + * + * @param filter OData filter options. + * @param skipToken OData skipToken option for pagination. + * @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 configuration Name list which will be set based on different target resource, client type, auth type as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, String skipToken) { + return new PagedFlux<>( + () -> listSinglePageAsync(filter, skipToken), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the configuration names generated by Service Connector for all target, client types, auth types. + * + * @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 configuration Name list which will be set based on different target resource, client type, auth type as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String filter = null; + final String skipToken = null; + return new PagedFlux<>( + () -> listSinglePageAsync(filter, skipToken), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the configuration names generated by Service Connector for all target, client types, auth types. + * + * @param filter OData filter options. + * @param skipToken OData skipToken option for pagination. + * @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 configuration Name list which will be set based on different target resource, client type, auth type as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, String skipToken, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(filter, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the configuration names generated by Service Connector for all target, client types, auth types. + * + * @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 configuration Name list which will be set based on different target resource, client type, auth type as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + final String skipToken = null; + return new PagedIterable<>(listAsync(filter, skipToken)); + } + + /** + * Lists the configuration names generated by Service Connector for all target, client types, auth types. + * + * @param filter OData filter options. + * @param skipToken OData skipToken option for pagination. + * @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 configuration Name list which will be set based on different target resource, client type, auth type as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String filter, String skipToken, Context context) { + return new PagedIterable<>(listAsync(filter, skipToken, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 configuration Name list which will be set based on different target resource, client type, auth type + * along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + 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.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 configuration Name list which will be set based on different target resource, client type, auth type + * along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + 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 + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ConfigurationNamesOperationsImpl.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ConfigurationNamesOperationsImpl.java new file mode 100644 index 000000000000..3f11fef1411a --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ConfigurationNamesOperationsImpl.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.servicelinker.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.servicelinker.fluent.ConfigurationNamesOperationsClient; +import com.azure.resourcemanager.servicelinker.fluent.models.ConfigurationNameItemInner; +import com.azure.resourcemanager.servicelinker.models.ConfigurationNameItem; +import com.azure.resourcemanager.servicelinker.models.ConfigurationNamesOperations; + +public final class ConfigurationNamesOperationsImpl implements ConfigurationNamesOperations { + private static final ClientLogger LOGGER = new ClientLogger(ConfigurationNamesOperationsImpl.class); + + private final ConfigurationNamesOperationsClient innerClient; + + private final com.azure.resourcemanager.servicelinker.ServiceLinkerManager serviceManager; + + public ConfigurationNamesOperationsImpl( + ConfigurationNamesOperationsClient innerClient, + com.azure.resourcemanager.servicelinker.ServiceLinkerManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ConfigurationNameItemImpl(inner1, this.manager())); + } + + public PagedIterable list(String filter, String skipToken, Context context) { + PagedIterable inner = this.serviceClient().list(filter, skipToken, context); + return Utils.mapPage(inner, inner1 -> new ConfigurationNameItemImpl(inner1, this.manager())); + } + + private ConfigurationNamesOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/SourceConfigurationResultImpl.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ConfigurationResultImpl.java similarity index 70% rename from sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/SourceConfigurationResultImpl.java rename to sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ConfigurationResultImpl.java index b0ea8b17ee5f..4f2738a1b604 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/SourceConfigurationResultImpl.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ConfigurationResultImpl.java @@ -4,19 +4,19 @@ package com.azure.resourcemanager.servicelinker.implementation; -import com.azure.resourcemanager.servicelinker.fluent.models.SourceConfigurationResultInner; +import com.azure.resourcemanager.servicelinker.fluent.models.ConfigurationResultInner; +import com.azure.resourcemanager.servicelinker.models.ConfigurationResult; import com.azure.resourcemanager.servicelinker.models.SourceConfiguration; -import com.azure.resourcemanager.servicelinker.models.SourceConfigurationResult; import java.util.Collections; import java.util.List; -public final class SourceConfigurationResultImpl implements SourceConfigurationResult { - private SourceConfigurationResultInner innerObject; +public final class ConfigurationResultImpl implements ConfigurationResult { + private ConfigurationResultInner innerObject; private final com.azure.resourcemanager.servicelinker.ServiceLinkerManager serviceManager; - SourceConfigurationResultImpl( - SourceConfigurationResultInner innerObject, + ConfigurationResultImpl( + ConfigurationResultInner innerObject, com.azure.resourcemanager.servicelinker.ServiceLinkerManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -31,7 +31,7 @@ public List configurations() { } } - public SourceConfigurationResultInner innerModel() { + public ConfigurationResultInner innerModel() { return this.innerObject; } diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ConnectorsClientImpl.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ConnectorsClientImpl.java new file mode 100644 index 000000000000..795ffe79b422 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ConnectorsClientImpl.java @@ -0,0 +1,3326 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.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.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.servicelinker.fluent.ConnectorsClient; +import com.azure.resourcemanager.servicelinker.fluent.models.ConfigurationResultInner; +import com.azure.resourcemanager.servicelinker.fluent.models.DryrunResourceInner; +import com.azure.resourcemanager.servicelinker.fluent.models.LinkerResourceInner; +import com.azure.resourcemanager.servicelinker.fluent.models.ValidateOperationResultInner; +import com.azure.resourcemanager.servicelinker.models.ConfigurationInfo; +import com.azure.resourcemanager.servicelinker.models.DryrunList; +import com.azure.resourcemanager.servicelinker.models.DryrunPatch; +import com.azure.resourcemanager.servicelinker.models.LinkerPatch; +import com.azure.resourcemanager.servicelinker.models.ResourceList; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ConnectorsClient. */ +public final class ConnectorsClientImpl implements ConnectorsClient { + /** The proxy service used to perform REST calls. */ + private final ConnectorsService service; + + /** The service client containing this operation class. */ + private final ServiceLinkerManagementClientImpl client; + + /** + * Initializes an instance of ConnectorsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ConnectorsClientImpl(ServiceLinkerManagementClientImpl client) { + this.service = + RestProxy.create(ConnectorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceLinkerManagementClientConnectors to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceLinkerManagem") + public interface ConnectorsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker" + + "/locations/{location}/dryruns") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listDryrun( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker" + + "/locations/{location}/dryruns/{dryrunName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getDryrun( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("dryrunName") String dryrunName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker" + + "/locations/{location}/dryruns/{dryrunName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createDryrun( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("dryrunName") String dryrunName, + @BodyParam("application/json") DryrunResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker" + + "/locations/{location}/dryruns/{dryrunName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateDryrun( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("dryrunName") String dryrunName, + @BodyParam("application/json") DryrunPatch parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker" + + "/locations/{location}/dryruns/{dryrunName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deleteDryrun( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("dryrunName") String dryrunName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker" + + "/locations/{location}/connectors") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker" + + "/locations/{location}/connectors/{connectorName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("location") String location, + @PathParam("connectorName") String connectorName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker" + + "/locations/{location}/connectors/{connectorName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("location") String location, + @PathParam("connectorName") String connectorName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") LinkerResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker" + + "/locations/{location}/connectors/{connectorName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("location") String location, + @PathParam("connectorName") String connectorName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker" + + "/locations/{location}/connectors/{connectorName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("location") String location, + @PathParam("connectorName") String connectorName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") LinkerPatch parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker" + + "/locations/{location}/connectors/{connectorName}/validate") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> validate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("location") String location, + @PathParam("connectorName") String connectorName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker" + + "/locations/{location}/connectors/{connectorName}/generateConfigurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> generateConfigurations( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("location") String location, + @PathParam("connectorName") String connectorName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ConfigurationInfo parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listDryrunNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * list dryrun jobs. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @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 dryrun along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDryrunSinglePageAsync( + String subscriptionId, String resourceGroupName, String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listDryrun( + this.client.getEndpoint(), + subscriptionId, + resourceGroupName, + location, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * list dryrun jobs. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @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 dryrun along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDryrunSinglePageAsync( + String subscriptionId, String resourceGroupName, String location, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listDryrun( + this.client.getEndpoint(), + subscriptionId, + resourceGroupName, + location, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * list dryrun jobs. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @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 dryrun as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listDryrunAsync( + String subscriptionId, String resourceGroupName, String location) { + return new PagedFlux<>( + () -> listDryrunSinglePageAsync(subscriptionId, resourceGroupName, location), + nextLink -> listDryrunNextSinglePageAsync(nextLink)); + } + + /** + * list dryrun jobs. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @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 dryrun as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listDryrunAsync( + String subscriptionId, String resourceGroupName, String location, Context context) { + return new PagedFlux<>( + () -> listDryrunSinglePageAsync(subscriptionId, resourceGroupName, location, context), + nextLink -> listDryrunNextSinglePageAsync(nextLink, context)); + } + + /** + * list dryrun jobs. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @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 dryrun as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDryrun( + String subscriptionId, String resourceGroupName, String location) { + return new PagedIterable<>(listDryrunAsync(subscriptionId, resourceGroupName, location)); + } + + /** + * list dryrun jobs. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @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 dryrun as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDryrun( + String subscriptionId, String resourceGroupName, String location, Context context) { + return new PagedIterable<>(listDryrunAsync(subscriptionId, resourceGroupName, location, context)); + } + + /** + * get a dryrun job. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @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 dryrun job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDryrunWithResponseAsync( + String subscriptionId, String resourceGroupName, String location, String dryrunName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (dryrunName == null) { + return Mono.error(new IllegalArgumentException("Parameter dryrunName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getDryrun( + this.client.getEndpoint(), + subscriptionId, + resourceGroupName, + location, + this.client.getApiVersion(), + dryrunName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * get a dryrun job. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @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 a dryrun job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDryrunWithResponseAsync( + String subscriptionId, String resourceGroupName, String location, String dryrunName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (dryrunName == null) { + return Mono.error(new IllegalArgumentException("Parameter dryrunName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getDryrun( + this.client.getEndpoint(), + subscriptionId, + resourceGroupName, + location, + this.client.getApiVersion(), + dryrunName, + accept, + context); + } + + /** + * get a dryrun job. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @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 dryrun job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getDryrunAsync( + String subscriptionId, String resourceGroupName, String location, String dryrunName) { + return getDryrunWithResponseAsync(subscriptionId, resourceGroupName, location, dryrunName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * get a dryrun job. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @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 a dryrun job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDryrunWithResponse( + String subscriptionId, String resourceGroupName, String location, String dryrunName, Context context) { + return getDryrunWithResponseAsync(subscriptionId, resourceGroupName, location, dryrunName, context).block(); + } + + /** + * get a dryrun job. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @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 dryrun job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DryrunResourceInner getDryrun( + String subscriptionId, String resourceGroupName, String location, String dryrunName) { + return getDryrunWithResponse(subscriptionId, resourceGroupName, location, dryrunName, Context.NONE).getValue(); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @param parameters dryrun resource. + * @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 dryrun job resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createDryrunWithResponseAsync( + String subscriptionId, + String resourceGroupName, + String location, + String dryrunName, + DryrunResourceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (dryrunName == null) { + return Mono.error(new IllegalArgumentException("Parameter dryrunName 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 + .createDryrun( + this.client.getEndpoint(), + subscriptionId, + resourceGroupName, + location, + this.client.getApiVersion(), + dryrunName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @param parameters dryrun 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 a dryrun job resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createDryrunWithResponseAsync( + String subscriptionId, + String resourceGroupName, + String location, + String dryrunName, + DryrunResourceInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (dryrunName == null) { + return Mono.error(new IllegalArgumentException("Parameter dryrunName 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 + .createDryrun( + this.client.getEndpoint(), + subscriptionId, + resourceGroupName, + location, + this.client.getApiVersion(), + dryrunName, + parameters, + accept, + context); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @param parameters dryrun resource. + * @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 PollerFlux} for polling of a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DryrunResourceInner> beginCreateDryrunAsync( + String subscriptionId, + String resourceGroupName, + String location, + String dryrunName, + DryrunResourceInner parameters) { + Mono>> mono = + createDryrunWithResponseAsync(subscriptionId, resourceGroupName, location, dryrunName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DryrunResourceInner.class, + DryrunResourceInner.class, + this.client.getContext()); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @param parameters dryrun 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 {@link PollerFlux} for polling of a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DryrunResourceInner> beginCreateDryrunAsync( + String subscriptionId, + String resourceGroupName, + String location, + String dryrunName, + DryrunResourceInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createDryrunWithResponseAsync(subscriptionId, resourceGroupName, location, dryrunName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DryrunResourceInner.class, DryrunResourceInner.class, context); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @param parameters dryrun resource. + * @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 SyncPoller} for polling of a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DryrunResourceInner> beginCreateDryrun( + String subscriptionId, + String resourceGroupName, + String location, + String dryrunName, + DryrunResourceInner parameters) { + return beginCreateDryrunAsync(subscriptionId, resourceGroupName, location, dryrunName, parameters) + .getSyncPoller(); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @param parameters dryrun 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 {@link SyncPoller} for polling of a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DryrunResourceInner> beginCreateDryrun( + String subscriptionId, + String resourceGroupName, + String location, + String dryrunName, + DryrunResourceInner parameters, + Context context) { + return beginCreateDryrunAsync(subscriptionId, resourceGroupName, location, dryrunName, parameters, context) + .getSyncPoller(); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @param parameters dryrun resource. + * @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 dryrun job resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createDryrunAsync( + String subscriptionId, + String resourceGroupName, + String location, + String dryrunName, + DryrunResourceInner parameters) { + return beginCreateDryrunAsync(subscriptionId, resourceGroupName, location, dryrunName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @param parameters dryrun 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 a dryrun job resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createDryrunAsync( + String subscriptionId, + String resourceGroupName, + String location, + String dryrunName, + DryrunResourceInner parameters, + Context context) { + return beginCreateDryrunAsync(subscriptionId, resourceGroupName, location, dryrunName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @param parameters dryrun resource. + * @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 dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DryrunResourceInner createDryrun( + String subscriptionId, + String resourceGroupName, + String location, + String dryrunName, + DryrunResourceInner parameters) { + return createDryrunAsync(subscriptionId, resourceGroupName, location, dryrunName, parameters).block(); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @param parameters dryrun 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 a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DryrunResourceInner createDryrun( + String subscriptionId, + String resourceGroupName, + String location, + String dryrunName, + DryrunResourceInner parameters, + Context context) { + return createDryrunAsync(subscriptionId, resourceGroupName, location, dryrunName, parameters, context).block(); + } + + /** + * update a dryrun job to do necessary check before actual creation. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @param parameters dryrun resource. + * @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 dryrun job resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateDryrunWithResponseAsync( + String subscriptionId, String resourceGroupName, String location, String dryrunName, DryrunPatch parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (dryrunName == null) { + return Mono.error(new IllegalArgumentException("Parameter dryrunName 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 + .updateDryrun( + this.client.getEndpoint(), + subscriptionId, + resourceGroupName, + location, + this.client.getApiVersion(), + dryrunName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * update a dryrun job to do necessary check before actual creation. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @param parameters dryrun 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 a dryrun job resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateDryrunWithResponseAsync( + String subscriptionId, + String resourceGroupName, + String location, + String dryrunName, + DryrunPatch parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (dryrunName == null) { + return Mono.error(new IllegalArgumentException("Parameter dryrunName 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 + .updateDryrun( + this.client.getEndpoint(), + subscriptionId, + resourceGroupName, + location, + this.client.getApiVersion(), + dryrunName, + parameters, + accept, + context); + } + + /** + * update a dryrun job to do necessary check before actual creation. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @param parameters dryrun resource. + * @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 PollerFlux} for polling of a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DryrunResourceInner> beginUpdateDryrunAsync( + String subscriptionId, String resourceGroupName, String location, String dryrunName, DryrunPatch parameters) { + Mono>> mono = + updateDryrunWithResponseAsync(subscriptionId, resourceGroupName, location, dryrunName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DryrunResourceInner.class, + DryrunResourceInner.class, + this.client.getContext()); + } + + /** + * update a dryrun job to do necessary check before actual creation. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @param parameters dryrun 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 {@link PollerFlux} for polling of a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DryrunResourceInner> beginUpdateDryrunAsync( + String subscriptionId, + String resourceGroupName, + String location, + String dryrunName, + DryrunPatch parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateDryrunWithResponseAsync(subscriptionId, resourceGroupName, location, dryrunName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DryrunResourceInner.class, DryrunResourceInner.class, context); + } + + /** + * update a dryrun job to do necessary check before actual creation. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @param parameters dryrun resource. + * @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 SyncPoller} for polling of a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DryrunResourceInner> beginUpdateDryrun( + String subscriptionId, String resourceGroupName, String location, String dryrunName, DryrunPatch parameters) { + return beginUpdateDryrunAsync(subscriptionId, resourceGroupName, location, dryrunName, parameters) + .getSyncPoller(); + } + + /** + * update a dryrun job to do necessary check before actual creation. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @param parameters dryrun 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 {@link SyncPoller} for polling of a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DryrunResourceInner> beginUpdateDryrun( + String subscriptionId, + String resourceGroupName, + String location, + String dryrunName, + DryrunPatch parameters, + Context context) { + return beginUpdateDryrunAsync(subscriptionId, resourceGroupName, location, dryrunName, parameters, context) + .getSyncPoller(); + } + + /** + * update a dryrun job to do necessary check before actual creation. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @param parameters dryrun resource. + * @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 dryrun job resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateDryrunAsync( + String subscriptionId, String resourceGroupName, String location, String dryrunName, DryrunPatch parameters) { + return beginUpdateDryrunAsync(subscriptionId, resourceGroupName, location, dryrunName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * update a dryrun job to do necessary check before actual creation. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @param parameters dryrun 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 a dryrun job resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateDryrunAsync( + String subscriptionId, + String resourceGroupName, + String location, + String dryrunName, + DryrunPatch parameters, + Context context) { + return beginUpdateDryrunAsync(subscriptionId, resourceGroupName, location, dryrunName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * update a dryrun job to do necessary check before actual creation. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @param parameters dryrun resource. + * @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 dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DryrunResourceInner updateDryrun( + String subscriptionId, String resourceGroupName, String location, String dryrunName, DryrunPatch parameters) { + return updateDryrunAsync(subscriptionId, resourceGroupName, location, dryrunName, parameters).block(); + } + + /** + * update a dryrun job to do necessary check before actual creation. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @param parameters dryrun 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 a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DryrunResourceInner updateDryrun( + String subscriptionId, + String resourceGroupName, + String location, + String dryrunName, + DryrunPatch parameters, + Context context) { + return updateDryrunAsync(subscriptionId, resourceGroupName, location, dryrunName, parameters, context).block(); + } + + /** + * delete a dryrun job. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @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> deleteDryrunWithResponseAsync( + String subscriptionId, String resourceGroupName, String location, String dryrunName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (dryrunName == null) { + return Mono.error(new IllegalArgumentException("Parameter dryrunName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteDryrun( + this.client.getEndpoint(), + subscriptionId, + resourceGroupName, + location, + this.client.getApiVersion(), + dryrunName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * delete a dryrun job. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @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> deleteDryrunWithResponseAsync( + String subscriptionId, String resourceGroupName, String location, String dryrunName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (dryrunName == null) { + return Mono.error(new IllegalArgumentException("Parameter dryrunName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteDryrun( + this.client.getEndpoint(), + subscriptionId, + resourceGroupName, + location, + this.client.getApiVersion(), + dryrunName, + accept, + context); + } + + /** + * delete a dryrun job. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @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 deleteDryrunAsync( + String subscriptionId, String resourceGroupName, String location, String dryrunName) { + return deleteDryrunWithResponseAsync(subscriptionId, resourceGroupName, location, dryrunName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * delete a dryrun job. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @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 deleteDryrunWithResponse( + String subscriptionId, String resourceGroupName, String location, String dryrunName, Context context) { + return deleteDryrunWithResponseAsync(subscriptionId, resourceGroupName, location, dryrunName, context).block(); + } + + /** + * delete a dryrun job. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @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 deleteDryrun(String subscriptionId, String resourceGroupName, String location, String dryrunName) { + deleteDryrunWithResponse(subscriptionId, resourceGroupName, location, dryrunName, Context.NONE); + } + + /** + * Returns list of connector which connects to the resource, which supports to config the target service during the + * resource provision. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @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 Linker along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String subscriptionId, String resourceGroupName, String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + subscriptionId, + resourceGroupName, + location, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns list of connector which connects to the resource, which supports to config the target service during the + * resource provision. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @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 Linker along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String subscriptionId, String resourceGroupName, String location, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + subscriptionId, + resourceGroupName, + location, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns list of connector which connects to the resource, which supports to config the target service during the + * resource provision. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @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 Linker as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String subscriptionId, String resourceGroupName, String location) { + return new PagedFlux<>( + () -> listSinglePageAsync(subscriptionId, resourceGroupName, location), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Returns list of connector which connects to the resource, which supports to config the target service during the + * resource provision. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @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 Linker as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String subscriptionId, String resourceGroupName, String location, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(subscriptionId, resourceGroupName, location, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns list of connector which connects to the resource, which supports to config the target service during the + * resource provision. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @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 Linker as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String subscriptionId, String resourceGroupName, String location) { + return new PagedIterable<>(listAsync(subscriptionId, resourceGroupName, location)); + } + + /** + * Returns list of connector which connects to the resource, which supports to config the target service during the + * resource provision. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @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 Linker as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String subscriptionId, String resourceGroupName, String location, Context context) { + return new PagedIterable<>(listAsync(subscriptionId, resourceGroupName, location, context)); + } + + /** + * Returns Connector resource for a given name. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @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 linker of source and target resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String subscriptionId, String resourceGroupName, String location, String connectorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (connectorName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + subscriptionId, + resourceGroupName, + location, + connectorName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns Connector resource for a given name. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of 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 linker of source and target resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String subscriptionId, String resourceGroupName, String location, String connectorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (connectorName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + subscriptionId, + resourceGroupName, + location, + connectorName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Returns Connector resource for a given name. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @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 linker of source and target resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String subscriptionId, String resourceGroupName, String location, String connectorName) { + return getWithResponseAsync(subscriptionId, resourceGroupName, location, connectorName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns Connector resource for a given name. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of 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 linker of source and target resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String subscriptionId, String resourceGroupName, String location, String connectorName, Context context) { + return getWithResponseAsync(subscriptionId, resourceGroupName, location, connectorName, context).block(); + } + + /** + * Returns Connector resource for a given name. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @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 linker of source and target resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LinkerResourceInner get( + String subscriptionId, String resourceGroupName, String location, String connectorName) { + return getWithResponse(subscriptionId, resourceGroupName, location, connectorName, Context.NONE).getValue(); + } + + /** + * Create or update Connector resource. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @param parameters Connector details. + * @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 linker of source and target resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String subscriptionId, + String resourceGroupName, + String location, + String connectorName, + LinkerResourceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (connectorName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectorName 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 + .createOrUpdate( + this.client.getEndpoint(), + subscriptionId, + resourceGroupName, + location, + connectorName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update Connector resource. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @param parameters Connector details. + * @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 linker of source and target resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String subscriptionId, + String resourceGroupName, + String location, + String connectorName, + LinkerResourceInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (connectorName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectorName 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 + .createOrUpdate( + this.client.getEndpoint(), + subscriptionId, + resourceGroupName, + location, + connectorName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Create or update Connector resource. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @param parameters Connector details. + * @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 PollerFlux} for polling of linker of source and target resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LinkerResourceInner> beginCreateOrUpdateAsync( + String subscriptionId, + String resourceGroupName, + String location, + String connectorName, + LinkerResourceInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(subscriptionId, resourceGroupName, location, connectorName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + LinkerResourceInner.class, + LinkerResourceInner.class, + this.client.getContext()); + } + + /** + * Create or update Connector resource. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @param parameters Connector details. + * @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 PollerFlux} for polling of linker of source and target resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LinkerResourceInner> beginCreateOrUpdateAsync( + String subscriptionId, + String resourceGroupName, + String location, + String connectorName, + LinkerResourceInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + subscriptionId, resourceGroupName, location, connectorName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), LinkerResourceInner.class, LinkerResourceInner.class, context); + } + + /** + * Create or update Connector resource. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @param parameters Connector details. + * @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 SyncPoller} for polling of linker of source and target resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LinkerResourceInner> beginCreateOrUpdate( + String subscriptionId, + String resourceGroupName, + String location, + String connectorName, + LinkerResourceInner parameters) { + return beginCreateOrUpdateAsync(subscriptionId, resourceGroupName, location, connectorName, parameters) + .getSyncPoller(); + } + + /** + * Create or update Connector resource. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @param parameters Connector details. + * @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 SyncPoller} for polling of linker of source and target resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LinkerResourceInner> beginCreateOrUpdate( + String subscriptionId, + String resourceGroupName, + String location, + String connectorName, + LinkerResourceInner parameters, + Context context) { + return beginCreateOrUpdateAsync(subscriptionId, resourceGroupName, location, connectorName, parameters, context) + .getSyncPoller(); + } + + /** + * Create or update Connector resource. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @param parameters Connector details. + * @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 linker of source and target resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String subscriptionId, + String resourceGroupName, + String location, + String connectorName, + LinkerResourceInner parameters) { + return beginCreateOrUpdateAsync(subscriptionId, resourceGroupName, location, connectorName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update Connector resource. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @param parameters Connector details. + * @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 linker of source and target resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String subscriptionId, + String resourceGroupName, + String location, + String connectorName, + LinkerResourceInner parameters, + Context context) { + return beginCreateOrUpdateAsync(subscriptionId, resourceGroupName, location, connectorName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update Connector resource. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @param parameters Connector details. + * @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 linker of source and target resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LinkerResourceInner createOrUpdate( + String subscriptionId, + String resourceGroupName, + String location, + String connectorName, + LinkerResourceInner parameters) { + return createOrUpdateAsync(subscriptionId, resourceGroupName, location, connectorName, parameters).block(); + } + + /** + * Create or update Connector resource. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @param parameters Connector details. + * @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 linker of source and target resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LinkerResourceInner createOrUpdate( + String subscriptionId, + String resourceGroupName, + String location, + String connectorName, + LinkerResourceInner parameters, + Context context) { + return createOrUpdateAsync(subscriptionId, resourceGroupName, location, connectorName, parameters, context) + .block(); + } + + /** + * Delete a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @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 subscriptionId, String resourceGroupName, String location, String connectorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (connectorName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + subscriptionId, + resourceGroupName, + location, + connectorName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String subscriptionId, String resourceGroupName, String location, String connectorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (connectorName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + subscriptionId, + resourceGroupName, + location, + connectorName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @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 PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String subscriptionId, String resourceGroupName, String location, String connectorName) { + Mono>> mono = + deleteWithResponseAsync(subscriptionId, resourceGroupName, location, connectorName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String subscriptionId, String resourceGroupName, String location, String connectorName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(subscriptionId, resourceGroupName, location, connectorName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String subscriptionId, String resourceGroupName, String location, String connectorName) { + return beginDeleteAsync(subscriptionId, resourceGroupName, location, connectorName).getSyncPoller(); + } + + /** + * Delete a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String subscriptionId, String resourceGroupName, String location, String connectorName, Context context) { + return beginDeleteAsync(subscriptionId, resourceGroupName, location, connectorName, context).getSyncPoller(); + } + + /** + * Delete a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @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 subscriptionId, String resourceGroupName, String location, String connectorName) { + return beginDeleteAsync(subscriptionId, resourceGroupName, location, connectorName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String subscriptionId, String resourceGroupName, String location, String connectorName, Context context) { + return beginDeleteAsync(subscriptionId, resourceGroupName, location, connectorName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @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 subscriptionId, String resourceGroupName, String location, String connectorName) { + deleteAsync(subscriptionId, resourceGroupName, location, connectorName).block(); + } + + /** + * Delete a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String subscriptionId, String resourceGroupName, String location, String connectorName, Context context) { + deleteAsync(subscriptionId, resourceGroupName, location, connectorName, context).block(); + } + + /** + * Operation to update an existing Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @param parameters Connector details. + * @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 linker of source and target resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String subscriptionId, + String resourceGroupName, + String location, + String connectorName, + LinkerPatch parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (connectorName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectorName 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 + .update( + this.client.getEndpoint(), + subscriptionId, + resourceGroupName, + location, + connectorName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Operation to update an existing Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @param parameters Connector details. + * @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 linker of source and target resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String subscriptionId, + String resourceGroupName, + String location, + String connectorName, + LinkerPatch parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (connectorName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectorName 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 + .update( + this.client.getEndpoint(), + subscriptionId, + resourceGroupName, + location, + connectorName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Operation to update an existing Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @param parameters Connector details. + * @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 PollerFlux} for polling of linker of source and target resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LinkerResourceInner> beginUpdateAsync( + String subscriptionId, + String resourceGroupName, + String location, + String connectorName, + LinkerPatch parameters) { + Mono>> mono = + updateWithResponseAsync(subscriptionId, resourceGroupName, location, connectorName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + LinkerResourceInner.class, + LinkerResourceInner.class, + this.client.getContext()); + } + + /** + * Operation to update an existing Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @param parameters Connector details. + * @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 PollerFlux} for polling of linker of source and target resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LinkerResourceInner> beginUpdateAsync( + String subscriptionId, + String resourceGroupName, + String location, + String connectorName, + LinkerPatch parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(subscriptionId, resourceGroupName, location, connectorName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), LinkerResourceInner.class, LinkerResourceInner.class, context); + } + + /** + * Operation to update an existing Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @param parameters Connector details. + * @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 SyncPoller} for polling of linker of source and target resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LinkerResourceInner> beginUpdate( + String subscriptionId, + String resourceGroupName, + String location, + String connectorName, + LinkerPatch parameters) { + return beginUpdateAsync(subscriptionId, resourceGroupName, location, connectorName, parameters).getSyncPoller(); + } + + /** + * Operation to update an existing Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @param parameters Connector details. + * @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 SyncPoller} for polling of linker of source and target resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LinkerResourceInner> beginUpdate( + String subscriptionId, + String resourceGroupName, + String location, + String connectorName, + LinkerPatch parameters, + Context context) { + return beginUpdateAsync(subscriptionId, resourceGroupName, location, connectorName, parameters, context) + .getSyncPoller(); + } + + /** + * Operation to update an existing Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @param parameters Connector details. + * @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 linker of source and target resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String subscriptionId, + String resourceGroupName, + String location, + String connectorName, + LinkerPatch parameters) { + return beginUpdateAsync(subscriptionId, resourceGroupName, location, connectorName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to update an existing Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @param parameters Connector details. + * @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 linker of source and target resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String subscriptionId, + String resourceGroupName, + String location, + String connectorName, + LinkerPatch parameters, + Context context) { + return beginUpdateAsync(subscriptionId, resourceGroupName, location, connectorName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to update an existing Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @param parameters Connector details. + * @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 linker of source and target resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LinkerResourceInner update( + String subscriptionId, + String resourceGroupName, + String location, + String connectorName, + LinkerPatch parameters) { + return updateAsync(subscriptionId, resourceGroupName, location, connectorName, parameters).block(); + } + + /** + * Operation to update an existing Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @param parameters Connector details. + * @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 linker of source and target resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LinkerResourceInner update( + String subscriptionId, + String resourceGroupName, + String location, + String connectorName, + LinkerPatch parameters, + Context context) { + return updateAsync(subscriptionId, resourceGroupName, location, connectorName, parameters, context).block(); + } + + /** + * Validate a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @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 validation operation result for a Linker along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateWithResponseAsync( + String subscriptionId, String resourceGroupName, String location, String connectorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (connectorName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .validate( + this.client.getEndpoint(), + subscriptionId, + resourceGroupName, + location, + connectorName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Validate a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of 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 validation operation result for a Linker along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateWithResponseAsync( + String subscriptionId, String resourceGroupName, String location, String connectorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (connectorName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .validate( + this.client.getEndpoint(), + subscriptionId, + resourceGroupName, + location, + connectorName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Validate a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @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 PollerFlux} for polling of the validation operation result for a Linker. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ValidateOperationResultInner> beginValidateAsync( + String subscriptionId, String resourceGroupName, String location, String connectorName) { + Mono>> mono = + validateWithResponseAsync(subscriptionId, resourceGroupName, location, connectorName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ValidateOperationResultInner.class, + ValidateOperationResultInner.class, + this.client.getContext()); + } + + /** + * Validate a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of 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 {@link PollerFlux} for polling of the validation operation result for a Linker. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ValidateOperationResultInner> beginValidateAsync( + String subscriptionId, String resourceGroupName, String location, String connectorName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + validateWithResponseAsync(subscriptionId, resourceGroupName, location, connectorName, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ValidateOperationResultInner.class, + ValidateOperationResultInner.class, + context); + } + + /** + * Validate a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @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 SyncPoller} for polling of the validation operation result for a Linker. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ValidateOperationResultInner> beginValidate( + String subscriptionId, String resourceGroupName, String location, String connectorName) { + return beginValidateAsync(subscriptionId, resourceGroupName, location, connectorName).getSyncPoller(); + } + + /** + * Validate a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of 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 {@link SyncPoller} for polling of the validation operation result for a Linker. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ValidateOperationResultInner> beginValidate( + String subscriptionId, String resourceGroupName, String location, String connectorName, Context context) { + return beginValidateAsync(subscriptionId, resourceGroupName, location, connectorName, context).getSyncPoller(); + } + + /** + * Validate a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @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 validation operation result for a Linker on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateAsync( + String subscriptionId, String resourceGroupName, String location, String connectorName) { + return beginValidateAsync(subscriptionId, resourceGroupName, location, connectorName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Validate a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of 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 validation operation result for a Linker on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateAsync( + String subscriptionId, String resourceGroupName, String location, String connectorName, Context context) { + return beginValidateAsync(subscriptionId, resourceGroupName, location, connectorName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Validate a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @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 validation operation result for a Linker. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidateOperationResultInner validate( + String subscriptionId, String resourceGroupName, String location, String connectorName) { + return validateAsync(subscriptionId, resourceGroupName, location, connectorName).block(); + } + + /** + * Validate a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of 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 validation operation result for a Linker. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidateOperationResultInner validate( + String subscriptionId, String resourceGroupName, String location, String connectorName, Context context) { + return validateAsync(subscriptionId, resourceGroupName, location, connectorName, context).block(); + } + + /** + * Generate configurations for a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @param parameters Connection Info, including format, secret store, etc. + * @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 configurations for source resource, include appSettings, connectionString and serviceBindings along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generateConfigurationsWithResponseAsync( + String subscriptionId, + String resourceGroupName, + String location, + String connectorName, + ConfigurationInfo parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (connectorName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .generateConfigurations( + this.client.getEndpoint(), + subscriptionId, + resourceGroupName, + location, + connectorName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generate configurations for a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @param parameters Connection Info, including format, secret store, etc. + * @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 configurations for source resource, include appSettings, connectionString and serviceBindings along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generateConfigurationsWithResponseAsync( + String subscriptionId, + String resourceGroupName, + String location, + String connectorName, + ConfigurationInfo parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (connectorName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .generateConfigurations( + this.client.getEndpoint(), + subscriptionId, + resourceGroupName, + location, + connectorName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Generate configurations for a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @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 configurations for source resource, include appSettings, connectionString and serviceBindings on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateConfigurationsAsync( + String subscriptionId, String resourceGroupName, String location, String connectorName) { + final ConfigurationInfo parameters = null; + return generateConfigurationsWithResponseAsync( + subscriptionId, resourceGroupName, location, connectorName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Generate configurations for a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @param parameters Connection Info, including format, secret store, etc. + * @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 configurations for source resource, include appSettings, connectionString and serviceBindings along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response generateConfigurationsWithResponse( + String subscriptionId, + String resourceGroupName, + String location, + String connectorName, + ConfigurationInfo parameters, + Context context) { + return generateConfigurationsWithResponseAsync( + subscriptionId, resourceGroupName, location, connectorName, parameters, context) + .block(); + } + + /** + * Generate configurations for a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @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 configurations for source resource, include appSettings, connectionString and serviceBindings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationResultInner generateConfigurations( + String subscriptionId, String resourceGroupName, String location, String connectorName) { + final ConfigurationInfo parameters = null; + return generateConfigurationsWithResponse( + subscriptionId, resourceGroupName, location, connectorName, parameters, Context.NONE) + .getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 dryrun along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDryrunNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + 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.listDryrunNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 dryrun along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDryrunNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + 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 + .listDryrunNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 Linker along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + 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.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 Linker along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + 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 + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ConnectorsImpl.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ConnectorsImpl.java new file mode 100644 index 000000000000..f2a159e70d7a --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ConnectorsImpl.java @@ -0,0 +1,475 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.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.servicelinker.fluent.ConnectorsClient; +import com.azure.resourcemanager.servicelinker.fluent.models.ConfigurationResultInner; +import com.azure.resourcemanager.servicelinker.fluent.models.DryrunResourceInner; +import com.azure.resourcemanager.servicelinker.fluent.models.LinkerResourceInner; +import com.azure.resourcemanager.servicelinker.fluent.models.ValidateOperationResultInner; +import com.azure.resourcemanager.servicelinker.models.ConfigurationInfo; +import com.azure.resourcemanager.servicelinker.models.ConfigurationResult; +import com.azure.resourcemanager.servicelinker.models.Connectors; +import com.azure.resourcemanager.servicelinker.models.DryrunResource; +import com.azure.resourcemanager.servicelinker.models.LinkerResource; +import com.azure.resourcemanager.servicelinker.models.ValidateOperationResult; + +public final class ConnectorsImpl implements Connectors { + private static final ClientLogger LOGGER = new ClientLogger(ConnectorsImpl.class); + + private final ConnectorsClient innerClient; + + private final com.azure.resourcemanager.servicelinker.ServiceLinkerManager serviceManager; + + public ConnectorsImpl( + ConnectorsClient innerClient, com.azure.resourcemanager.servicelinker.ServiceLinkerManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listDryrun(String subscriptionId, String resourceGroupName, String location) { + PagedIterable inner = + this.serviceClient().listDryrun(subscriptionId, resourceGroupName, location); + return Utils.mapPage(inner, inner1 -> new DryrunResourceImpl(inner1, this.manager())); + } + + public PagedIterable listDryrun( + String subscriptionId, String resourceGroupName, String location, Context context) { + PagedIterable inner = + this.serviceClient().listDryrun(subscriptionId, resourceGroupName, location, context); + return Utils.mapPage(inner, inner1 -> new DryrunResourceImpl(inner1, this.manager())); + } + + public Response getDryrunWithResponse( + String subscriptionId, String resourceGroupName, String location, String dryrunName, Context context) { + Response inner = + this + .serviceClient() + .getDryrunWithResponse(subscriptionId, resourceGroupName, location, dryrunName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DryrunResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DryrunResource getDryrun( + String subscriptionId, String resourceGroupName, String location, String dryrunName) { + DryrunResourceInner inner = + this.serviceClient().getDryrun(subscriptionId, resourceGroupName, location, dryrunName); + if (inner != null) { + return new DryrunResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteDryrunWithResponse( + String subscriptionId, String resourceGroupName, String location, String dryrunName, Context context) { + return this + .serviceClient() + .deleteDryrunWithResponse(subscriptionId, resourceGroupName, location, dryrunName, context); + } + + public void deleteDryrun(String subscriptionId, String resourceGroupName, String location, String dryrunName) { + this.serviceClient().deleteDryrun(subscriptionId, resourceGroupName, location, dryrunName); + } + + public PagedIterable list(String subscriptionId, String resourceGroupName, String location) { + PagedIterable inner = + this.serviceClient().list(subscriptionId, resourceGroupName, location); + return Utils.mapPage(inner, inner1 -> new LinkerResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String subscriptionId, String resourceGroupName, String location, Context context) { + PagedIterable inner = + this.serviceClient().list(subscriptionId, resourceGroupName, location, context); + return Utils.mapPage(inner, inner1 -> new LinkerResourceImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String subscriptionId, String resourceGroupName, String location, String connectorName, Context context) { + Response inner = + this.serviceClient().getWithResponse(subscriptionId, resourceGroupName, location, connectorName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LinkerResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public LinkerResource get(String subscriptionId, String resourceGroupName, String location, String connectorName) { + LinkerResourceInner inner = + this.serviceClient().get(subscriptionId, resourceGroupName, location, connectorName); + if (inner != null) { + return new LinkerResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String subscriptionId, String resourceGroupName, String location, String connectorName) { + this.serviceClient().delete(subscriptionId, resourceGroupName, location, connectorName); + } + + public void delete( + String subscriptionId, String resourceGroupName, String location, String connectorName, Context context) { + this.serviceClient().delete(subscriptionId, resourceGroupName, location, connectorName, context); + } + + public ValidateOperationResult validate( + String subscriptionId, String resourceGroupName, String location, String connectorName) { + ValidateOperationResultInner inner = + this.serviceClient().validate(subscriptionId, resourceGroupName, location, connectorName); + if (inner != null) { + return new ValidateOperationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ValidateOperationResult validate( + String subscriptionId, String resourceGroupName, String location, String connectorName, Context context) { + ValidateOperationResultInner inner = + this.serviceClient().validate(subscriptionId, resourceGroupName, location, connectorName, context); + if (inner != null) { + return new ValidateOperationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response generateConfigurationsWithResponse( + String subscriptionId, + String resourceGroupName, + String location, + String connectorName, + ConfigurationInfo parameters, + Context context) { + Response inner = + this + .serviceClient() + .generateConfigurationsWithResponse( + subscriptionId, resourceGroupName, location, connectorName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ConfigurationResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ConfigurationResult generateConfigurations( + String subscriptionId, String resourceGroupName, String location, String connectorName) { + ConfigurationResultInner inner = + this.serviceClient().generateConfigurations(subscriptionId, resourceGroupName, location, connectorName); + if (inner != null) { + return new ConfigurationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public DryrunResource getDryrunById(String id) { + String subscriptionId = Utils.getValueFromIdByName(id, "subscriptions"); + if (subscriptionId == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'subscriptions'.", 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 location = Utils.getValueFromIdByName(id, "locations"); + if (location == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); + } + String dryrunName = Utils.getValueFromIdByName(id, "dryruns"); + if (dryrunName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dryruns'.", id))); + } + return this + .getDryrunWithResponse(subscriptionId, resourceGroupName, location, dryrunName, Context.NONE) + .getValue(); + } + + public Response getDryrunByIdWithResponse(String id, Context context) { + String subscriptionId = Utils.getValueFromIdByName(id, "subscriptions"); + if (subscriptionId == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'subscriptions'.", 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 location = Utils.getValueFromIdByName(id, "locations"); + if (location == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); + } + String dryrunName = Utils.getValueFromIdByName(id, "dryruns"); + if (dryrunName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dryruns'.", id))); + } + return this.getDryrunWithResponse(subscriptionId, resourceGroupName, location, dryrunName, context); + } + + public LinkerResource getById(String id) { + String subscriptionId = Utils.getValueFromIdByName(id, "subscriptions"); + if (subscriptionId == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'subscriptions'.", 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 location = Utils.getValueFromIdByName(id, "locations"); + if (location == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); + } + String connectorName = Utils.getValueFromIdByName(id, "connectors"); + if (connectorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connectors'.", id))); + } + return this + .getWithResponse(subscriptionId, resourceGroupName, location, connectorName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String subscriptionId = Utils.getValueFromIdByName(id, "subscriptions"); + if (subscriptionId == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'subscriptions'.", 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 location = Utils.getValueFromIdByName(id, "locations"); + if (location == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); + } + String connectorName = Utils.getValueFromIdByName(id, "connectors"); + if (connectorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connectors'.", id))); + } + return this.getWithResponse(subscriptionId, resourceGroupName, location, connectorName, context); + } + + public void deleteDryrunById(String id) { + String subscriptionId = Utils.getValueFromIdByName(id, "subscriptions"); + if (subscriptionId == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'subscriptions'.", 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 location = Utils.getValueFromIdByName(id, "locations"); + if (location == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); + } + String dryrunName = Utils.getValueFromIdByName(id, "dryruns"); + if (dryrunName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dryruns'.", id))); + } + this.deleteDryrunWithResponse(subscriptionId, resourceGroupName, location, dryrunName, Context.NONE); + } + + public Response deleteDryrunByIdWithResponse(String id, Context context) { + String subscriptionId = Utils.getValueFromIdByName(id, "subscriptions"); + if (subscriptionId == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'subscriptions'.", 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 location = Utils.getValueFromIdByName(id, "locations"); + if (location == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); + } + String dryrunName = Utils.getValueFromIdByName(id, "dryruns"); + if (dryrunName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dryruns'.", id))); + } + return this.deleteDryrunWithResponse(subscriptionId, resourceGroupName, location, dryrunName, context); + } + + public void deleteById(String id) { + String subscriptionId = Utils.getValueFromIdByName(id, "subscriptions"); + if (subscriptionId == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'subscriptions'.", 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 location = Utils.getValueFromIdByName(id, "locations"); + if (location == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); + } + String connectorName = Utils.getValueFromIdByName(id, "connectors"); + if (connectorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connectors'.", id))); + } + this.delete(subscriptionId, resourceGroupName, location, connectorName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String subscriptionId = Utils.getValueFromIdByName(id, "subscriptions"); + if (subscriptionId == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'subscriptions'.", 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 location = Utils.getValueFromIdByName(id, "locations"); + if (location == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); + } + String connectorName = Utils.getValueFromIdByName(id, "connectors"); + if (connectorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connectors'.", id))); + } + this.delete(subscriptionId, resourceGroupName, location, connectorName, context); + } + + private ConnectorsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager() { + return this.serviceManager; + } + + public DryrunResourceImpl defineDryrun(String name) { + return new DryrunResourceImpl(name, this.manager()); + } + + public LinkerResourceImpl define(String name) { + return new LinkerResourceImpl(name, this.manager()); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/DryrunResourceImpl.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/DryrunResourceImpl.java new file mode 100644 index 000000000000..3daebc4a6ce2 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/DryrunResourceImpl.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicelinker.fluent.models.DryrunResourceInner; +import com.azure.resourcemanager.servicelinker.models.DryrunOperationPreview; +import com.azure.resourcemanager.servicelinker.models.DryrunParameters; +import com.azure.resourcemanager.servicelinker.models.DryrunPatch; +import com.azure.resourcemanager.servicelinker.models.DryrunPrerequisiteResult; +import com.azure.resourcemanager.servicelinker.models.DryrunResource; +import java.util.Collections; +import java.util.List; + +public final class DryrunResourceImpl implements DryrunResource, DryrunResource.Definition, DryrunResource.Update { + private DryrunResourceInner innerObject; + + private final com.azure.resourcemanager.servicelinker.ServiceLinkerManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public DryrunParameters parameters() { + return this.innerModel().parameters(); + } + + public List prerequisiteResults() { + List inner = this.innerModel().prerequisiteResults(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List operationPreviews() { + List inner = this.innerModel().operationPreviews(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public DryrunResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager() { + return this.serviceManager; + } + + private String subscriptionId; + + private String resourceGroupName; + + private String location; + + private String dryrunName; + + private DryrunPatch updateParameters; + + public DryrunResourceImpl withExistingLocation(String subscriptionId, String resourceGroupName, String location) { + this.subscriptionId = subscriptionId; + this.resourceGroupName = resourceGroupName; + this.location = location; + return this; + } + + public DryrunResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getConnectors() + .createDryrun(subscriptionId, resourceGroupName, location, dryrunName, this.innerModel(), Context.NONE); + return this; + } + + public DryrunResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConnectors() + .createDryrun(subscriptionId, resourceGroupName, location, dryrunName, this.innerModel(), context); + return this; + } + + DryrunResourceImpl(String name, com.azure.resourcemanager.servicelinker.ServiceLinkerManager serviceManager) { + this.innerObject = new DryrunResourceInner(); + this.serviceManager = serviceManager; + this.dryrunName = name; + } + + public DryrunResourceImpl update() { + this.updateParameters = new DryrunPatch(); + return this; + } + + public DryrunResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getConnectors() + .updateDryrun(subscriptionId, resourceGroupName, location, dryrunName, updateParameters, Context.NONE); + return this; + } + + public DryrunResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConnectors() + .updateDryrun(subscriptionId, resourceGroupName, location, dryrunName, updateParameters, context); + return this; + } + + DryrunResourceImpl( + DryrunResourceInner innerObject, com.azure.resourcemanager.servicelinker.ServiceLinkerManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.subscriptionId = Utils.getValueFromIdByName(innerObject.id(), "subscriptions"); + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourcegroups"); + this.location = Utils.getValueFromIdByName(innerObject.id(), "locations"); + this.dryrunName = Utils.getValueFromIdByName(innerObject.id(), "dryruns"); + } + + public DryrunResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getConnectors() + .getDryrunWithResponse(subscriptionId, resourceGroupName, location, dryrunName, Context.NONE) + .getValue(); + return this; + } + + public DryrunResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConnectors() + .getDryrunWithResponse(subscriptionId, resourceGroupName, location, dryrunName, context) + .getValue(); + return this; + } + + public DryrunResourceImpl withParameters(DryrunParameters parameters) { + if (isInCreateMode()) { + this.innerModel().withParameters(parameters); + return this; + } else { + this.updateParameters.withParameters(parameters); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkerResourceImpl.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkerResourceImpl.java index c8fff03eab9a..1e14717eb308 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkerResourceImpl.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkerResourceImpl.java @@ -10,10 +10,12 @@ import com.azure.resourcemanager.servicelinker.fluent.models.LinkerResourceInner; import com.azure.resourcemanager.servicelinker.models.AuthInfoBase; import com.azure.resourcemanager.servicelinker.models.ClientType; +import com.azure.resourcemanager.servicelinker.models.ConfigurationInfo; +import com.azure.resourcemanager.servicelinker.models.ConfigurationResult; import com.azure.resourcemanager.servicelinker.models.LinkerPatch; import com.azure.resourcemanager.servicelinker.models.LinkerResource; +import com.azure.resourcemanager.servicelinker.models.PublicNetworkSolution; import com.azure.resourcemanager.servicelinker.models.SecretStore; -import com.azure.resourcemanager.servicelinker.models.SourceConfigurationResult; import com.azure.resourcemanager.servicelinker.models.TargetServiceBase; import com.azure.resourcemanager.servicelinker.models.VNetSolution; import com.azure.resourcemanager.servicelinker.models.ValidateOperationResult; @@ -67,6 +69,18 @@ public String scope() { return this.innerModel().scope(); } + public PublicNetworkSolution publicNetworkSolution() { + return this.innerModel().publicNetworkSolution(); + } + + public ConfigurationInfo configurationInfo() { + return this.innerModel().configurationInfo(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + public LinkerResourceInner innerModel() { return this.innerObject; } @@ -75,14 +89,20 @@ private com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager() { return this.serviceManager; } - private String resourceUri; + private String subscriptionId; + + private String resourceGroupName; + + private String location; - private String linkerName; + private String connectorName; private LinkerPatch updateParameters; - public LinkerResourceImpl withExistingResourceUri(String resourceUri) { - this.resourceUri = resourceUri; + public LinkerResourceImpl withExistingLocation(String subscriptionId, String resourceGroupName, String location) { + this.subscriptionId = subscriptionId; + this.resourceGroupName = resourceGroupName; + this.location = location; return this; } @@ -90,8 +110,9 @@ public LinkerResource create() { this.innerObject = serviceManager .serviceClient() - .getLinkers() - .createOrUpdate(resourceUri, linkerName, this.innerModel(), Context.NONE); + .getConnectors() + .createOrUpdate( + subscriptionId, resourceGroupName, location, connectorName, this.innerModel(), Context.NONE); return this; } @@ -99,15 +120,15 @@ public LinkerResource create(Context context) { this.innerObject = serviceManager .serviceClient() - .getLinkers() - .createOrUpdate(resourceUri, linkerName, this.innerModel(), context); + .getConnectors() + .createOrUpdate(subscriptionId, resourceGroupName, location, connectorName, this.innerModel(), context); return this; } LinkerResourceImpl(String name, com.azure.resourcemanager.servicelinker.ServiceLinkerManager serviceManager) { this.innerObject = new LinkerResourceInner(); this.serviceManager = serviceManager; - this.linkerName = name; + this.connectorName = name; } public LinkerResourceImpl update() { @@ -117,13 +138,19 @@ public LinkerResourceImpl update() { public LinkerResource apply() { this.innerObject = - serviceManager.serviceClient().getLinkers().update(resourceUri, linkerName, updateParameters, Context.NONE); + serviceManager + .serviceClient() + .getConnectors() + .update(subscriptionId, resourceGroupName, location, connectorName, updateParameters, Context.NONE); return this; } public LinkerResource apply(Context context) { this.innerObject = - serviceManager.serviceClient().getLinkers().update(resourceUri, linkerName, updateParameters, context); + serviceManager + .serviceClient() + .getConnectors() + .update(subscriptionId, resourceGroupName, location, connectorName, updateParameters, context); return this; } @@ -131,50 +158,54 @@ public LinkerResource apply(Context context) { LinkerResourceInner innerObject, com.azure.resourcemanager.servicelinker.ServiceLinkerManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceUri = - Utils - .getValueFromIdByParameterName( - innerObject.id(), - "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", - "resourceUri"); - this.linkerName = - Utils - .getValueFromIdByParameterName( - innerObject.id(), - "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", - "linkerName"); + this.subscriptionId = Utils.getValueFromIdByName(innerObject.id(), "subscriptions"); + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourcegroups"); + this.location = Utils.getValueFromIdByName(innerObject.id(), "locations"); + this.connectorName = Utils.getValueFromIdByName(innerObject.id(), "connectors"); } public LinkerResource refresh() { this.innerObject = serviceManager .serviceClient() - .getLinkers() - .getWithResponse(resourceUri, linkerName, Context.NONE) + .getConnectors() + .getWithResponse(subscriptionId, resourceGroupName, location, connectorName, Context.NONE) .getValue(); return this; } public LinkerResource refresh(Context context) { this.innerObject = - serviceManager.serviceClient().getLinkers().getWithResponse(resourceUri, linkerName, context).getValue(); + serviceManager + .serviceClient() + .getConnectors() + .getWithResponse(subscriptionId, resourceGroupName, location, connectorName, context) + .getValue(); return this; } public ValidateOperationResult validate() { - return serviceManager.linkers().validate(resourceUri, linkerName); + return serviceManager.connectors().validate(subscriptionId, resourceGroupName, location, connectorName); } public ValidateOperationResult validate(Context context) { - return serviceManager.linkers().validate(resourceUri, linkerName, context); + return serviceManager + .connectors() + .validate(subscriptionId, resourceGroupName, location, connectorName, context); } - public SourceConfigurationResult listConfigurations() { - return serviceManager.linkers().listConfigurations(resourceUri, linkerName); + public Response generateConfigurationsWithResponse( + ConfigurationInfo parameters, Context context) { + return serviceManager + .connectors() + .generateConfigurationsWithResponse( + subscriptionId, resourceGroupName, location, connectorName, parameters, context); } - public Response listConfigurationsWithResponse(Context context) { - return serviceManager.linkers().listConfigurationsWithResponse(resourceUri, linkerName, context); + public ConfigurationResult generateConfigurations() { + return serviceManager + .connectors() + .generateConfigurations(subscriptionId, resourceGroupName, location, connectorName); } public LinkerResourceImpl withTargetService(TargetServiceBase targetService) { @@ -237,6 +268,26 @@ public LinkerResourceImpl withScope(String scope) { } } + public LinkerResourceImpl withPublicNetworkSolution(PublicNetworkSolution publicNetworkSolution) { + if (isInCreateMode()) { + this.innerModel().withPublicNetworkSolution(publicNetworkSolution); + return this; + } else { + this.updateParameters.withPublicNetworkSolution(publicNetworkSolution); + return this; + } + } + + public LinkerResourceImpl withConfigurationInfo(ConfigurationInfo configurationInfo) { + if (isInCreateMode()) { + this.innerModel().withConfigurationInfo(configurationInfo); + return this; + } else { + this.updateParameters.withConfigurationInfo(configurationInfo); + return this; + } + } + private boolean isInCreateMode() { return this.innerModel().id() == null; } diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkersClientImpl.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkersClientImpl.java index 033bdccd2382..44b916c0d6db 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkersClientImpl.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkersClientImpl.java @@ -34,11 +34,11 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.servicelinker.fluent.LinkersClient; +import com.azure.resourcemanager.servicelinker.fluent.models.ConfigurationResultInner; import com.azure.resourcemanager.servicelinker.fluent.models.LinkerResourceInner; -import com.azure.resourcemanager.servicelinker.fluent.models.SourceConfigurationResultInner; import com.azure.resourcemanager.servicelinker.fluent.models.ValidateOperationResultInner; -import com.azure.resourcemanager.servicelinker.models.LinkerList; import com.azure.resourcemanager.servicelinker.models.LinkerPatch; +import com.azure.resourcemanager.servicelinker.models.ResourceList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -67,12 +67,12 @@ public final class LinkersClientImpl implements LinkersClient { */ @Host("{$host}") @ServiceInterface(name = "ServiceLinkerManagem") - private interface LinkersService { + public interface LinkersService { @Headers({"Content-Type: application/json"}) @Get("/{resourceUri}/providers/Microsoft.ServiceLinker/linkers") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( + Mono> list( @HostParam("$host") String endpoint, @PathParam(value = "resourceUri", encoded = true) String resourceUri, @QueryParam("api-version") String apiVersion, @@ -145,7 +145,7 @@ Mono>> validate( @Post("/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/listConfigurations") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listConfigurations( + Mono> listConfigurations( @HostParam("$host") String endpoint, @PathParam(value = "resourceUri", encoded = true) String resourceUri, @QueryParam("api-version") String apiVersion, @@ -157,7 +157,7 @@ Mono> listConfigurations( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( + Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -165,7 +165,8 @@ Mono> listNext( } /** - * Returns list of Linkers which connects to the resource. + * Returns list of Linkers which connects to the resource. which supports to config both application and target + * service during the resource provision. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -202,7 +203,8 @@ private Mono> listSinglePageAsync(String reso } /** - * Returns list of Linkers which connects to the resource. + * Returns list of Linkers which connects to the resource. which supports to config both application and target + * service during the resource provision. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param context The context to associate with this operation. @@ -238,7 +240,8 @@ private Mono> listSinglePageAsync(String reso } /** - * Returns list of Linkers which connects to the resource. + * Returns list of Linkers which connects to the resource. which supports to config both application and target + * service during the resource provision. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -252,7 +255,8 @@ private PagedFlux listAsync(String resourceUri) { } /** - * Returns list of Linkers which connects to the resource. + * Returns list of Linkers which connects to the resource. which supports to config both application and target + * service during the resource provision. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param context The context to associate with this operation. @@ -268,7 +272,8 @@ private PagedFlux listAsync(String resourceUri, Context con } /** - * Returns list of Linkers which connects to the resource. + * Returns list of Linkers which connects to the resource. which supports to config both application and target + * service during the resource provision. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -282,7 +287,8 @@ public PagedIterable list(String resourceUri) { } /** - * Returns list of Linkers which connects to the resource. + * Returns list of Linkers which connects to the resource. which supports to config both application and target + * service during the resource provision. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param context The context to associate with this operation. @@ -389,14 +395,15 @@ private Mono getAsync(String resourceUri, String linkerName * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker 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 linker of source and target resource. + * @return linker of source and target resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public LinkerResourceInner get(String resourceUri, String linkerName) { - return getAsync(resourceUri, linkerName).block(); + public Response getWithResponse(String resourceUri, String linkerName, Context context) { + return getWithResponseAsync(resourceUri, linkerName, context).block(); } /** @@ -404,19 +411,18 @@ public LinkerResourceInner get(String resourceUri, String linkerName) { * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker 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 linker of source and target resource along with {@link Response}. + * @return linker of source and target resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceUri, String linkerName, Context context) { - return getWithResponseAsync(resourceUri, linkerName, context).block(); + public LinkerResourceInner get(String resourceUri, String linkerName) { + return getWithResponse(resourceUri, linkerName, Context.NONE).getValue(); } /** - * Create or update linker resource. + * Create or update Linker resource. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -464,7 +470,7 @@ private Mono>> createOrUpdateWithResponseAsync( } /** - * Create or update linker resource. + * Create or update Linker resource. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -510,7 +516,7 @@ private Mono>> createOrUpdateWithResponseAsync( } /** - * Create or update linker resource. + * Create or update Linker resource. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -535,7 +541,7 @@ private PollerFlux, LinkerResourceInner> beginCr } /** - * Create or update linker resource. + * Create or update Linker resource. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -559,7 +565,7 @@ private PollerFlux, LinkerResourceInner> beginCr } /** - * Create or update linker resource. + * Create or update Linker resource. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -576,7 +582,7 @@ public SyncPoller, LinkerResourceInner> beginCre } /** - * Create or update linker resource. + * Create or update Linker resource. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -594,7 +600,7 @@ public SyncPoller, LinkerResourceInner> beginCre } /** - * Create or update linker resource. + * Create or update Linker resource. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -613,7 +619,7 @@ private Mono createOrUpdateAsync( } /** - * Create or update linker resource. + * Create or update Linker resource. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -633,7 +639,7 @@ private Mono createOrUpdateAsync( } /** - * Create or update linker resource. + * Create or update Linker resource. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -649,7 +655,7 @@ public LinkerResourceInner createOrUpdate(String resourceUri, String linkerName, } /** - * Create or update linker resource. + * Create or update Linker resource. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -667,7 +673,7 @@ public LinkerResourceInner createOrUpdate( } /** - * Delete a link. + * Delete a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -706,7 +712,7 @@ private Mono>> deleteWithResponseAsync(String resource } /** - * Delete a link. + * Delete a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -738,7 +744,7 @@ private Mono>> deleteWithResponseAsync( } /** - * Delete a link. + * Delete a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -757,7 +763,7 @@ private PollerFlux, Void> beginDeleteAsync(String resourceUri, } /** - * Delete a link. + * Delete a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -778,7 +784,7 @@ private PollerFlux, Void> beginDeleteAsync( } /** - * Delete a link. + * Delete a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -793,7 +799,7 @@ public SyncPoller, Void> beginDelete(String resourceUri, String } /** - * Delete a link. + * Delete a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -809,7 +815,7 @@ public SyncPoller, Void> beginDelete(String resourceUri, String } /** - * Delete a link. + * Delete a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -824,7 +830,7 @@ private Mono deleteAsync(String resourceUri, String linkerName) { } /** - * Delete a link. + * Delete a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -840,7 +846,7 @@ private Mono deleteAsync(String resourceUri, String linkerName, Context co } /** - * Delete a link. + * Delete a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -854,7 +860,7 @@ public void delete(String resourceUri, String linkerName) { } /** - * Delete a link. + * Delete a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -869,7 +875,7 @@ public void delete(String resourceUri, String linkerName, Context context) { } /** - * Operation to update an existing link. + * Operation to update an existing Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -917,7 +923,7 @@ private Mono>> updateWithResponseAsync( } /** - * Operation to update an existing link. + * Operation to update an existing Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -963,7 +969,7 @@ private Mono>> updateWithResponseAsync( } /** - * Operation to update an existing link. + * Operation to update an existing Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -988,7 +994,7 @@ private PollerFlux, LinkerResourceInner> beginUp } /** - * Operation to update an existing link. + * Operation to update an existing Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -1011,7 +1017,7 @@ private PollerFlux, LinkerResourceInner> beginUp } /** - * Operation to update an existing link. + * Operation to update an existing Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -1028,7 +1034,7 @@ public SyncPoller, LinkerResourceInner> beginUpd } /** - * Operation to update an existing link. + * Operation to update an existing Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -1046,7 +1052,7 @@ public SyncPoller, LinkerResourceInner> beginUpd } /** - * Operation to update an existing link. + * Operation to update an existing Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -1064,7 +1070,7 @@ private Mono updateAsync(String resourceUri, String linkerN } /** - * Operation to update an existing link. + * Operation to update an existing Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -1084,7 +1090,7 @@ private Mono updateAsync( } /** - * Operation to update an existing link. + * Operation to update an existing Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -1100,7 +1106,7 @@ public LinkerResourceInner update(String resourceUri, String linkerName, LinkerP } /** - * Operation to update an existing link. + * Operation to update an existing Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -1117,14 +1123,14 @@ public LinkerResourceInner update(String resourceUri, String linkerName, LinkerP } /** - * Validate a link. + * Validate a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. * @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 validation operation result for a linker along with {@link Response} on successful completion of + * @return the validation operation result for a Linker along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -1157,7 +1163,7 @@ private Mono>> validateWithResponseAsync(String resour } /** - * Validate a link. + * Validate a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -1165,7 +1171,7 @@ private Mono>> validateWithResponseAsync(String resour * @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 validation operation result for a linker along with {@link Response} on successful completion of + * @return the validation operation result for a Linker along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -1190,14 +1196,14 @@ private Mono>> validateWithResponseAsync( } /** - * Validate a link. + * Validate a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. * @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 PollerFlux} for polling of the validation operation result for a linker. + * @return the {@link PollerFlux} for polling of the validation operation result for a Linker. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ValidateOperationResultInner> beginValidateAsync( @@ -1214,7 +1220,7 @@ private PollerFlux, ValidateOperationRe } /** - * Validate a link. + * Validate a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -1222,7 +1228,7 @@ private PollerFlux, ValidateOperationRe * @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 PollerFlux} for polling of the validation operation result for a linker. + * @return the {@link PollerFlux} for polling of the validation operation result for a Linker. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ValidateOperationResultInner> beginValidateAsync( @@ -1240,14 +1246,14 @@ private PollerFlux, ValidateOperationRe } /** - * Validate a link. + * Validate a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. * @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 SyncPoller} for polling of the validation operation result for a linker. + * @return the {@link SyncPoller} for polling of the validation operation result for a Linker. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ValidateOperationResultInner> beginValidate( @@ -1256,7 +1262,7 @@ public SyncPoller, ValidateOperationRes } /** - * Validate a link. + * Validate a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -1264,7 +1270,7 @@ public SyncPoller, ValidateOperationRes * @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 SyncPoller} for polling of the validation operation result for a linker. + * @return the {@link SyncPoller} for polling of the validation operation result for a Linker. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ValidateOperationResultInner> beginValidate( @@ -1273,14 +1279,14 @@ public SyncPoller, ValidateOperationRes } /** - * Validate a link. + * Validate a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. * @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 validation operation result for a linker on successful completion of {@link Mono}. + * @return the validation operation result for a Linker on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono validateAsync(String resourceUri, String linkerName) { @@ -1288,7 +1294,7 @@ private Mono validateAsync(String resourceUri, Str } /** - * Validate a link. + * Validate a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -1296,7 +1302,7 @@ private Mono validateAsync(String resourceUri, Str * @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 validation operation result for a linker on successful completion of {@link Mono}. + * @return the validation operation result for a Linker on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono validateAsync(String resourceUri, String linkerName, Context context) { @@ -1306,14 +1312,14 @@ private Mono validateAsync(String resourceUri, Str } /** - * Validate a link. + * Validate a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. * @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 validation operation result for a linker. + * @return the validation operation result for a Linker. */ @ServiceMethod(returns = ReturnType.SINGLE) public ValidateOperationResultInner validate(String resourceUri, String linkerName) { @@ -1321,7 +1327,7 @@ public ValidateOperationResultInner validate(String resourceUri, String linkerNa } /** - * Validate a link. + * Validate a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -1329,7 +1335,7 @@ public ValidateOperationResultInner validate(String resourceUri, String linkerNa * @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 validation operation result for a linker. + * @return the validation operation result for a Linker. */ @ServiceMethod(returns = ReturnType.SINGLE) public ValidateOperationResultInner validate(String resourceUri, String linkerName, Context context) { @@ -1337,7 +1343,7 @@ public ValidateOperationResultInner validate(String resourceUri, String linkerNa } /** - * list source configurations for a linker. + * list source configurations for a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -1348,7 +1354,7 @@ public ValidateOperationResultInner validate(String resourceUri, String linkerNa * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listConfigurationsWithResponseAsync( + private Mono> listConfigurationsWithResponseAsync( String resourceUri, String linkerName) { if (this.client.getEndpoint() == null) { return Mono @@ -1378,7 +1384,7 @@ private Mono> listConfigurationsWithRes } /** - * list source configurations for a linker. + * list source configurations for a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -1390,7 +1396,7 @@ private Mono> listConfigurationsWithRes * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listConfigurationsWithResponseAsync( + private Mono> listConfigurationsWithResponseAsync( String resourceUri, String linkerName, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -1412,7 +1418,7 @@ private Mono> listConfigurationsWithRes } /** - * list source configurations for a linker. + * list source configurations for a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -1423,48 +1429,49 @@ private Mono> listConfigurationsWithRes * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listConfigurationsAsync(String resourceUri, String linkerName) { + private Mono listConfigurationsAsync(String resourceUri, String linkerName) { return listConfigurationsWithResponseAsync(resourceUri, linkerName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * list source configurations for a linker. + * list source configurations for a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker 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 configurations for source resource, include appSettings, connectionString and serviceBindings. + * @return configurations for source resource, include appSettings, connectionString and serviceBindings along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SourceConfigurationResultInner listConfigurations(String resourceUri, String linkerName) { - return listConfigurationsAsync(resourceUri, linkerName).block(); + public Response listConfigurationsWithResponse( + String resourceUri, String linkerName, Context context) { + return listConfigurationsWithResponseAsync(resourceUri, linkerName, context).block(); } /** - * list source configurations for a linker. + * list source configurations for a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker 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 configurations for source resource, include appSettings, connectionString and serviceBindings along with - * {@link Response}. + * @return configurations for source resource, include appSettings, connectionString and serviceBindings. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listConfigurationsWithResponse( - String resourceUri, String linkerName, Context context) { - return listConfigurationsWithResponseAsync(resourceUri, linkerName, context).block(); + public ConfigurationResultInner listConfigurations(String resourceUri, String linkerName) { + return listConfigurationsWithResponse(resourceUri, linkerName, Context.NONE).getValue(); } /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @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. @@ -1499,7 +1506,8 @@ private Mono> listNextSinglePageAsync(String /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @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. diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkersImpl.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkersImpl.java index 75322fa6ef05..8f2bf5117d38 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkersImpl.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkersImpl.java @@ -10,12 +10,13 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.servicelinker.fluent.LinkersClient; +import com.azure.resourcemanager.servicelinker.fluent.models.ConfigurationResultInner; import com.azure.resourcemanager.servicelinker.fluent.models.LinkerResourceInner; -import com.azure.resourcemanager.servicelinker.fluent.models.SourceConfigurationResultInner; import com.azure.resourcemanager.servicelinker.fluent.models.ValidateOperationResultInner; +import com.azure.resourcemanager.servicelinker.models.ConfigurationResult; +import com.azure.resourcemanager.servicelinker.models.LinkerPatch; import com.azure.resourcemanager.servicelinker.models.LinkerResource; import com.azure.resourcemanager.servicelinker.models.Linkers; -import com.azure.resourcemanager.servicelinker.models.SourceConfigurationResult; import com.azure.resourcemanager.servicelinker.models.ValidateOperationResult; public final class LinkersImpl implements Linkers { @@ -41,6 +42,19 @@ public PagedIterable list(String resourceUri, Context context) { return Utils.mapPage(inner, inner1 -> new LinkerResourceImpl(inner1, this.manager())); } + public Response getWithResponse(String resourceUri, String linkerName, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceUri, linkerName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LinkerResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + public LinkerResource get(String resourceUri, String linkerName) { LinkerResourceInner inner = this.serviceClient().get(resourceUri, linkerName); if (inner != null) { @@ -50,14 +64,20 @@ public LinkerResource get(String resourceUri, String linkerName) { } } - public Response getWithResponse(String resourceUri, String linkerName, Context context) { - Response inner = this.serviceClient().getWithResponse(resourceUri, linkerName, context); + public LinkerResource createOrUpdate(String resourceUri, String linkerName, LinkerResourceInner parameters) { + LinkerResourceInner inner = this.serviceClient().createOrUpdate(resourceUri, linkerName, parameters); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new LinkerResourceImpl(inner.getValue(), this.manager())); + return new LinkerResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public LinkerResource createOrUpdate( + String resourceUri, String linkerName, LinkerResourceInner parameters, Context context) { + LinkerResourceInner inner = this.serviceClient().createOrUpdate(resourceUri, linkerName, parameters, context); + if (inner != null) { + return new LinkerResourceImpl(inner, this.manager()); } else { return null; } @@ -71,17 +91,26 @@ public void delete(String resourceUri, String linkerName, Context context) { this.serviceClient().delete(resourceUri, linkerName, context); } - public ValidateOperationResult validate(String resourceUri, String linkerName) { - ValidateOperationResultInner inner = this.serviceClient().validate(resourceUri, linkerName); + public LinkerResource update(String resourceUri, String linkerName, LinkerPatch parameters) { + LinkerResourceInner inner = this.serviceClient().update(resourceUri, linkerName, parameters); if (inner != null) { - return new ValidateOperationResultImpl(inner, this.manager()); + return new LinkerResourceImpl(inner, this.manager()); } else { return null; } } - public ValidateOperationResult validate(String resourceUri, String linkerName, Context context) { - ValidateOperationResultInner inner = this.serviceClient().validate(resourceUri, linkerName, context); + public LinkerResource update(String resourceUri, String linkerName, LinkerPatch parameters, Context context) { + LinkerResourceInner inner = this.serviceClient().update(resourceUri, linkerName, parameters, context); + if (inner != null) { + return new LinkerResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public ValidateOperationResult validate(String resourceUri, String linkerName) { + ValidateOperationResultInner inner = this.serviceClient().validate(resourceUri, linkerName); if (inner != null) { return new ValidateOperationResultImpl(inner, this.manager()); } else { @@ -89,124 +118,37 @@ public ValidateOperationResult validate(String resourceUri, String linkerName, C } } - public SourceConfigurationResult listConfigurations(String resourceUri, String linkerName) { - SourceConfigurationResultInner inner = this.serviceClient().listConfigurations(resourceUri, linkerName); + public ValidateOperationResult validate(String resourceUri, String linkerName, Context context) { + ValidateOperationResultInner inner = this.serviceClient().validate(resourceUri, linkerName, context); if (inner != null) { - return new SourceConfigurationResultImpl(inner, this.manager()); + return new ValidateOperationResultImpl(inner, this.manager()); } else { return null; } } - public Response listConfigurationsWithResponse( + public Response listConfigurationsWithResponse( String resourceUri, String linkerName, Context context) { - Response inner = + Response inner = this.serviceClient().listConfigurationsWithResponse(resourceUri, linkerName, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SourceConfigurationResultImpl(inner.getValue(), this.manager())); + new ConfigurationResultImpl(inner.getValue(), this.manager())); } else { return null; } } - public LinkerResource getById(String id) { - String resourceUri = - Utils - .getValueFromIdByParameterName( - id, "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", "resourceUri"); - if (resourceUri == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceUri'.", id))); - } - String linkerName = - Utils - .getValueFromIdByParameterName( - id, "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", "linkerName"); - if (linkerName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'linkers'.", id))); - } - return this.getWithResponse(resourceUri, linkerName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceUri = - Utils - .getValueFromIdByParameterName( - id, "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", "resourceUri"); - if (resourceUri == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceUri'.", id))); - } - String linkerName = - Utils - .getValueFromIdByParameterName( - id, "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", "linkerName"); - if (linkerName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'linkers'.", id))); - } - return this.getWithResponse(resourceUri, linkerName, context); - } - - public void deleteById(String id) { - String resourceUri = - Utils - .getValueFromIdByParameterName( - id, "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", "resourceUri"); - if (resourceUri == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceUri'.", id))); - } - String linkerName = - Utils - .getValueFromIdByParameterName( - id, "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", "linkerName"); - if (linkerName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'linkers'.", id))); - } - this.delete(resourceUri, linkerName, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { - String resourceUri = - Utils - .getValueFromIdByParameterName( - id, "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", "resourceUri"); - if (resourceUri == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceUri'.", id))); - } - String linkerName = - Utils - .getValueFromIdByParameterName( - id, "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", "linkerName"); - if (linkerName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'linkers'.", id))); + public ConfigurationResult listConfigurations(String resourceUri, String linkerName) { + ConfigurationResultInner inner = this.serviceClient().listConfigurations(resourceUri, linkerName); + if (inner != null) { + return new ConfigurationResultImpl(inner, this.manager()); + } else { + return null; } - this.delete(resourceUri, linkerName, context); } private LinkersClient serviceClient() { @@ -216,8 +158,4 @@ private LinkersClient serviceClient() { private com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager() { return this.serviceManager; } - - public LinkerResourceImpl define(String name) { - return new LinkerResourceImpl(name, this.manager()); - } } diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkersOperationsClientImpl.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkersOperationsClientImpl.java new file mode 100644 index 000000000000..095c7f03f42b --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkersOperationsClientImpl.java @@ -0,0 +1,1239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.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.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.servicelinker.fluent.LinkersOperationsClient; +import com.azure.resourcemanager.servicelinker.fluent.models.ConfigurationResultInner; +import com.azure.resourcemanager.servicelinker.fluent.models.DryrunResourceInner; +import com.azure.resourcemanager.servicelinker.models.ConfigurationInfo; +import com.azure.resourcemanager.servicelinker.models.DryrunList; +import com.azure.resourcemanager.servicelinker.models.DryrunPatch; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LinkersOperationsClient. */ +public final class LinkersOperationsClientImpl implements LinkersOperationsClient { + /** The proxy service used to perform REST calls. */ + private final LinkersOperationsService service; + + /** The service client containing this operation class. */ + private final ServiceLinkerManagementClientImpl client; + + /** + * Initializes an instance of LinkersOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LinkersOperationsClientImpl(ServiceLinkerManagementClientImpl client) { + this.service = + RestProxy.create(LinkersOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceLinkerManagementClientLinkersOperations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceLinkerManagem") + public interface LinkersOperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/{resourceUri}/providers/Microsoft.ServiceLinker/dryruns") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listDryrun( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getDryrun( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, + @PathParam("dryrunName") String dryrunName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put("/{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createDryrun( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, + @PathParam("dryrunName") String dryrunName, + @BodyParam("application/json") DryrunResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch("/{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateDryrun( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, + @PathParam("dryrunName") String dryrunName, + @BodyParam("application/json") DryrunPatch parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete("/{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deleteDryrun( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, + @PathParam("dryrunName") String dryrunName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/generateConfigurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> generateConfigurations( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, + @PathParam("linkerName") String linkerName, + @BodyParam("application/json") ConfigurationInfo parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listDryrunNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * list dryrun jobs. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @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 dryrun along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDryrunSinglePageAsync(String resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listDryrun( + this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * list dryrun jobs. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @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 dryrun along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDryrunSinglePageAsync(String resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listDryrun(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * list dryrun jobs. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @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 dryrun as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listDryrunAsync(String resourceUri) { + return new PagedFlux<>( + () -> listDryrunSinglePageAsync(resourceUri), nextLink -> listDryrunNextSinglePageAsync(nextLink)); + } + + /** + * list dryrun jobs. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @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 dryrun as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listDryrunAsync(String resourceUri, Context context) { + return new PagedFlux<>( + () -> listDryrunSinglePageAsync(resourceUri, context), + nextLink -> listDryrunNextSinglePageAsync(nextLink, context)); + } + + /** + * list dryrun jobs. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @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 dryrun as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDryrun(String resourceUri) { + return new PagedIterable<>(listDryrunAsync(resourceUri)); + } + + /** + * list dryrun jobs. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @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 dryrun as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDryrun(String resourceUri, Context context) { + return new PagedIterable<>(listDryrunAsync(resourceUri, context)); + } + + /** + * get a dryrun job. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @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 dryrun job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDryrunWithResponseAsync(String resourceUri, String dryrunName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (dryrunName == null) { + return Mono.error(new IllegalArgumentException("Parameter dryrunName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getDryrun( + this.client.getEndpoint(), + resourceUri, + this.client.getApiVersion(), + dryrunName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * get a dryrun job. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @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 a dryrun job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDryrunWithResponseAsync( + String resourceUri, String dryrunName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (dryrunName == null) { + return Mono.error(new IllegalArgumentException("Parameter dryrunName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getDryrun( + this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), dryrunName, accept, context); + } + + /** + * get a dryrun job. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @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 dryrun job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getDryrunAsync(String resourceUri, String dryrunName) { + return getDryrunWithResponseAsync(resourceUri, dryrunName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * get a dryrun job. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @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 a dryrun job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDryrunWithResponse(String resourceUri, String dryrunName, Context context) { + return getDryrunWithResponseAsync(resourceUri, dryrunName, context).block(); + } + + /** + * get a dryrun job. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @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 dryrun job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DryrunResourceInner getDryrun(String resourceUri, String dryrunName) { + return getDryrunWithResponse(resourceUri, dryrunName, Context.NONE).getValue(); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @param parameters dryrun resource. + * @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 dryrun job resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createDryrunWithResponseAsync( + String resourceUri, String dryrunName, DryrunResourceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (dryrunName == null) { + return Mono.error(new IllegalArgumentException("Parameter dryrunName 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 + .createDryrun( + this.client.getEndpoint(), + resourceUri, + this.client.getApiVersion(), + dryrunName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @param parameters dryrun 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 a dryrun job resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createDryrunWithResponseAsync( + String resourceUri, String dryrunName, DryrunResourceInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (dryrunName == null) { + return Mono.error(new IllegalArgumentException("Parameter dryrunName 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 + .createDryrun( + this.client.getEndpoint(), + resourceUri, + this.client.getApiVersion(), + dryrunName, + parameters, + accept, + context); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @param parameters dryrun resource. + * @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 PollerFlux} for polling of a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DryrunResourceInner> beginCreateDryrunAsync( + String resourceUri, String dryrunName, DryrunResourceInner parameters) { + Mono>> mono = createDryrunWithResponseAsync(resourceUri, dryrunName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DryrunResourceInner.class, + DryrunResourceInner.class, + this.client.getContext()); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @param parameters dryrun 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 {@link PollerFlux} for polling of a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DryrunResourceInner> beginCreateDryrunAsync( + String resourceUri, String dryrunName, DryrunResourceInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createDryrunWithResponseAsync(resourceUri, dryrunName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DryrunResourceInner.class, DryrunResourceInner.class, context); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @param parameters dryrun resource. + * @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 SyncPoller} for polling of a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DryrunResourceInner> beginCreateDryrun( + String resourceUri, String dryrunName, DryrunResourceInner parameters) { + return beginCreateDryrunAsync(resourceUri, dryrunName, parameters).getSyncPoller(); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @param parameters dryrun 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 {@link SyncPoller} for polling of a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DryrunResourceInner> beginCreateDryrun( + String resourceUri, String dryrunName, DryrunResourceInner parameters, Context context) { + return beginCreateDryrunAsync(resourceUri, dryrunName, parameters, context).getSyncPoller(); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @param parameters dryrun resource. + * @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 dryrun job resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createDryrunAsync( + String resourceUri, String dryrunName, DryrunResourceInner parameters) { + return beginCreateDryrunAsync(resourceUri, dryrunName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @param parameters dryrun 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 a dryrun job resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createDryrunAsync( + String resourceUri, String dryrunName, DryrunResourceInner parameters, Context context) { + return beginCreateDryrunAsync(resourceUri, dryrunName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @param parameters dryrun resource. + * @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 dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DryrunResourceInner createDryrun(String resourceUri, String dryrunName, DryrunResourceInner parameters) { + return createDryrunAsync(resourceUri, dryrunName, parameters).block(); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @param parameters dryrun 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 a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DryrunResourceInner createDryrun( + String resourceUri, String dryrunName, DryrunResourceInner parameters, Context context) { + return createDryrunAsync(resourceUri, dryrunName, parameters, context).block(); + } + + /** + * add a dryrun job to do necessary check before actual creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @param parameters dryrun resource. + * @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 dryrun job resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateDryrunWithResponseAsync( + String resourceUri, String dryrunName, DryrunPatch parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (dryrunName == null) { + return Mono.error(new IllegalArgumentException("Parameter dryrunName 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 + .updateDryrun( + this.client.getEndpoint(), + resourceUri, + this.client.getApiVersion(), + dryrunName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * add a dryrun job to do necessary check before actual creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @param parameters dryrun 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 a dryrun job resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateDryrunWithResponseAsync( + String resourceUri, String dryrunName, DryrunPatch parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (dryrunName == null) { + return Mono.error(new IllegalArgumentException("Parameter dryrunName 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 + .updateDryrun( + this.client.getEndpoint(), + resourceUri, + this.client.getApiVersion(), + dryrunName, + parameters, + accept, + context); + } + + /** + * add a dryrun job to do necessary check before actual creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @param parameters dryrun resource. + * @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 PollerFlux} for polling of a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DryrunResourceInner> beginUpdateDryrunAsync( + String resourceUri, String dryrunName, DryrunPatch parameters) { + Mono>> mono = updateDryrunWithResponseAsync(resourceUri, dryrunName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DryrunResourceInner.class, + DryrunResourceInner.class, + this.client.getContext()); + } + + /** + * add a dryrun job to do necessary check before actual creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @param parameters dryrun 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 {@link PollerFlux} for polling of a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DryrunResourceInner> beginUpdateDryrunAsync( + String resourceUri, String dryrunName, DryrunPatch parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateDryrunWithResponseAsync(resourceUri, dryrunName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DryrunResourceInner.class, DryrunResourceInner.class, context); + } + + /** + * add a dryrun job to do necessary check before actual creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @param parameters dryrun resource. + * @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 SyncPoller} for polling of a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DryrunResourceInner> beginUpdateDryrun( + String resourceUri, String dryrunName, DryrunPatch parameters) { + return beginUpdateDryrunAsync(resourceUri, dryrunName, parameters).getSyncPoller(); + } + + /** + * add a dryrun job to do necessary check before actual creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @param parameters dryrun 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 {@link SyncPoller} for polling of a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DryrunResourceInner> beginUpdateDryrun( + String resourceUri, String dryrunName, DryrunPatch parameters, Context context) { + return beginUpdateDryrunAsync(resourceUri, dryrunName, parameters, context).getSyncPoller(); + } + + /** + * add a dryrun job to do necessary check before actual creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @param parameters dryrun resource. + * @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 dryrun job resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateDryrunAsync(String resourceUri, String dryrunName, DryrunPatch parameters) { + return beginUpdateDryrunAsync(resourceUri, dryrunName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * add a dryrun job to do necessary check before actual creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @param parameters dryrun 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 a dryrun job resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateDryrunAsync( + String resourceUri, String dryrunName, DryrunPatch parameters, Context context) { + return beginUpdateDryrunAsync(resourceUri, dryrunName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * add a dryrun job to do necessary check before actual creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @param parameters dryrun resource. + * @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 dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DryrunResourceInner updateDryrun(String resourceUri, String dryrunName, DryrunPatch parameters) { + return updateDryrunAsync(resourceUri, dryrunName, parameters).block(); + } + + /** + * add a dryrun job to do necessary check before actual creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @param parameters dryrun 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 a dryrun job resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DryrunResourceInner updateDryrun( + String resourceUri, String dryrunName, DryrunPatch parameters, Context context) { + return updateDryrunAsync(resourceUri, dryrunName, parameters, context).block(); + } + + /** + * delete a dryrun job. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @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> deleteDryrunWithResponseAsync(String resourceUri, String dryrunName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (dryrunName == null) { + return Mono.error(new IllegalArgumentException("Parameter dryrunName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteDryrun( + this.client.getEndpoint(), + resourceUri, + this.client.getApiVersion(), + dryrunName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * delete a dryrun job. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @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> deleteDryrunWithResponseAsync(String resourceUri, String dryrunName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (dryrunName == null) { + return Mono.error(new IllegalArgumentException("Parameter dryrunName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteDryrun( + this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), dryrunName, accept, context); + } + + /** + * delete a dryrun job. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @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 deleteDryrunAsync(String resourceUri, String dryrunName) { + return deleteDryrunWithResponseAsync(resourceUri, dryrunName).flatMap(ignored -> Mono.empty()); + } + + /** + * delete a dryrun job. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @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 deleteDryrunWithResponse(String resourceUri, String dryrunName, Context context) { + return deleteDryrunWithResponseAsync(resourceUri, dryrunName, context).block(); + } + + /** + * delete a dryrun job. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @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 deleteDryrun(String resourceUri, String dryrunName) { + deleteDryrunWithResponse(resourceUri, dryrunName, Context.NONE); + } + + /** + * Generate configurations for a Linker. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param linkerName The name Linker resource. + * @param parameters Connection Info, including format, secret store, etc. + * @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 configurations for source resource, include appSettings, connectionString and serviceBindings along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generateConfigurationsWithResponseAsync( + String resourceUri, String linkerName, ConfigurationInfo parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (linkerName == null) { + return Mono.error(new IllegalArgumentException("Parameter linkerName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .generateConfigurations( + this.client.getEndpoint(), + resourceUri, + this.client.getApiVersion(), + linkerName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generate configurations for a Linker. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param linkerName The name Linker resource. + * @param parameters Connection Info, including format, secret store, etc. + * @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 configurations for source resource, include appSettings, connectionString and serviceBindings along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generateConfigurationsWithResponseAsync( + String resourceUri, String linkerName, ConfigurationInfo parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (linkerName == null) { + return Mono.error(new IllegalArgumentException("Parameter linkerName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .generateConfigurations( + this.client.getEndpoint(), + resourceUri, + this.client.getApiVersion(), + linkerName, + parameters, + accept, + context); + } + + /** + * Generate configurations for a Linker. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param linkerName The name Linker resource. + * @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 configurations for source resource, include appSettings, connectionString and serviceBindings on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateConfigurationsAsync(String resourceUri, String linkerName) { + final ConfigurationInfo parameters = null; + return generateConfigurationsWithResponseAsync(resourceUri, linkerName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Generate configurations for a Linker. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param linkerName The name Linker resource. + * @param parameters Connection Info, including format, secret store, etc. + * @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 configurations for source resource, include appSettings, connectionString and serviceBindings along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response generateConfigurationsWithResponse( + String resourceUri, String linkerName, ConfigurationInfo parameters, Context context) { + return generateConfigurationsWithResponseAsync(resourceUri, linkerName, parameters, context).block(); + } + + /** + * Generate configurations for a Linker. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param linkerName The name Linker resource. + * @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 configurations for source resource, include appSettings, connectionString and serviceBindings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationResultInner generateConfigurations(String resourceUri, String linkerName) { + final ConfigurationInfo parameters = null; + return generateConfigurationsWithResponse(resourceUri, linkerName, parameters, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 dryrun along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDryrunNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + 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.listDryrunNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 dryrun along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDryrunNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + 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 + .listDryrunNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkersOperationsImpl.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkersOperationsImpl.java new file mode 100644 index 000000000000..49238cd00ba7 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkersOperationsImpl.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.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.servicelinker.fluent.LinkersOperationsClient; +import com.azure.resourcemanager.servicelinker.fluent.models.ConfigurationResultInner; +import com.azure.resourcemanager.servicelinker.fluent.models.DryrunResourceInner; +import com.azure.resourcemanager.servicelinker.models.ConfigurationInfo; +import com.azure.resourcemanager.servicelinker.models.ConfigurationResult; +import com.azure.resourcemanager.servicelinker.models.DryrunPatch; +import com.azure.resourcemanager.servicelinker.models.DryrunResource; +import com.azure.resourcemanager.servicelinker.models.LinkersOperations; + +public final class LinkersOperationsImpl implements LinkersOperations { + private static final ClientLogger LOGGER = new ClientLogger(LinkersOperationsImpl.class); + + private final LinkersOperationsClient innerClient; + + private final com.azure.resourcemanager.servicelinker.ServiceLinkerManager serviceManager; + + public LinkersOperationsImpl( + LinkersOperationsClient innerClient, + com.azure.resourcemanager.servicelinker.ServiceLinkerManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listDryrun(String resourceUri) { + PagedIterable inner = this.serviceClient().listDryrun(resourceUri); + return Utils.mapPage(inner, inner1 -> new DryrunResourceImpl(inner1, this.manager())); + } + + public PagedIterable listDryrun(String resourceUri, Context context) { + PagedIterable inner = this.serviceClient().listDryrun(resourceUri, context); + return Utils.mapPage(inner, inner1 -> new DryrunResourceImpl(inner1, this.manager())); + } + + public Response getDryrunWithResponse(String resourceUri, String dryrunName, Context context) { + Response inner = + this.serviceClient().getDryrunWithResponse(resourceUri, dryrunName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DryrunResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DryrunResource getDryrun(String resourceUri, String dryrunName) { + DryrunResourceInner inner = this.serviceClient().getDryrun(resourceUri, dryrunName); + if (inner != null) { + return new DryrunResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public DryrunResource createDryrun(String resourceUri, String dryrunName, DryrunResourceInner parameters) { + DryrunResourceInner inner = this.serviceClient().createDryrun(resourceUri, dryrunName, parameters); + if (inner != null) { + return new DryrunResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public DryrunResource createDryrun( + String resourceUri, String dryrunName, DryrunResourceInner parameters, Context context) { + DryrunResourceInner inner = this.serviceClient().createDryrun(resourceUri, dryrunName, parameters, context); + if (inner != null) { + return new DryrunResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public DryrunResource updateDryrun(String resourceUri, String dryrunName, DryrunPatch parameters) { + DryrunResourceInner inner = this.serviceClient().updateDryrun(resourceUri, dryrunName, parameters); + if (inner != null) { + return new DryrunResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public DryrunResource updateDryrun(String resourceUri, String dryrunName, DryrunPatch parameters, Context context) { + DryrunResourceInner inner = this.serviceClient().updateDryrun(resourceUri, dryrunName, parameters, context); + if (inner != null) { + return new DryrunResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteDryrunWithResponse(String resourceUri, String dryrunName, Context context) { + return this.serviceClient().deleteDryrunWithResponse(resourceUri, dryrunName, context); + } + + public void deleteDryrun(String resourceUri, String dryrunName) { + this.serviceClient().deleteDryrun(resourceUri, dryrunName); + } + + public Response generateConfigurationsWithResponse( + String resourceUri, String linkerName, ConfigurationInfo parameters, Context context) { + Response inner = + this.serviceClient().generateConfigurationsWithResponse(resourceUri, linkerName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ConfigurationResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ConfigurationResult generateConfigurations(String resourceUri, String linkerName) { + ConfigurationResultInner inner = this.serviceClient().generateConfigurations(resourceUri, linkerName); + if (inner != null) { + return new ConfigurationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private LinkersOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/OperationsClientImpl.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/OperationsClientImpl.java index fdd4c7907423..cc67e102d4dd 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/OperationsClientImpl.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/OperationsClientImpl.java @@ -55,7 +55,7 @@ public final class OperationsClientImpl implements OperationsClient { */ @Host("{$host}") @ServiceInterface(name = "ServiceLinkerManagem") - private interface OperationsService { + public interface OperationsService { @Headers({"Content-Type: application/json"}) @Get("/providers/Microsoft.ServiceLinker/operations") @ExpectedResponses({200}) @@ -202,7 +202,8 @@ public PagedIterable list(Context context) { /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @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. @@ -238,7 +239,8 @@ private Mono> listNextSinglePageAsync(String nextL /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @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. diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ServiceLinkerManagementClientBuilder.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ServiceLinkerManagementClientBuilder.java index 018b9b5b585e..c30cff560136 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ServiceLinkerManagementClientBuilder.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ServiceLinkerManagementClientBuilder.java @@ -103,24 +103,21 @@ public ServiceLinkerManagementClientBuilder serializerAdapter(SerializerAdapter * @return an instance of ServiceLinkerManagementClientImpl. */ public ServiceLinkerManagementClientImpl 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(); - } + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); ServiceLinkerManagementClientImpl client = new ServiceLinkerManagementClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, endpoint); + localPipeline, localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint); return client; } } diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ServiceLinkerManagementClientImpl.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ServiceLinkerManagementClientImpl.java index 49a6b1554356..9169c7305c5f 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ServiceLinkerManagementClientImpl.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ServiceLinkerManagementClientImpl.java @@ -22,7 +22,10 @@ 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.servicelinker.fluent.ConfigurationNamesOperationsClient; +import com.azure.resourcemanager.servicelinker.fluent.ConnectorsClient; import com.azure.resourcemanager.servicelinker.fluent.LinkersClient; +import com.azure.resourcemanager.servicelinker.fluent.LinkersOperationsClient; import com.azure.resourcemanager.servicelinker.fluent.OperationsClient; import com.azure.resourcemanager.servicelinker.fluent.ServiceLinkerManagementClient; import java.io.IOException; @@ -97,6 +100,18 @@ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } + /** The ConnectorsClient object to access its operations. */ + private final ConnectorsClient connectors; + + /** + * Gets the ConnectorsClient object to access its operations. + * + * @return the ConnectorsClient object. + */ + public ConnectorsClient getConnectors() { + return this.connectors; + } + /** The LinkersClient object to access its operations. */ private final LinkersClient linkers; @@ -109,6 +124,18 @@ public LinkersClient getLinkers() { return this.linkers; } + /** The LinkersOperationsClient object to access its operations. */ + private final LinkersOperationsClient linkersOperations; + + /** + * Gets the LinkersOperationsClient object to access its operations. + * + * @return the LinkersOperationsClient object. + */ + public LinkersOperationsClient getLinkersOperations() { + return this.linkersOperations; + } + /** The OperationsClient object to access its operations. */ private final OperationsClient operations; @@ -121,6 +148,18 @@ public OperationsClient getOperations() { return this.operations; } + /** The ConfigurationNamesOperationsClient object to access its operations. */ + private final ConfigurationNamesOperationsClient configurationNamesOperations; + + /** + * Gets the ConfigurationNamesOperationsClient object to access its operations. + * + * @return the ConfigurationNamesOperationsClient object. + */ + public ConfigurationNamesOperationsClient getConfigurationNamesOperations() { + return this.configurationNamesOperations; + } + /** * Initializes an instance of ServiceLinkerManagementClient client. * @@ -140,9 +179,12 @@ public OperationsClient getOperations() { this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; this.endpoint = endpoint; - this.apiVersion = "2022-05-01"; + this.apiVersion = "2022-11-01-preview"; + this.connectors = new ConnectorsClientImpl(this); this.linkers = new LinkersClientImpl(this); + this.linkersOperations = new LinkersOperationsClientImpl(this); this.operations = new OperationsClientImpl(this); + this.configurationNamesOperations = new ConfigurationNamesOperationsClientImpl(this); } /** diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AccessKeyInfoBase.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AccessKeyInfoBase.java new file mode 100644 index 000000000000..bc477a606d82 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AccessKeyInfoBase.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** + * The access key directly from target resource properties, which target service is Azure Resource, such as + * Microsoft.Storage. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "authType") +@JsonTypeName("accessKey") +@Fluent +public final class AccessKeyInfoBase extends AuthInfoBase { + /* + * Permissions of the accessKey. `Read` and `Write` are for Azure Cosmos DB and Azure App Configuration, `Listen`, + * `Send` and `Manage` are for Azure Event Hub and Azure Service Bus. + */ + @JsonProperty(value = "permissions") + private List permissions; + + /** Creates an instance of AccessKeyInfoBase class. */ + public AccessKeyInfoBase() { + } + + /** + * Get the permissions property: Permissions of the accessKey. `Read` and `Write` are for Azure Cosmos DB and Azure + * App Configuration, `Listen`, `Send` and `Manage` are for Azure Event Hub and Azure Service Bus. + * + * @return the permissions value. + */ + public List permissions() { + return this.permissions; + } + + /** + * Set the permissions property: Permissions of the accessKey. `Read` and `Write` are for Azure Cosmos DB and Azure + * App Configuration, `Listen`, `Send` and `Manage` are for Azure Event Hub and Azure Service Bus. + * + * @param permissions the permissions value to set. + * @return the AccessKeyInfoBase object itself. + */ + public AccessKeyInfoBase withPermissions(List permissions) { + this.permissions = permissions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AccessKeyPermissions.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AccessKeyPermissions.java new file mode 100644 index 000000000000..9e544e7f9eae --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AccessKeyPermissions.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AccessKeyPermissions. */ +public final class AccessKeyPermissions extends ExpandableStringEnum { + /** Static value Read for AccessKeyPermissions. */ + public static final AccessKeyPermissions READ = fromString("Read"); + + /** Static value Write for AccessKeyPermissions. */ + public static final AccessKeyPermissions WRITE = fromString("Write"); + + /** Static value Listen for AccessKeyPermissions. */ + public static final AccessKeyPermissions LISTEN = fromString("Listen"); + + /** Static value Send for AccessKeyPermissions. */ + public static final AccessKeyPermissions SEND = fromString("Send"); + + /** Static value Manage for AccessKeyPermissions. */ + public static final AccessKeyPermissions MANAGE = fromString("Manage"); + + /** + * Creates or finds a AccessKeyPermissions from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessKeyPermissions. + */ + @JsonCreator + public static AccessKeyPermissions fromString(String name) { + return fromString(name, AccessKeyPermissions.class); + } + + /** + * Gets known AccessKeyPermissions values. + * + * @return known AccessKeyPermissions values. + */ + public static Collection values() { + return values(AccessKeyPermissions.class); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ActionType.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ActionType.java index 765a8393e5c3..80822a4f94b4 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ActionType.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ActionType.java @@ -8,11 +8,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ActionType. */ +/** Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ public final class ActionType extends ExpandableStringEnum { /** Static value Internal for ActionType. */ public static final ActionType INTERNAL = fromString("Internal"); + /** Static value enable for ActionType. */ + public static final ActionType ENABLE = fromString("enable"); + + /** Static value optOut for ActionType. */ + public static final ActionType OPT_OUT = fromString("optOut"); + /** * Creates or finds a ActionType from its string representation. * diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AllowType.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AllowType.java new file mode 100644 index 000000000000..3b5b3ab01348 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AllowType.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.servicelinker.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Whether to allow firewall rules. */ +public final class AllowType extends ExpandableStringEnum { + /** Static value true for AllowType. */ + public static final AllowType TRUE = fromString("true"); + + /** Static value false for AllowType. */ + public static final AllowType FALSE = fromString("false"); + + /** + * Creates or finds a AllowType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AllowType. + */ + @JsonCreator + public static AllowType fromString(String name) { + return fromString(name, AllowType.class); + } + + /** + * Gets known AllowType values. + * + * @return known AllowType values. + */ + public static Collection values() { + return values(AllowType.class); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AuthInfoBase.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AuthInfoBase.java index d3a34302fdde..255c86cfce19 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AuthInfoBase.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AuthInfoBase.java @@ -17,14 +17,20 @@ defaultImpl = AuthInfoBase.class) @JsonTypeName("AuthInfoBase") @JsonSubTypes({ + @JsonSubTypes.Type(name = "accessKey", value = AccessKeyInfoBase.class), @JsonSubTypes.Type(name = "secret", value = SecretAuthInfo.class), @JsonSubTypes.Type(name = "userAssignedIdentity", value = UserAssignedIdentityAuthInfo.class), @JsonSubTypes.Type(name = "systemAssignedIdentity", value = SystemAssignedIdentityAuthInfo.class), @JsonSubTypes.Type(name = "servicePrincipalSecret", value = ServicePrincipalSecretAuthInfo.class), - @JsonSubTypes.Type(name = "servicePrincipalCertificate", value = ServicePrincipalCertificateAuthInfo.class) + @JsonSubTypes.Type(name = "servicePrincipalCertificate", value = ServicePrincipalCertificateAuthInfo.class), + @JsonSubTypes.Type(name = "userAccount", value = UserAccountAuthInfo.class) }) @Immutable public class AuthInfoBase { + /** Creates an instance of AuthInfoBase class. */ + public AuthInfoBase() { + } + /** * Validates the instance. * diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AuthType.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AuthType.java index a14c2a2f7a81..51a22363dfaf 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AuthType.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AuthType.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for AuthType. */ +/** The authentication type. */ public final class AuthType extends ExpandableStringEnum { /** Static value systemAssignedIdentity for AuthType. */ public static final AuthType SYSTEM_ASSIGNED_IDENTITY = fromString("systemAssignedIdentity"); @@ -25,6 +25,12 @@ public final class AuthType extends ExpandableStringEnum { /** Static value secret for AuthType. */ public static final AuthType SECRET = fromString("secret"); + /** Static value accessKey for AuthType. */ + public static final AuthType ACCESS_KEY = fromString("accessKey"); + + /** Static value userAccount for AuthType. */ + public static final AuthType USER_ACCOUNT = fromString("userAccount"); + /** * Creates or finds a AuthType from its string representation. * diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AzureKeyVaultProperties.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AzureKeyVaultProperties.java index 41fdcf7777ab..493d701ad68f 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AzureKeyVaultProperties.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AzureKeyVaultProperties.java @@ -20,6 +20,10 @@ public final class AzureKeyVaultProperties extends AzureResourcePropertiesBase { @JsonProperty(value = "connectAsKubernetesCsiDriver") private Boolean connectAsKubernetesCsiDriver; + /** Creates an instance of AzureKeyVaultProperties class. */ + public AzureKeyVaultProperties() { + } + /** * Get the connectAsKubernetesCsiDriver property: True if connect via Kubernetes CSI Driver. * diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AzureResource.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AzureResource.java index 511c4257690e..6cfd5e5acdac 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AzureResource.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AzureResource.java @@ -26,6 +26,10 @@ public final class AzureResource extends TargetServiceBase { @JsonProperty(value = "resourceProperties") private AzureResourcePropertiesBase resourceProperties; + /** Creates an instance of AzureResource class. */ + public AzureResource() { + } + /** * Get the id property: The Id of azure resource. * diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AzureResourcePropertiesBase.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AzureResourcePropertiesBase.java index b551b18943dd..fda0034a37bd 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AzureResourcePropertiesBase.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AzureResourcePropertiesBase.java @@ -19,6 +19,10 @@ @JsonSubTypes({@JsonSubTypes.Type(name = "KeyVault", value = AzureKeyVaultProperties.class)}) @Immutable public class AzureResourcePropertiesBase { + /** Creates an instance of AzureResourcePropertiesBase class. */ + public AzureResourcePropertiesBase() { + } + /** * Validates the instance. * diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AzureResourceType.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AzureResourceType.java index ab23f6c1abd4..5ee7a5e7c5e5 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AzureResourceType.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AzureResourceType.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for AzureResourceType. */ +/** The azure resource type. */ public final class AzureResourceType extends ExpandableStringEnum { /** Static value KeyVault for AzureResourceType. */ public static final AzureResourceType KEY_VAULT = fromString("KeyVault"); diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/BasicErrorDryrunPrerequisiteResult.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/BasicErrorDryrunPrerequisiteResult.java new file mode 100644 index 000000000000..1bee8c257578 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/BasicErrorDryrunPrerequisiteResult.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The represent of basic error. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("basicError") +@Fluent +public final class BasicErrorDryrunPrerequisiteResult extends DryrunPrerequisiteResult { + /* + * The error code. + */ + @JsonProperty(value = "code") + private String code; + + /* + * The error message. + */ + @JsonProperty(value = "message") + private String message; + + /** Creates an instance of BasicErrorDryrunPrerequisiteResult class. */ + public BasicErrorDryrunPrerequisiteResult() { + } + + /** + * Get the code property: The error code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: The error code. + * + * @param code the code value to set. + * @return the BasicErrorDryrunPrerequisiteResult object itself. + */ + public BasicErrorDryrunPrerequisiteResult withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message property: The error message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: The error message. + * + * @param message the message value to set. + * @return the BasicErrorDryrunPrerequisiteResult object itself. + */ + public BasicErrorDryrunPrerequisiteResult withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ClientType.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ClientType.java index afad077739f2..f1cdb5e6409c 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ClientType.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ClientType.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ClientType. */ +/** The application client type. */ public final class ClientType extends ExpandableStringEnum { /** Static value none for ClientType. */ public static final ClientType NONE = fromString("none"); @@ -40,6 +40,9 @@ public final class ClientType extends ExpandableStringEnum { /** Static value springBoot for ClientType. */ public static final ClientType SPRING_BOOT = fromString("springBoot"); + /** Static value kafka-springBoot for ClientType. */ + public static final ClientType KAFKA_SPRING_BOOT = fromString("kafka-springBoot"); + /** * Creates or finds a ClientType from its string representation. * diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfigurationInfo.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfigurationInfo.java new file mode 100644 index 000000000000..e4d6a1e0c8f7 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfigurationInfo.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.servicelinker.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The configuration information, used to generate configurations or save to applications. */ +@Fluent +public final class ConfigurationInfo { + /* + * Indicates whether to clean up previous operation when Linker is updating or deleting + */ + @JsonProperty(value = "deleteOrUpdateBehavior") + private DeleteOrUpdateBehavior deleteOrUpdateBehavior; + + /* + * Optional, indicate whether to apply configurations on source application. If enable, generate configurations and + * applied to the source application. Default is enable. If optOut, no configuration change will be made on source. + */ + @JsonProperty(value = "action") + private ActionType action; + + /* + * Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name + * will be used for generate configurations + */ + @JsonProperty(value = "customizedKeys") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map customizedKeys; + + /* + * A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations + * and this property is to full fill more customized configurations + */ + @JsonProperty(value = "additionalConfigurations") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map additionalConfigurations; + + /** Creates an instance of ConfigurationInfo class. */ + public ConfigurationInfo() { + } + + /** + * Get the deleteOrUpdateBehavior property: Indicates whether to clean up previous operation when Linker is updating + * or deleting. + * + * @return the deleteOrUpdateBehavior value. + */ + public DeleteOrUpdateBehavior deleteOrUpdateBehavior() { + return this.deleteOrUpdateBehavior; + } + + /** + * Set the deleteOrUpdateBehavior property: Indicates whether to clean up previous operation when Linker is updating + * or deleting. + * + * @param deleteOrUpdateBehavior the deleteOrUpdateBehavior value to set. + * @return the ConfigurationInfo object itself. + */ + public ConfigurationInfo withDeleteOrUpdateBehavior(DeleteOrUpdateBehavior deleteOrUpdateBehavior) { + this.deleteOrUpdateBehavior = deleteOrUpdateBehavior; + return this; + } + + /** + * Get the action property: Optional, indicate whether to apply configurations on source application. If enable, + * generate configurations and applied to the source application. Default is enable. If optOut, no configuration + * change will be made on source. + * + * @return the action value. + */ + public ActionType action() { + return this.action; + } + + /** + * Set the action property: Optional, indicate whether to apply configurations on source application. If enable, + * generate configurations and applied to the source application. Default is enable. If optOut, no configuration + * change will be made on source. + * + * @param action the action value to set. + * @return the ConfigurationInfo object itself. + */ + public ConfigurationInfo withAction(ActionType action) { + this.action = action; + return this; + } + + /** + * Get the customizedKeys property: Optional. A dictionary of default key name and customized key name mapping. If + * not specified, default key name will be used for generate configurations. + * + * @return the customizedKeys value. + */ + public Map customizedKeys() { + return this.customizedKeys; + } + + /** + * Set the customizedKeys property: Optional. A dictionary of default key name and customized key name mapping. If + * not specified, default key name will be used for generate configurations. + * + * @param customizedKeys the customizedKeys value to set. + * @return the ConfigurationInfo object itself. + */ + public ConfigurationInfo withCustomizedKeys(Map customizedKeys) { + this.customizedKeys = customizedKeys; + return this; + } + + /** + * Get the additionalConfigurations property: A dictionary of additional configurations to be added. Service will + * auto generate a set of basic configurations and this property is to full fill more customized configurations. + * + * @return the additionalConfigurations value. + */ + public Map additionalConfigurations() { + return this.additionalConfigurations; + } + + /** + * Set the additionalConfigurations property: A dictionary of additional configurations to be added. Service will + * auto generate a set of basic configurations and this property is to full fill more customized configurations. + * + * @param additionalConfigurations the additionalConfigurations value to set. + * @return the ConfigurationInfo object itself. + */ + public ConfigurationInfo withAdditionalConfigurations(Map additionalConfigurations) { + this.additionalConfigurations = additionalConfigurations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfigurationName.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfigurationName.java new file mode 100644 index 000000000000..dd46c5edbc4f --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfigurationName.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration names. */ +@Fluent +public final class ConfigurationName { + /* + * The value property. + */ + @JsonProperty(value = "value") + private String value; + + /* + * Description for the configuration name. + */ + @JsonProperty(value = "description") + private String description; + + /** Creates an instance of ConfigurationName class. */ + public ConfigurationName() { + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the ConfigurationName object itself. + */ + public ConfigurationName withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the description property: Description for the configuration name. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description for the configuration name. + * + * @param description the description value to set. + * @return the ConfigurationName object itself. + */ + public ConfigurationName withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfigurationNameItem.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfigurationNameItem.java new file mode 100644 index 000000000000..5e370a1974c5 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfigurationNameItem.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.servicelinker.models; + +import com.azure.resourcemanager.servicelinker.fluent.models.ConfigurationNameItemInner; +import java.util.List; + +/** An immutable client-side representation of ConfigurationNameItem. */ +public interface ConfigurationNameItem { + /** + * Gets the targetService property: The target service provider name and resource name. + * + * @return the targetService value. + */ + String targetService(); + + /** + * Gets the clientType property: The client type for configuration names. + * + * @return the clientType value. + */ + ClientType clientType(); + + /** + * Gets the authType property: The auth type. + * + * @return the authType value. + */ + AuthType authType(); + + /** + * Gets the names property: The configuration names to be set in compute service environment. + * + * @return the names value. + */ + List names(); + + /** + * Gets the inner com.azure.resourcemanager.servicelinker.fluent.models.ConfigurationNameItemInner object. + * + * @return the inner object. + */ + ConfigurationNameItemInner innerModel(); +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfigurationNameResult.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfigurationNameResult.java new file mode 100644 index 000000000000..792f15f302dc --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfigurationNameResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicelinker.fluent.models.ConfigurationNameItemInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Configuration Name list which will be set based on different target resource, client type, auth type. */ +@Fluent +public final class ConfigurationNameResult { + /* + * Expected configuration names for each target service. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to next page of resources. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of ConfigurationNameResult class. */ + public ConfigurationNameResult() { + } + + /** + * Get the value property: Expected configuration names for each target service. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Expected configuration names for each target service. + * + * @param value the value value to set. + * @return the ConfigurationNameResult object itself. + */ + public ConfigurationNameResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * 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/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfigurationNamesOperations.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfigurationNamesOperations.java new file mode 100644 index 000000000000..dd640b2c9f21 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfigurationNamesOperations.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of ConfigurationNamesOperations. */ +public interface ConfigurationNamesOperations { + /** + * Lists the configuration names generated by Service Connector for all target, client types, auth types. + * + * @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 configuration Name list which will be set based on different target resource, client type, auth type as + * paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists the configuration names generated by Service Connector for all target, client types, auth types. + * + * @param filter OData filter options. + * @param skipToken OData skipToken option for pagination. + * @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 configuration Name list which will be set based on different target resource, client type, auth type as + * paginated response with {@link PagedIterable}. + */ + PagedIterable list(String filter, String skipToken, Context context); +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SourceConfigurationResult.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfigurationResult.java similarity index 64% rename from sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SourceConfigurationResult.java rename to sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfigurationResult.java index 808f14d90d87..5ac945adb1b2 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SourceConfigurationResult.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfigurationResult.java @@ -4,11 +4,11 @@ package com.azure.resourcemanager.servicelinker.models; -import com.azure.resourcemanager.servicelinker.fluent.models.SourceConfigurationResultInner; +import com.azure.resourcemanager.servicelinker.fluent.models.ConfigurationResultInner; import java.util.List; -/** An immutable client-side representation of SourceConfigurationResult. */ -public interface SourceConfigurationResult { +/** An immutable client-side representation of ConfigurationResult. */ +public interface ConfigurationResult { /** * Gets the configurations property: The configuration properties for source resource. * @@ -17,9 +17,9 @@ public interface SourceConfigurationResult { List configurations(); /** - * Gets the inner com.azure.resourcemanager.servicelinker.fluent.models.SourceConfigurationResultInner object. + * Gets the inner com.azure.resourcemanager.servicelinker.fluent.models.ConfigurationResultInner object. * * @return the inner object. */ - SourceConfigurationResultInner innerModel(); + ConfigurationResultInner innerModel(); } diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfluentBootstrapServer.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfluentBootstrapServer.java index 195d2c034554..53c9f1bbabb3 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfluentBootstrapServer.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfluentBootstrapServer.java @@ -20,6 +20,10 @@ public final class ConfluentBootstrapServer extends TargetServiceBase { @JsonProperty(value = "endpoint") private String endpoint; + /** Creates an instance of ConfluentBootstrapServer class. */ + public ConfluentBootstrapServer() { + } + /** * Get the endpoint property: The endpoint of service. * diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfluentSchemaRegistry.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfluentSchemaRegistry.java index 68321e5ebc96..6f67bb469857 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfluentSchemaRegistry.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfluentSchemaRegistry.java @@ -20,6 +20,10 @@ public final class ConfluentSchemaRegistry extends TargetServiceBase { @JsonProperty(value = "endpoint") private String endpoint; + /** Creates an instance of ConfluentSchemaRegistry class. */ + public ConfluentSchemaRegistry() { + } + /** * Get the endpoint property: The endpoint of service. * diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/Connectors.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/Connectors.java new file mode 100644 index 000000000000..6303417e1c04 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/Connectors.java @@ -0,0 +1,361 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.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 Connectors. */ +public interface Connectors { + /** + * list dryrun jobs. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @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 dryrun as paginated response with {@link PagedIterable}. + */ + PagedIterable listDryrun(String subscriptionId, String resourceGroupName, String location); + + /** + * list dryrun jobs. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @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 dryrun as paginated response with {@link PagedIterable}. + */ + PagedIterable listDryrun( + String subscriptionId, String resourceGroupName, String location, Context context); + + /** + * get a dryrun job. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @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 a dryrun job along with {@link Response}. + */ + Response getDryrunWithResponse( + String subscriptionId, String resourceGroupName, String location, String dryrunName, Context context); + + /** + * get a dryrun job. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @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 a dryrun job. + */ + DryrunResource getDryrun(String subscriptionId, String resourceGroupName, String location, String dryrunName); + + /** + * delete a dryrun job. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @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 deleteDryrunWithResponse( + String subscriptionId, String resourceGroupName, String location, String dryrunName, Context context); + + /** + * delete a dryrun job. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of dryrun. + * @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 deleteDryrun(String subscriptionId, String resourceGroupName, String location, String dryrunName); + + /** + * Returns list of connector which connects to the resource, which supports to config the target service during the + * resource provision. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @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 Linker as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String subscriptionId, String resourceGroupName, String location); + + /** + * Returns list of connector which connects to the resource, which supports to config the target service during the + * resource provision. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @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 Linker as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String subscriptionId, String resourceGroupName, String location, Context context); + + /** + * Returns Connector resource for a given name. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of 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 linker of source and target resource along with {@link Response}. + */ + Response getWithResponse( + String subscriptionId, String resourceGroupName, String location, String connectorName, Context context); + + /** + * Returns Connector resource for a given name. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @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 linker of source and target resource. + */ + LinkerResource get(String subscriptionId, String resourceGroupName, String location, String connectorName); + + /** + * Delete a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @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 subscriptionId, String resourceGroupName, String location, String connectorName); + + /** + * Delete a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of 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. + */ + void delete( + String subscriptionId, String resourceGroupName, String location, String connectorName, Context context); + + /** + * Validate a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @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 validation operation result for a Linker. + */ + ValidateOperationResult validate( + String subscriptionId, String resourceGroupName, String location, String connectorName); + + /** + * Validate a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of 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 validation operation result for a Linker. + */ + ValidateOperationResult validate( + String subscriptionId, String resourceGroupName, String location, String connectorName, Context context); + + /** + * Generate configurations for a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @param parameters Connection Info, including format, secret store, etc. + * @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 configurations for source resource, include appSettings, connectionString and serviceBindings along with + * {@link Response}. + */ + Response generateConfigurationsWithResponse( + String subscriptionId, + String resourceGroupName, + String location, + String connectorName, + ConfigurationInfo parameters, + Context context); + + /** + * Generate configurations for a Connector. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of resource. + * @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 configurations for source resource, include appSettings, connectionString and serviceBindings. + */ + ConfigurationResult generateConfigurations( + String subscriptionId, String resourceGroupName, String location, String connectorName); + + /** + * get a dryrun job. + * + * @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 a dryrun job along with {@link Response}. + */ + DryrunResource getDryrunById(String id); + + /** + * get a dryrun job. + * + * @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 a dryrun job along with {@link Response}. + */ + Response getDryrunByIdWithResponse(String id, Context context); + + /** + * Returns Connector resource for a given name. + * + * @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 linker of source and target resource along with {@link Response}. + */ + LinkerResource getById(String id); + + /** + * Returns Connector resource for a given name. + * + * @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 linker of source and target resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * delete a dryrun job. + * + * @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 deleteDryrunById(String id); + + /** + * delete a dryrun job. + * + * @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 deleteDryrunByIdWithResponse(String id, Context context); + + /** + * Delete a Connector. + * + * @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 a Connector. + * + * @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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new DryrunResource resource. + * + * @param name resource name. + * @return the first stage of the new DryrunResource definition. + */ + DryrunResource.DefinitionStages.Blank defineDryrun(String name); + + /** + * Begins definition for a new LinkerResource resource. + * + * @param name resource name. + * @return the first stage of the new LinkerResource definition. + */ + LinkerResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/CreateOrUpdateDryrunParameters.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/CreateOrUpdateDryrunParameters.java new file mode 100644 index 000000000000..64b575c735d9 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/CreateOrUpdateDryrunParameters.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The dryrun parameters for creation or update a linker. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "actionName") +@JsonTypeName("createOrUpdate") +@Fluent +public final class CreateOrUpdateDryrunParameters extends DryrunParameters { + /* + * The target service properties + */ + @JsonProperty(value = "targetService") + private TargetServiceBase targetService; + + /* + * The authentication type. + */ + @JsonProperty(value = "authInfo") + private AuthInfoBase authInfo; + + /* + * The application client type + */ + @JsonProperty(value = "clientType") + private ClientType clientType; + + /* + * The provisioning state. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The VNet solution. + */ + @JsonProperty(value = "vNetSolution") + private VNetSolution vNetSolution; + + /* + * An option to store secret value in secure place + */ + @JsonProperty(value = "secretStore") + private SecretStore secretStore; + + /* + * connection scope in source service. + */ + @JsonProperty(value = "scope") + private String scope; + + /* + * The network solution. + */ + @JsonProperty(value = "publicNetworkSolution") + private PublicNetworkSolution publicNetworkSolution; + + /* + * The connection information consumed by applications, including secrets, connection strings. + */ + @JsonProperty(value = "configurationInfo") + private ConfigurationInfo configurationInfo; + + /** Creates an instance of CreateOrUpdateDryrunParameters class. */ + public CreateOrUpdateDryrunParameters() { + } + + /** + * Get the targetService property: The target service properties. + * + * @return the targetService value. + */ + public TargetServiceBase targetService() { + return this.targetService; + } + + /** + * Set the targetService property: The target service properties. + * + * @param targetService the targetService value to set. + * @return the CreateOrUpdateDryrunParameters object itself. + */ + public CreateOrUpdateDryrunParameters withTargetService(TargetServiceBase targetService) { + this.targetService = targetService; + return this; + } + + /** + * Get the authInfo property: The authentication type. + * + * @return the authInfo value. + */ + public AuthInfoBase authInfo() { + return this.authInfo; + } + + /** + * Set the authInfo property: The authentication type. + * + * @param authInfo the authInfo value to set. + * @return the CreateOrUpdateDryrunParameters object itself. + */ + public CreateOrUpdateDryrunParameters withAuthInfo(AuthInfoBase authInfo) { + this.authInfo = authInfo; + return this; + } + + /** + * Get the clientType property: The application client type. + * + * @return the clientType value. + */ + public ClientType clientType() { + return this.clientType; + } + + /** + * Set the clientType property: The application client type. + * + * @param clientType the clientType value to set. + * @return the CreateOrUpdateDryrunParameters object itself. + */ + public CreateOrUpdateDryrunParameters withClientType(ClientType clientType) { + this.clientType = clientType; + return this; + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the vNetSolution property: The VNet solution. + * + * @return the vNetSolution value. + */ + public VNetSolution vNetSolution() { + return this.vNetSolution; + } + + /** + * Set the vNetSolution property: The VNet solution. + * + * @param vNetSolution the vNetSolution value to set. + * @return the CreateOrUpdateDryrunParameters object itself. + */ + public CreateOrUpdateDryrunParameters withVNetSolution(VNetSolution vNetSolution) { + this.vNetSolution = vNetSolution; + return this; + } + + /** + * Get the secretStore property: An option to store secret value in secure place. + * + * @return the secretStore value. + */ + public SecretStore secretStore() { + return this.secretStore; + } + + /** + * Set the secretStore property: An option to store secret value in secure place. + * + * @param secretStore the secretStore value to set. + * @return the CreateOrUpdateDryrunParameters object itself. + */ + public CreateOrUpdateDryrunParameters withSecretStore(SecretStore secretStore) { + this.secretStore = secretStore; + return this; + } + + /** + * Get the scope property: connection scope in source service. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope property: connection scope in source service. + * + * @param scope the scope value to set. + * @return the CreateOrUpdateDryrunParameters object itself. + */ + public CreateOrUpdateDryrunParameters withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the publicNetworkSolution property: The network solution. + * + * @return the publicNetworkSolution value. + */ + public PublicNetworkSolution publicNetworkSolution() { + return this.publicNetworkSolution; + } + + /** + * Set the publicNetworkSolution property: The network solution. + * + * @param publicNetworkSolution the publicNetworkSolution value to set. + * @return the CreateOrUpdateDryrunParameters object itself. + */ + public CreateOrUpdateDryrunParameters withPublicNetworkSolution(PublicNetworkSolution publicNetworkSolution) { + this.publicNetworkSolution = publicNetworkSolution; + return this; + } + + /** + * Get the configurationInfo property: The connection information consumed by applications, including secrets, + * connection strings. + * + * @return the configurationInfo value. + */ + public ConfigurationInfo configurationInfo() { + return this.configurationInfo; + } + + /** + * Set the configurationInfo property: The connection information consumed by applications, including secrets, + * connection strings. + * + * @param configurationInfo the configurationInfo value to set. + * @return the CreateOrUpdateDryrunParameters object itself. + */ + public CreateOrUpdateDryrunParameters withConfigurationInfo(ConfigurationInfo configurationInfo) { + this.configurationInfo = configurationInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (targetService() != null) { + targetService().validate(); + } + if (authInfo() != null) { + authInfo().validate(); + } + if (vNetSolution() != null) { + vNetSolution().validate(); + } + if (secretStore() != null) { + secretStore().validate(); + } + if (publicNetworkSolution() != null) { + publicNetworkSolution().validate(); + } + if (configurationInfo() != null) { + configurationInfo().validate(); + } + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DatabaseAadAuthInfo.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DatabaseAadAuthInfo.java new file mode 100644 index 000000000000..f416adc344b3 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DatabaseAadAuthInfo.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The extra auth info required by Database AAD authentication. */ +@Fluent +public class DatabaseAadAuthInfo { + /* + * Username created in the database which is mapped to a user in AAD. + */ + @JsonProperty(value = "userName") + private String username; + + /** Creates an instance of DatabaseAadAuthInfo class. */ + public DatabaseAadAuthInfo() { + } + + /** + * Get the username property: Username created in the database which is mapped to a user in AAD. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: Username created in the database which is mapped to a user in AAD. + * + * @param username the username value to set. + * @return the DatabaseAadAuthInfo object itself. + */ + public DatabaseAadAuthInfo withUsername(String username) { + this.username = username; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DeleteOrUpdateBehavior.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DeleteOrUpdateBehavior.java new file mode 100644 index 000000000000..655ebbf1c1de --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DeleteOrUpdateBehavior.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.servicelinker.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The cleanup behavior to indicate whether clean up operation when resource is deleted or updated. */ +public final class DeleteOrUpdateBehavior extends ExpandableStringEnum { + /** Static value Default for DeleteOrUpdateBehavior. */ + public static final DeleteOrUpdateBehavior DEFAULT = fromString("Default"); + + /** Static value ForcedCleanup for DeleteOrUpdateBehavior. */ + public static final DeleteOrUpdateBehavior FORCED_CLEANUP = fromString("ForcedCleanup"); + + /** + * Creates or finds a DeleteOrUpdateBehavior from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeleteOrUpdateBehavior. + */ + @JsonCreator + public static DeleteOrUpdateBehavior fromString(String name) { + return fromString(name, DeleteOrUpdateBehavior.class); + } + + /** + * Gets known DeleteOrUpdateBehavior values. + * + * @return known DeleteOrUpdateBehavior values. + */ + public static Collection values() { + return values(DeleteOrUpdateBehavior.class); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunActionName.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunActionName.java new file mode 100644 index 000000000000..288157b52ef3 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunActionName.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The name of action for you dryrun job. */ +public final class DryrunActionName extends ExpandableStringEnum { + /** Static value createOrUpdate for DryrunActionName. */ + public static final DryrunActionName CREATE_OR_UPDATE = fromString("createOrUpdate"); + + /** + * Creates or finds a DryrunActionName from its string representation. + * + * @param name a name to look for. + * @return the corresponding DryrunActionName. + */ + @JsonCreator + public static DryrunActionName fromString(String name) { + return fromString(name, DryrunActionName.class); + } + + /** + * Gets known DryrunActionName values. + * + * @return known DryrunActionName values. + */ + public static Collection values() { + return values(DryrunActionName.class); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunList.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunList.java new file mode 100644 index 000000000000..59e144f24fff --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunList.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.servicelinker.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicelinker.fluent.models.DryrunResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of dryrun. */ +@Fluent +public final class DryrunList { + /* + * The link used to get the next page of dryrun list. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * The list of dryrun. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of DryrunList class. */ + public DryrunList() { + } + + /** + * Get the nextLink property: The link used to get the next page of dryrun list. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of dryrun list. + * + * @param nextLink the nextLink value to set. + * @return the DryrunList object itself. + */ + public DryrunList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: The list of dryrun. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of dryrun. + * + * @param value the value value to set. + * @return the DryrunList object itself. + */ + public DryrunList 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/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunOperationPreview.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunOperationPreview.java new file mode 100644 index 000000000000..3f6375904dce --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunOperationPreview.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The preview of the operations for creation. */ +@Fluent +public final class DryrunOperationPreview { + /* + * The operation name + */ + @JsonProperty(value = "name") + private String name; + + /* + * The operation type + */ + @JsonProperty(value = "operationType") + private DryrunPreviewOperationType operationType; + + /* + * The description of the operation + */ + @JsonProperty(value = "description") + private String description; + + /* + * The action defined by RBAC, refer + * https://docs.microsoft.com/azure/role-based-access-control/role-definitions#actions-format + */ + @JsonProperty(value = "action") + private String action; + + /* + * The scope of the operation, refer https://docs.microsoft.com/azure/role-based-access-control/scope-overview + */ + @JsonProperty(value = "scope") + private String scope; + + /** Creates an instance of DryrunOperationPreview class. */ + public DryrunOperationPreview() { + } + + /** + * Get the name property: The operation name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The operation name. + * + * @param name the name value to set. + * @return the DryrunOperationPreview object itself. + */ + public DryrunOperationPreview withName(String name) { + this.name = name; + return this; + } + + /** + * Get the operationType property: The operation type. + * + * @return the operationType value. + */ + public DryrunPreviewOperationType operationType() { + return this.operationType; + } + + /** + * Set the operationType property: The operation type. + * + * @param operationType the operationType value to set. + * @return the DryrunOperationPreview object itself. + */ + public DryrunOperationPreview withOperationType(DryrunPreviewOperationType operationType) { + this.operationType = operationType; + return this; + } + + /** + * Get the description property: The description of the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the operation. + * + * @param description the description value to set. + * @return the DryrunOperationPreview object itself. + */ + public DryrunOperationPreview withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the action property: The action defined by RBAC, refer + * https://docs.microsoft.com/azure/role-based-access-control/role-definitions#actions-format. + * + * @return the action value. + */ + public String action() { + return this.action; + } + + /** + * Set the action property: The action defined by RBAC, refer + * https://docs.microsoft.com/azure/role-based-access-control/role-definitions#actions-format. + * + * @param action the action value to set. + * @return the DryrunOperationPreview object itself. + */ + public DryrunOperationPreview withAction(String action) { + this.action = action; + return this; + } + + /** + * Get the scope property: The scope of the operation, refer + * https://docs.microsoft.com/azure/role-based-access-control/scope-overview. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope property: The scope of the operation, refer + * https://docs.microsoft.com/azure/role-based-access-control/scope-overview. + * + * @param scope the scope value to set. + * @return the DryrunOperationPreview object itself. + */ + public DryrunOperationPreview withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunParameters.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunParameters.java new file mode 100644 index 000000000000..3a3d648fdaea --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunParameters.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The parameters of the dryrun. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "actionName", + defaultImpl = DryrunParameters.class) +@JsonTypeName("DryrunParameters") +@JsonSubTypes({@JsonSubTypes.Type(name = "createOrUpdate", value = CreateOrUpdateDryrunParameters.class)}) +@Immutable +public class DryrunParameters { + /** Creates an instance of DryrunParameters class. */ + public DryrunParameters() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunPatch.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunPatch.java new file mode 100644 index 000000000000..7a7c36d2da73 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunPatch.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.servicelinker.fluent.models.DryrunProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** a dryrun job to be updated. */ +@Fluent +public final class DryrunPatch { + /* + * The properties of the dryrun job. + */ + @JsonProperty(value = "properties") + private DryrunProperties innerProperties; + + /** Creates an instance of DryrunPatch class. */ + public DryrunPatch() { + } + + /** + * Get the innerProperties property: The properties of the dryrun job. + * + * @return the innerProperties value. + */ + private DryrunProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the parameters property: The parameters of the dryrun. + * + * @return the parameters value. + */ + public DryrunParameters parameters() { + return this.innerProperties() == null ? null : this.innerProperties().parameters(); + } + + /** + * Set the parameters property: The parameters of the dryrun. + * + * @param parameters the parameters value to set. + * @return the DryrunPatch object itself. + */ + public DryrunPatch withParameters(DryrunParameters parameters) { + if (this.innerProperties() == null) { + this.innerProperties = new DryrunProperties(); + } + this.innerProperties().withParameters(parameters); + return this; + } + + /** + * Get the prerequisiteResults property: the result of the dryrun. + * + * @return the prerequisiteResults value. + */ + public List prerequisiteResults() { + return this.innerProperties() == null ? null : this.innerProperties().prerequisiteResults(); + } + + /** + * Get the operationPreviews property: the preview of the operations for creation. + * + * @return the operationPreviews value. + */ + public List operationPreviews() { + return this.innerProperties() == null ? null : this.innerProperties().operationPreviews(); + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunPrerequisiteResult.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunPrerequisiteResult.java new file mode 100644 index 000000000000..54b386ae7dee --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunPrerequisiteResult.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.servicelinker.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** A result of dryrun. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + defaultImpl = DryrunPrerequisiteResult.class) +@JsonTypeName("DryrunPrerequisiteResult") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "basicError", value = BasicErrorDryrunPrerequisiteResult.class), + @JsonSubTypes.Type(name = "permissionsMissing", value = PermissionsMissingDryrunPrerequisiteResult.class) +}) +@Immutable +public class DryrunPrerequisiteResult { + /** Creates an instance of DryrunPrerequisiteResult class. */ + public DryrunPrerequisiteResult() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunPrerequisiteResultType.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunPrerequisiteResultType.java new file mode 100644 index 000000000000..07e325afa848 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunPrerequisiteResultType.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.servicelinker.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of dryrun result. */ +public final class DryrunPrerequisiteResultType extends ExpandableStringEnum { + /** Static value basicError for DryrunPrerequisiteResultType. */ + public static final DryrunPrerequisiteResultType BASIC_ERROR = fromString("basicError"); + + /** Static value permissionsMissing for DryrunPrerequisiteResultType. */ + public static final DryrunPrerequisiteResultType PERMISSIONS_MISSING = fromString("permissionsMissing"); + + /** + * Creates or finds a DryrunPrerequisiteResultType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DryrunPrerequisiteResultType. + */ + @JsonCreator + public static DryrunPrerequisiteResultType fromString(String name) { + return fromString(name, DryrunPrerequisiteResultType.class); + } + + /** + * Gets known DryrunPrerequisiteResultType values. + * + * @return known DryrunPrerequisiteResultType values. + */ + public static Collection values() { + return values(DryrunPrerequisiteResultType.class); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunPreviewOperationType.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunPreviewOperationType.java new file mode 100644 index 000000000000..a185ad3b9cbf --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunPreviewOperationType.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.servicelinker.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The operation type. */ +public final class DryrunPreviewOperationType extends ExpandableStringEnum { + /** Static value configConnection for DryrunPreviewOperationType. */ + public static final DryrunPreviewOperationType CONFIG_CONNECTION = fromString("configConnection"); + + /** Static value configNetwork for DryrunPreviewOperationType. */ + public static final DryrunPreviewOperationType CONFIG_NETWORK = fromString("configNetwork"); + + /** Static value configAuth for DryrunPreviewOperationType. */ + public static final DryrunPreviewOperationType CONFIG_AUTH = fromString("configAuth"); + + /** + * Creates or finds a DryrunPreviewOperationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DryrunPreviewOperationType. + */ + @JsonCreator + public static DryrunPreviewOperationType fromString(String name) { + return fromString(name, DryrunPreviewOperationType.class); + } + + /** + * Gets known DryrunPreviewOperationType values. + * + * @return known DryrunPreviewOperationType values. + */ + public static Collection values() { + return values(DryrunPreviewOperationType.class); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunResource.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunResource.java new file mode 100644 index 000000000000..af1e2b76838f --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunResource.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicelinker.fluent.models.DryrunResourceInner; +import java.util.List; + +/** An immutable client-side representation of DryrunResource. */ +public interface DryrunResource { + /** + * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the parameters property: The parameters of the dryrun. + * + * @return the parameters value. + */ + DryrunParameters parameters(); + + /** + * Gets the prerequisiteResults property: the result of the dryrun. + * + * @return the prerequisiteResults value. + */ + List prerequisiteResults(); + + /** + * Gets the operationPreviews property: the preview of the operations for creation. + * + * @return the operationPreviews value. + */ + List operationPreviews(); + + /** + * Gets the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.servicelinker.fluent.models.DryrunResourceInner object. + * + * @return the inner object. + */ + DryrunResourceInner innerModel(); + + /** The entirety of the DryrunResource definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The DryrunResource definition stages. */ + interface DefinitionStages { + /** The first stage of the DryrunResource definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the DryrunResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies subscriptionId, resourceGroupName, location. + * + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @return the next definition stage. + */ + WithCreate withExistingLocation(String subscriptionId, String resourceGroupName, String location); + } + /** + * The stage of the DryrunResource 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.WithParameters { + /** + * Executes the create request. + * + * @return the created resource. + */ + DryrunResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DryrunResource create(Context context); + } + /** The stage of the DryrunResource definition allowing to specify parameters. */ + interface WithParameters { + /** + * Specifies the parameters property: The parameters of the dryrun. + * + * @param parameters The parameters of the dryrun. + * @return the next definition stage. + */ + WithCreate withParameters(DryrunParameters parameters); + } + } + /** + * Begins update for the DryrunResource resource. + * + * @return the stage of resource update. + */ + DryrunResource.Update update(); + + /** The template for DryrunResource update. */ + interface Update extends UpdateStages.WithParameters { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DryrunResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DryrunResource apply(Context context); + } + /** The DryrunResource update stages. */ + interface UpdateStages { + /** The stage of the DryrunResource update allowing to specify parameters. */ + interface WithParameters { + /** + * Specifies the parameters property: The parameters of the dryrun. + * + * @param parameters The parameters of the dryrun. + * @return the next definition stage. + */ + Update withParameters(DryrunParameters parameters); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DryrunResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DryrunResource refresh(Context context); +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/FirewallRules.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/FirewallRules.java new file mode 100644 index 000000000000..e9c9fdbbe857 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/FirewallRules.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Target service's firewall rules. to allow connections from source service. */ +@Fluent +public final class FirewallRules { + /* + * This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed + * list of client IPs for a given database account. + */ + @JsonProperty(value = "ipRanges") + private List ipRanges; + + /* + * Allow Azure services to access the target service if true. + */ + @JsonProperty(value = "azureServices") + private AllowType azureServices; + + /* + * Allow caller client IP to access the target service if true. the property is used when connecting local + * application to target service. + */ + @JsonProperty(value = "callerClientIP") + private AllowType callerClientIp; + + /** Creates an instance of FirewallRules class. */ + public FirewallRules() { + } + + /** + * Get the ipRanges property: This value specifies the set of IP addresses or IP address ranges in CIDR form to be + * included as the allowed list of client IPs for a given database account. + * + * @return the ipRanges value. + */ + public List ipRanges() { + return this.ipRanges; + } + + /** + * Set the ipRanges property: This value specifies the set of IP addresses or IP address ranges in CIDR form to be + * included as the allowed list of client IPs for a given database account. + * + * @param ipRanges the ipRanges value to set. + * @return the FirewallRules object itself. + */ + public FirewallRules withIpRanges(List ipRanges) { + this.ipRanges = ipRanges; + return this; + } + + /** + * Get the azureServices property: Allow Azure services to access the target service if true. + * + * @return the azureServices value. + */ + public AllowType azureServices() { + return this.azureServices; + } + + /** + * Set the azureServices property: Allow Azure services to access the target service if true. + * + * @param azureServices the azureServices value to set. + * @return the FirewallRules object itself. + */ + public FirewallRules withAzureServices(AllowType azureServices) { + this.azureServices = azureServices; + return this; + } + + /** + * Get the callerClientIp property: Allow caller client IP to access the target service if true. the property is + * used when connecting local application to target service. + * + * @return the callerClientIp value. + */ + public AllowType callerClientIp() { + return this.callerClientIp; + } + + /** + * Set the callerClientIp property: Allow caller client IP to access the target service if true. the property is + * used when connecting local application to target service. + * + * @param callerClientIp the callerClientIp value to set. + * @return the FirewallRules object itself. + */ + public FirewallRules withCallerClientIp(AllowType callerClientIp) { + this.callerClientIp = callerClientIp; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/KeyVaultSecretReferenceSecretInfo.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/KeyVaultSecretReferenceSecretInfo.java index e3ff01f8b65e..98563f73dbf4 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/KeyVaultSecretReferenceSecretInfo.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/KeyVaultSecretReferenceSecretInfo.java @@ -29,6 +29,10 @@ public final class KeyVaultSecretReferenceSecretInfo extends SecretInfoBase { @JsonProperty(value = "version") private String version; + /** Creates an instance of KeyVaultSecretReferenceSecretInfo class. */ + public KeyVaultSecretReferenceSecretInfo() { + } + /** * Get the name property: Name of the Key Vault secret. * diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/KeyVaultSecretUriSecretInfo.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/KeyVaultSecretUriSecretInfo.java index c0d3e6cd3c9a..109036b10fcf 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/KeyVaultSecretUriSecretInfo.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/KeyVaultSecretUriSecretInfo.java @@ -23,6 +23,10 @@ public final class KeyVaultSecretUriSecretInfo extends SecretInfoBase { @JsonProperty(value = "value") private String value; + /** Creates an instance of KeyVaultSecretUriSecretInfo class. */ + public KeyVaultSecretUriSecretInfo() { + } + /** * Get the value property: URI to the keyvault secret. * diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/LinkerPatch.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/LinkerPatch.java index 1328a8126e43..915667321275 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/LinkerPatch.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/LinkerPatch.java @@ -8,7 +8,7 @@ import com.azure.resourcemanager.servicelinker.fluent.models.LinkerProperties; import com.fasterxml.jackson.annotation.JsonProperty; -/** A linker to be updated. */ +/** A Linker to be updated. */ @Fluent public final class LinkerPatch { /* @@ -17,6 +17,10 @@ public final class LinkerPatch { @JsonProperty(value = "properties") private LinkerProperties innerProperties; + /** Creates an instance of LinkerPatch class. */ + public LinkerPatch() { + } + /** * Get the innerProperties property: Linker properties. * @@ -173,6 +177,54 @@ public LinkerPatch withScope(String scope) { return this; } + /** + * Get the publicNetworkSolution property: The network solution. + * + * @return the publicNetworkSolution value. + */ + public PublicNetworkSolution publicNetworkSolution() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkSolution(); + } + + /** + * Set the publicNetworkSolution property: The network solution. + * + * @param publicNetworkSolution the publicNetworkSolution value to set. + * @return the LinkerPatch object itself. + */ + public LinkerPatch withPublicNetworkSolution(PublicNetworkSolution publicNetworkSolution) { + if (this.innerProperties() == null) { + this.innerProperties = new LinkerProperties(); + } + this.innerProperties().withPublicNetworkSolution(publicNetworkSolution); + return this; + } + + /** + * Get the configurationInfo property: The connection information consumed by applications, including secrets, + * connection strings. + * + * @return the configurationInfo value. + */ + public ConfigurationInfo configurationInfo() { + return this.innerProperties() == null ? null : this.innerProperties().configurationInfo(); + } + + /** + * Set the configurationInfo property: The connection information consumed by applications, including secrets, + * connection strings. + * + * @param configurationInfo the configurationInfo value to set. + * @return the LinkerPatch object itself. + */ + public LinkerPatch withConfigurationInfo(ConfigurationInfo configurationInfo) { + if (this.innerProperties() == null) { + this.innerProperties = new LinkerProperties(); + } + this.innerProperties().withConfigurationInfo(configurationInfo); + return this; + } + /** * Validates the instance. * diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/LinkerResource.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/LinkerResource.java index c98ee1fd3c03..cc978138345a 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/LinkerResource.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/LinkerResource.java @@ -33,7 +33,7 @@ public interface LinkerResource { String type(); /** - * Gets the systemData property: The system data. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -88,6 +88,28 @@ public interface LinkerResource { */ String scope(); + /** + * Gets the publicNetworkSolution property: The network solution. + * + * @return the publicNetworkSolution value. + */ + PublicNetworkSolution publicNetworkSolution(); + + /** + * Gets the configurationInfo property: The connection information consumed by applications, including secrets, + * connection strings. + * + * @return the configurationInfo value. + */ + ConfigurationInfo configurationInfo(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.servicelinker.fluent.models.LinkerResourceInner object. * @@ -96,22 +118,25 @@ public interface LinkerResource { LinkerResourceInner innerModel(); /** The entirety of the LinkerResource definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScopeStage, DefinitionStages.WithCreate { + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } /** The LinkerResource definition stages. */ interface DefinitionStages { /** The first stage of the LinkerResource definition. */ - interface Blank extends WithScopeStage { + interface Blank extends WithParentResource { } /** The stage of the LinkerResource definition allowing to specify parent resource. */ - interface WithScopeStage { + interface WithParentResource { /** - * Specifies resourceUri. + * Specifies subscriptionId, resourceGroupName, location. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param subscriptionId The ID of the target subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. * @return the next definition stage. */ - WithCreate withExistingResourceUri(String resourceUri); + WithCreate withExistingLocation(String subscriptionId, String resourceGroupName, String location); } /** * The stage of the LinkerResource definition which contains all the minimum required properties for the @@ -123,7 +148,9 @@ interface WithCreate DefinitionStages.WithClientType, DefinitionStages.WithVNetSolution, DefinitionStages.WithSecretStore, - DefinitionStages.WithScope { + DefinitionStages.WithScope, + DefinitionStages.WithPublicNetworkSolution, + DefinitionStages.WithConfigurationInfo { /** * Executes the create request. * @@ -199,6 +226,28 @@ interface WithScope { */ WithCreate withScope(String scope); } + /** The stage of the LinkerResource definition allowing to specify publicNetworkSolution. */ + interface WithPublicNetworkSolution { + /** + * Specifies the publicNetworkSolution property: The network solution.. + * + * @param publicNetworkSolution The network solution. + * @return the next definition stage. + */ + WithCreate withPublicNetworkSolution(PublicNetworkSolution publicNetworkSolution); + } + /** The stage of the LinkerResource definition allowing to specify configurationInfo. */ + interface WithConfigurationInfo { + /** + * Specifies the configurationInfo property: The connection information consumed by applications, including + * secrets, connection strings.. + * + * @param configurationInfo The connection information consumed by applications, including secrets, + * connection strings. + * @return the next definition stage. + */ + WithCreate withConfigurationInfo(ConfigurationInfo configurationInfo); + } } /** * Begins update for the LinkerResource resource. @@ -214,7 +263,9 @@ interface Update UpdateStages.WithClientType, UpdateStages.WithVNetSolution, UpdateStages.WithSecretStore, - UpdateStages.WithScope { + UpdateStages.WithScope, + UpdateStages.WithPublicNetworkSolution, + UpdateStages.WithConfigurationInfo { /** * Executes the update request. * @@ -292,6 +343,28 @@ interface WithScope { */ Update withScope(String scope); } + /** The stage of the LinkerResource update allowing to specify publicNetworkSolution. */ + interface WithPublicNetworkSolution { + /** + * Specifies the publicNetworkSolution property: The network solution.. + * + * @param publicNetworkSolution The network solution. + * @return the next definition stage. + */ + Update withPublicNetworkSolution(PublicNetworkSolution publicNetworkSolution); + } + /** The stage of the LinkerResource update allowing to specify configurationInfo. */ + interface WithConfigurationInfo { + /** + * Specifies the configurationInfo property: The connection information consumed by applications, including + * secrets, connection strings.. + * + * @param configurationInfo The connection information consumed by applications, including secrets, + * connection strings. + * @return the next definition stage. + */ + Update withConfigurationInfo(ConfigurationInfo configurationInfo); + } } /** * Refreshes the resource to sync with Azure. @@ -309,43 +382,44 @@ interface WithScope { LinkerResource refresh(Context context); /** - * Validate a link. + * Validate a Connector. * * @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 validation operation result for a linker. + * @return the validation operation result for a Linker. */ ValidateOperationResult validate(); /** - * Validate a link. + * Validate a Connector. * * @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 validation operation result for a linker. + * @return the validation operation result for a Linker. */ ValidateOperationResult validate(Context context); /** - * list source configurations for a linker. + * Generate configurations for a Connector. * + * @param parameters Connection Info, including format, secret store, etc. + * @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 configurations for source resource, include appSettings, connectionString and serviceBindings. + * @return configurations for source resource, include appSettings, connectionString and serviceBindings along with + * {@link Response}. */ - SourceConfigurationResult listConfigurations(); + Response generateConfigurationsWithResponse(ConfigurationInfo parameters, Context context); /** - * list source configurations for a linker. + * Generate configurations for a Connector. * - * @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 configurations for source resource, include appSettings, connectionString and serviceBindings along with - * {@link Response}. + * @return configurations for source resource, include appSettings, connectionString and serviceBindings. */ - Response listConfigurationsWithResponse(Context context); + ConfigurationResult generateConfigurations(); } diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/Linkers.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/Linkers.java index 745ca32af706..21e2ff8b8269 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/Linkers.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/Linkers.java @@ -7,11 +7,13 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.servicelinker.fluent.models.LinkerResourceInner; /** Resource collection API of Linkers. */ public interface Linkers { /** - * Returns list of Linkers which connects to the resource. + * Returns list of Linkers which connects to the resource. which supports to config both application and target + * service during the resource provision. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -22,7 +24,8 @@ public interface Linkers { PagedIterable list(String resourceUri); /** - * Returns list of Linkers which connects to the resource. + * Returns list of Linkers which connects to the resource. which supports to config both application and target + * service during the resource provision. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param context The context to associate with this operation. @@ -38,63 +41,67 @@ public interface Linkers { * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker 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 linker of source and target resource. + * @return linker of source and target resource along with {@link Response}. */ - LinkerResource get(String resourceUri, String linkerName); + Response getWithResponse(String resourceUri, String linkerName, Context context); /** * Returns Linker resource for a given name. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker 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 linker of source and target resource along with {@link Response}. + * @return linker of source and target resource. */ - Response getWithResponse(String resourceUri, String linkerName, Context context); + LinkerResource get(String resourceUri, String linkerName); /** - * Delete a link. + * Create or update Linker resource. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. + * @param parameters Linker details. * @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 linker of source and target resource. */ - void deleteByResourceGroup(String resourceUri, String linkerName); + LinkerResource createOrUpdate(String resourceUri, String linkerName, LinkerResourceInner parameters); /** - * Delete a link. + * Create or update Linker resource. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. + * @param parameters Linker details. * @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 linker of source and target resource. */ - void delete(String resourceUri, String linkerName, Context context); + LinkerResource createOrUpdate( + String resourceUri, String linkerName, LinkerResourceInner parameters, Context context); /** - * Validate a link. + * Delete a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. * @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 validation operation result for a linker. */ - ValidateOperationResult validate(String resourceUri, String linkerName); + void deleteByResourceGroup(String resourceUri, String linkerName); /** - * Validate a link. + * Delete a Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. @@ -102,86 +109,85 @@ public interface Linkers { * @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 validation operation result for a linker. */ - ValidateOperationResult validate(String resourceUri, String linkerName, Context context); + void delete(String resourceUri, String linkerName, Context context); /** - * list source configurations for a linker. + * Operation to update an existing Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. + * @param parameters Linker details. * @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 configurations for source resource, include appSettings, connectionString and serviceBindings. + * @return linker of source and target resource. */ - SourceConfigurationResult listConfigurations(String resourceUri, String linkerName); + LinkerResource update(String resourceUri, String linkerName, LinkerPatch parameters); /** - * list source configurations for a linker. + * Operation to update an existing Linker. * * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. * @param linkerName The name Linker resource. + * @param parameters Linker details. * @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 configurations for source resource, include appSettings, connectionString and serviceBindings along with - * {@link Response}. + * @return linker of source and target resource. */ - Response listConfigurationsWithResponse( - String resourceUri, String linkerName, Context context); + LinkerResource update(String resourceUri, String linkerName, LinkerPatch parameters, Context context); /** - * Returns Linker resource for a given name. + * Validate a Linker. * - * @param id the resource ID. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param linkerName The name Linker resource. * @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 linker of source and target resource along with {@link Response}. + * @return the validation operation result for a Linker. */ - LinkerResource getById(String id); + ValidateOperationResult validate(String resourceUri, String linkerName); /** - * Returns Linker resource for a given name. + * Validate a Linker. * - * @param id the resource ID. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param linkerName The name Linker 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 linker of source and target resource along with {@link Response}. + * @return the validation operation result for a Linker. */ - Response getByIdWithResponse(String id, Context context); + ValidateOperationResult validate(String resourceUri, String linkerName, Context context); /** - * Delete a link. + * list source configurations for a Linker. * - * @param id the resource ID. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param linkerName The name Linker 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 configurations for source resource, include appSettings, connectionString and serviceBindings along with + * {@link Response}. */ - void deleteById(String id); + Response listConfigurationsWithResponse( + String resourceUri, String linkerName, Context context); /** - * Delete a link. + * list source configurations for a Linker. * - * @param id the resource ID. - * @param context The context to associate with this operation. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param linkerName The name Linker resource. * @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 configurations for source resource, include appSettings, connectionString and serviceBindings. */ - void deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new LinkerResource resource. - * - * @param name resource name. - * @return the first stage of the new LinkerResource definition. - */ - LinkerResource.DefinitionStages.Blank define(String name); + ConfigurationResult listConfigurations(String resourceUri, String linkerName); } diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/LinkersOperations.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/LinkersOperations.java new file mode 100644 index 000000000000..8dfd3558ce8f --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/LinkersOperations.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicelinker.fluent.models.DryrunResourceInner; + +/** Resource collection API of LinkersOperations. */ +public interface LinkersOperations { + /** + * list dryrun jobs. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @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 dryrun as paginated response with {@link PagedIterable}. + */ + PagedIterable listDryrun(String resourceUri); + + /** + * list dryrun jobs. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @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 dryrun as paginated response with {@link PagedIterable}. + */ + PagedIterable listDryrun(String resourceUri, Context context); + + /** + * get a dryrun job. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @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 a dryrun job along with {@link Response}. + */ + Response getDryrunWithResponse(String resourceUri, String dryrunName, Context context); + + /** + * get a dryrun job. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @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 a dryrun job. + */ + DryrunResource getDryrun(String resourceUri, String dryrunName); + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @param parameters dryrun resource. + * @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 a dryrun job resource. + */ + DryrunResource createDryrun(String resourceUri, String dryrunName, DryrunResourceInner parameters); + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @param parameters dryrun 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 a dryrun job resource. + */ + DryrunResource createDryrun(String resourceUri, String dryrunName, DryrunResourceInner parameters, Context context); + + /** + * add a dryrun job to do necessary check before actual creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @param parameters dryrun resource. + * @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 a dryrun job resource. + */ + DryrunResource updateDryrun(String resourceUri, String dryrunName, DryrunPatch parameters); + + /** + * add a dryrun job to do necessary check before actual creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @param parameters dryrun 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 a dryrun job resource. + */ + DryrunResource updateDryrun(String resourceUri, String dryrunName, DryrunPatch parameters, Context context); + + /** + * delete a dryrun job. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @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 deleteDryrunWithResponse(String resourceUri, String dryrunName, Context context); + + /** + * delete a dryrun job. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param dryrunName The name of dryrun. + * @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 deleteDryrun(String resourceUri, String dryrunName); + + /** + * Generate configurations for a Linker. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param linkerName The name Linker resource. + * @param parameters Connection Info, including format, secret store, etc. + * @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 configurations for source resource, include appSettings, connectionString and serviceBindings along with + * {@link Response}. + */ + Response generateConfigurationsWithResponse( + String resourceUri, String linkerName, ConfigurationInfo parameters, Context context); + + /** + * Generate configurations for a Linker. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param linkerName The name Linker resource. + * @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 configurations for source resource, include appSettings, connectionString and serviceBindings. + */ + ConfigurationResult generateConfigurations(String resourceUri, String linkerName); +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/OperationDisplay.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/OperationDisplay.java index 7def6a8572ed..b4e1c70f0a20 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/OperationDisplay.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/OperationDisplay.java @@ -11,34 +11,36 @@ @Immutable public final class OperationDisplay { /* - * The localized friendly form of the resource provider name, e.g. - * "Microsoft Monitoring Insights" or "Microsoft Compute". + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft + * Compute". */ @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) private String provider; /* - * The localized friendly name of the resource type related to this - * operation. E.g. "Virtual Machines" or "Job Schedule Collections". + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job + * Schedule Collections". */ @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) private String resource; /* - * The concise, localized friendly name for the operation; suitable for - * dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual - * Machine". + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual + * Machine", "Restart Virtual Machine". */ @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) private String operation; /* - * The short, localized friendly description of the operation; suitable for - * tool tips and detailed views. + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. */ @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { + } + /** * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring * Insights" or "Microsoft Compute". diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/OperationListResult.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/OperationListResult.java index e67087ab4762..6df30ea4a846 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/OperationListResult.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/OperationListResult.java @@ -27,6 +27,10 @@ public final class OperationListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of OperationListResult class. */ + public OperationListResult() { + } + /** * Get the value property: List of operations supported by the resource provider. * diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/Origin.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/Origin.java index 4b62b0bbe7c9..18ac9adc6654 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/Origin.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/Origin.java @@ -8,7 +8,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for Origin. */ +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ public final class Origin extends ExpandableStringEnum { /** Static value user for Origin. */ public static final Origin USER = fromString("user"); diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/PermissionsMissingDryrunPrerequisiteResult.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/PermissionsMissingDryrunPrerequisiteResult.java new file mode 100644 index 000000000000..6cb8cc56d2ea --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/PermissionsMissingDryrunPrerequisiteResult.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** The represent of missing permissions. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("permissionsMissing") +@Fluent +public final class PermissionsMissingDryrunPrerequisiteResult extends DryrunPrerequisiteResult { + /* + * The permission scope + */ + @JsonProperty(value = "scope") + private String scope; + + /* + * The permission list + */ + @JsonProperty(value = "permissions") + private List permissions; + + /* + * The recommended role to resolve permissions missing + */ + @JsonProperty(value = "recommendedRole") + private String recommendedRole; + + /** Creates an instance of PermissionsMissingDryrunPrerequisiteResult class. */ + public PermissionsMissingDryrunPrerequisiteResult() { + } + + /** + * Get the scope property: The permission scope. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope property: The permission scope. + * + * @param scope the scope value to set. + * @return the PermissionsMissingDryrunPrerequisiteResult object itself. + */ + public PermissionsMissingDryrunPrerequisiteResult withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the permissions property: The permission list. + * + * @return the permissions value. + */ + public List permissions() { + return this.permissions; + } + + /** + * Set the permissions property: The permission list. + * + * @param permissions the permissions value to set. + * @return the PermissionsMissingDryrunPrerequisiteResult object itself. + */ + public PermissionsMissingDryrunPrerequisiteResult withPermissions(List permissions) { + this.permissions = permissions; + return this; + } + + /** + * Get the recommendedRole property: The recommended role to resolve permissions missing. + * + * @return the recommendedRole value. + */ + public String recommendedRole() { + return this.recommendedRole; + } + + /** + * Set the recommendedRole property: The recommended role to resolve permissions missing. + * + * @param recommendedRole the recommendedRole value to set. + * @return the PermissionsMissingDryrunPrerequisiteResult object itself. + */ + public PermissionsMissingDryrunPrerequisiteResult withRecommendedRole(String recommendedRole) { + this.recommendedRole = recommendedRole; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/PublicNetworkSolution.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/PublicNetworkSolution.java new file mode 100644 index 000000000000..d1bd1999d725 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/PublicNetworkSolution.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.servicelinker.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Indicates public network solution, include firewall rules. */ +@Fluent +public final class PublicNetworkSolution { + /* + * Indicates whether to clean up previous operation(such as firewall rules) when Linker is updating or deleting + */ + @JsonProperty(value = "deleteOrUpdateBehavior") + private DeleteOrUpdateBehavior deleteOrUpdateBehavior; + + /* + * Optional. Indicates public network solution. If enable, enable public network access of target service with best + * try. Default is enable. If optOut, opt out public network access configuration. + */ + @JsonProperty(value = "action") + private ActionType action; + + /* + * Describe firewall rules of target service to make sure source application could connect to the target. + */ + @JsonProperty(value = "firewallRules") + private FirewallRules firewallRules; + + /** Creates an instance of PublicNetworkSolution class. */ + public PublicNetworkSolution() { + } + + /** + * Get the deleteOrUpdateBehavior property: Indicates whether to clean up previous operation(such as firewall rules) + * when Linker is updating or deleting. + * + * @return the deleteOrUpdateBehavior value. + */ + public DeleteOrUpdateBehavior deleteOrUpdateBehavior() { + return this.deleteOrUpdateBehavior; + } + + /** + * Set the deleteOrUpdateBehavior property: Indicates whether to clean up previous operation(such as firewall rules) + * when Linker is updating or deleting. + * + * @param deleteOrUpdateBehavior the deleteOrUpdateBehavior value to set. + * @return the PublicNetworkSolution object itself. + */ + public PublicNetworkSolution withDeleteOrUpdateBehavior(DeleteOrUpdateBehavior deleteOrUpdateBehavior) { + this.deleteOrUpdateBehavior = deleteOrUpdateBehavior; + return this; + } + + /** + * Get the action property: Optional. Indicates public network solution. If enable, enable public network access of + * target service with best try. Default is enable. If optOut, opt out public network access configuration. + * + * @return the action value. + */ + public ActionType action() { + return this.action; + } + + /** + * Set the action property: Optional. Indicates public network solution. If enable, enable public network access of + * target service with best try. Default is enable. If optOut, opt out public network access configuration. + * + * @param action the action value to set. + * @return the PublicNetworkSolution object itself. + */ + public PublicNetworkSolution withAction(ActionType action) { + this.action = action; + return this; + } + + /** + * Get the firewallRules property: Describe firewall rules of target service to make sure source application could + * connect to the target. + * + * @return the firewallRules value. + */ + public FirewallRules firewallRules() { + return this.firewallRules; + } + + /** + * Set the firewallRules property: Describe firewall rules of target service to make sure source application could + * connect to the target. + * + * @param firewallRules the firewallRules value to set. + * @return the PublicNetworkSolution object itself. + */ + public PublicNetworkSolution withFirewallRules(FirewallRules firewallRules) { + this.firewallRules = firewallRules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (firewallRules() != null) { + firewallRules().validate(); + } + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/LinkerList.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ResourceList.java similarity index 72% rename from sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/LinkerList.java rename to sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ResourceList.java index d3b63c7c0ba6..a4b28a3d705e 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/LinkerList.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ResourceList.java @@ -11,9 +11,9 @@ /** The list of Linker. */ @Fluent -public final class LinkerList { +public final class ResourceList { /* - * The link used to get the next page of Linker list. + * The Linker used to get the next page of Linker list. */ @JsonProperty(value = "nextLink") private String nextLink; @@ -24,8 +24,12 @@ public final class LinkerList { @JsonProperty(value = "value") private List value; + /** Creates an instance of ResourceList class. */ + public ResourceList() { + } + /** - * Get the nextLink property: The link used to get the next page of Linker list. + * Get the nextLink property: The Linker used to get the next page of Linker list. * * @return the nextLink value. */ @@ -34,12 +38,12 @@ public String nextLink() { } /** - * Set the nextLink property: The link used to get the next page of Linker list. + * Set the nextLink property: The Linker used to get the next page of Linker list. * * @param nextLink the nextLink value to set. - * @return the LinkerList object itself. + * @return the ResourceList object itself. */ - public LinkerList withNextLink(String nextLink) { + public ResourceList withNextLink(String nextLink) { this.nextLink = nextLink; return this; } @@ -57,9 +61,9 @@ public List value() { * Set the value property: The list of Linkers. * * @param value the value value to set. - * @return the LinkerList object itself. + * @return the ResourceList object itself. */ - public LinkerList withValue(List value) { + public ResourceList withValue(List value) { this.value = value; return this; } diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SecretAuthInfo.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SecretAuthInfo.java index a3c86beaa531..4ba424a776e6 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SecretAuthInfo.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SecretAuthInfo.java @@ -26,6 +26,10 @@ public final class SecretAuthInfo extends AuthInfoBase { @JsonProperty(value = "secretInfo") private SecretInfoBase secretInfo; + /** Creates an instance of SecretAuthInfo class. */ + public SecretAuthInfo() { + } + /** * Get the name property: Username or account name for secret auth. * diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SecretInfoBase.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SecretInfoBase.java index 1be6c07d0781..b743e1f91d00 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SecretInfoBase.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SecretInfoBase.java @@ -23,6 +23,10 @@ }) @Immutable public class SecretInfoBase { + /** Creates an instance of SecretInfoBase class. */ + public SecretInfoBase() { + } + /** * Validates the instance. * diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SecretStore.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SecretStore.java index 626bbf876330..29fe865a0db7 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SecretStore.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SecretStore.java @@ -16,6 +16,16 @@ public final class SecretStore { @JsonProperty(value = "keyVaultId") private String keyVaultId; + /* + * The key vault secret name to store secret, only valid when storing one secret + */ + @JsonProperty(value = "keyVaultSecretName") + private String keyVaultSecretName; + + /** Creates an instance of SecretStore class. */ + public SecretStore() { + } + /** * Get the keyVaultId property: The key vault id to store secret. * @@ -36,6 +46,28 @@ public SecretStore withKeyVaultId(String keyVaultId) { return this; } + /** + * Get the keyVaultSecretName property: The key vault secret name to store secret, only valid when storing one + * secret. + * + * @return the keyVaultSecretName value. + */ + public String keyVaultSecretName() { + return this.keyVaultSecretName; + } + + /** + * Set the keyVaultSecretName property: The key vault secret name to store secret, only valid when storing one + * secret. + * + * @param keyVaultSecretName the keyVaultSecretName value to set. + * @return the SecretStore object itself. + */ + public SecretStore withKeyVaultSecretName(String keyVaultSecretName) { + this.keyVaultSecretName = keyVaultSecretName; + return this; + } + /** * Validates the instance. * diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SecretType.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SecretType.java index 4d9a05cf41f7..11eb6c4dafea 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SecretType.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SecretType.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for SecretType. */ +/** The secret type. */ public final class SecretType extends ExpandableStringEnum { /** Static value rawValue for SecretType. */ public static final SecretType RAW_VALUE = fromString("rawValue"); diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SelfHostedServer.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SelfHostedServer.java new file mode 100644 index 000000000000..85e8f0523523 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SelfHostedServer.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The service properties when target service type is SelfHostedServer. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("SelfHostedServer") +@Fluent +public final class SelfHostedServer extends TargetServiceBase { + /* + * The endpoint of service. + */ + @JsonProperty(value = "endpoint") + private String endpoint; + + /** Creates an instance of SelfHostedServer class. */ + public SelfHostedServer() { + } + + /** + * Get the endpoint property: The endpoint of service. + * + * @return the endpoint value. + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Set the endpoint property: The endpoint of service. + * + * @param endpoint the endpoint value to set. + * @return the SelfHostedServer object itself. + */ + public SelfHostedServer withEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ServicePrincipalCertificateAuthInfo.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ServicePrincipalCertificateAuthInfo.java index dc9e1d46c572..4fc73920b6e3 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ServicePrincipalCertificateAuthInfo.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ServicePrincipalCertificateAuthInfo.java @@ -9,6 +9,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; /** The authentication info when authType is servicePrincipal certificate. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "authType") @@ -33,6 +34,22 @@ public final class ServicePrincipalCertificateAuthInfo extends AuthInfoBase { @JsonProperty(value = "certificate", required = true) private String certificate; + /* + * Indicates whether to clean up previous operation when Linker is updating or deleting + */ + @JsonProperty(value = "deleteOrUpdateBehavior") + private DeleteOrUpdateBehavior deleteOrUpdateBehavior; + + /* + * Optional, this value specifies the Azure roles to be assigned. Automatically + */ + @JsonProperty(value = "roles") + private List roles; + + /** Creates an instance of ServicePrincipalCertificateAuthInfo class. */ + public ServicePrincipalCertificateAuthInfo() { + } + /** * Get the clientId property: Application clientId for servicePrincipal auth. * @@ -93,6 +110,49 @@ public ServicePrincipalCertificateAuthInfo withCertificate(String certificate) { return this; } + /** + * Get the deleteOrUpdateBehavior property: Indicates whether to clean up previous operation when Linker is updating + * or deleting. + * + * @return the deleteOrUpdateBehavior value. + */ + public DeleteOrUpdateBehavior deleteOrUpdateBehavior() { + return this.deleteOrUpdateBehavior; + } + + /** + * Set the deleteOrUpdateBehavior property: Indicates whether to clean up previous operation when Linker is updating + * or deleting. + * + * @param deleteOrUpdateBehavior the deleteOrUpdateBehavior value to set. + * @return the ServicePrincipalCertificateAuthInfo object itself. + */ + public ServicePrincipalCertificateAuthInfo withDeleteOrUpdateBehavior( + DeleteOrUpdateBehavior deleteOrUpdateBehavior) { + this.deleteOrUpdateBehavior = deleteOrUpdateBehavior; + return this; + } + + /** + * Get the roles property: Optional, this value specifies the Azure roles to be assigned. Automatically. + * + * @return the roles value. + */ + public List roles() { + return this.roles; + } + + /** + * Set the roles property: Optional, this value specifies the Azure roles to be assigned. Automatically. + * + * @param roles the roles value to set. + * @return the ServicePrincipalCertificateAuthInfo object itself. + */ + public ServicePrincipalCertificateAuthInfo withRoles(List roles) { + this.roles = roles; + return this; + } + /** * Validates the instance. * diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ServicePrincipalSecretAuthInfo.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ServicePrincipalSecretAuthInfo.java index 97ccd04b48fc..7d659096cde7 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ServicePrincipalSecretAuthInfo.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ServicePrincipalSecretAuthInfo.java @@ -9,6 +9,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; /** The authentication info when authType is servicePrincipal secret. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "authType") @@ -33,6 +34,28 @@ public final class ServicePrincipalSecretAuthInfo extends AuthInfoBase { @JsonProperty(value = "secret", required = true) private String secret; + /* + * Indicates whether to clean up previous operation when Linker is updating or deleting + */ + @JsonProperty(value = "deleteOrUpdateBehavior") + private DeleteOrUpdateBehavior deleteOrUpdateBehavior; + + /* + * Optional, this value specifies the Azure roles to be assigned. Automatically + */ + @JsonProperty(value = "roles") + private List roles; + + /* + * Username created in the database which is mapped to a user in AAD. + */ + @JsonProperty(value = "userName") + private String username; + + /** Creates an instance of ServicePrincipalSecretAuthInfo class. */ + public ServicePrincipalSecretAuthInfo() { + } + /** * Get the clientId property: ServicePrincipal application clientId for servicePrincipal auth. * @@ -93,6 +116,68 @@ public ServicePrincipalSecretAuthInfo withSecret(String secret) { return this; } + /** + * Get the deleteOrUpdateBehavior property: Indicates whether to clean up previous operation when Linker is updating + * or deleting. + * + * @return the deleteOrUpdateBehavior value. + */ + public DeleteOrUpdateBehavior deleteOrUpdateBehavior() { + return this.deleteOrUpdateBehavior; + } + + /** + * Set the deleteOrUpdateBehavior property: Indicates whether to clean up previous operation when Linker is updating + * or deleting. + * + * @param deleteOrUpdateBehavior the deleteOrUpdateBehavior value to set. + * @return the ServicePrincipalSecretAuthInfo object itself. + */ + public ServicePrincipalSecretAuthInfo withDeleteOrUpdateBehavior(DeleteOrUpdateBehavior deleteOrUpdateBehavior) { + this.deleteOrUpdateBehavior = deleteOrUpdateBehavior; + return this; + } + + /** + * Get the roles property: Optional, this value specifies the Azure roles to be assigned. Automatically. + * + * @return the roles value. + */ + public List roles() { + return this.roles; + } + + /** + * Set the roles property: Optional, this value specifies the Azure roles to be assigned. Automatically. + * + * @param roles the roles value to set. + * @return the ServicePrincipalSecretAuthInfo object itself. + */ + public ServicePrincipalSecretAuthInfo withRoles(List roles) { + this.roles = roles; + return this; + } + + /** + * Get the username property: Username created in the database which is mapped to a user in AAD. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: Username created in the database which is mapped to a user in AAD. + * + * @param username the username value to set. + * @return the ServicePrincipalSecretAuthInfo object itself. + */ + public ServicePrincipalSecretAuthInfo withUsername(String username) { + this.username = username; + return this; + } + /** * Validates the instance. * diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SourceConfiguration.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SourceConfiguration.java index 3311bebb78d6..38f0c9ae66a7 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SourceConfiguration.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SourceConfiguration.java @@ -22,6 +22,10 @@ public final class SourceConfiguration { @JsonProperty(value = "value") private String value; + /** Creates an instance of SourceConfiguration class. */ + public SourceConfiguration() { + } + /** * Get the name property: The name of setting. * diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SystemAssignedIdentityAuthInfo.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SystemAssignedIdentityAuthInfo.java index 2548428a6cd9..5ba1960bcd2e 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SystemAssignedIdentityAuthInfo.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SystemAssignedIdentityAuthInfo.java @@ -4,15 +4,101 @@ package com.azure.resourcemanager.servicelinker.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; /** The authentication info when authType is systemAssignedIdentity. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "authType") @JsonTypeName("systemAssignedIdentity") -@Immutable +@Fluent public final class SystemAssignedIdentityAuthInfo extends AuthInfoBase { + /* + * Indicates whether to clean up previous operation when Linker is updating or deleting + */ + @JsonProperty(value = "deleteOrUpdateBehavior") + private DeleteOrUpdateBehavior deleteOrUpdateBehavior; + + /* + * Optional, this value specifies the Azure role to be assigned + */ + @JsonProperty(value = "roles") + private List roles; + + /* + * Username created in the database which is mapped to a user in AAD. + */ + @JsonProperty(value = "userName") + private String username; + + /** Creates an instance of SystemAssignedIdentityAuthInfo class. */ + public SystemAssignedIdentityAuthInfo() { + } + + /** + * Get the deleteOrUpdateBehavior property: Indicates whether to clean up previous operation when Linker is updating + * or deleting. + * + * @return the deleteOrUpdateBehavior value. + */ + public DeleteOrUpdateBehavior deleteOrUpdateBehavior() { + return this.deleteOrUpdateBehavior; + } + + /** + * Set the deleteOrUpdateBehavior property: Indicates whether to clean up previous operation when Linker is updating + * or deleting. + * + * @param deleteOrUpdateBehavior the deleteOrUpdateBehavior value to set. + * @return the SystemAssignedIdentityAuthInfo object itself. + */ + public SystemAssignedIdentityAuthInfo withDeleteOrUpdateBehavior(DeleteOrUpdateBehavior deleteOrUpdateBehavior) { + this.deleteOrUpdateBehavior = deleteOrUpdateBehavior; + return this; + } + + /** + * Get the roles property: Optional, this value specifies the Azure role to be assigned. + * + * @return the roles value. + */ + public List roles() { + return this.roles; + } + + /** + * Set the roles property: Optional, this value specifies the Azure role to be assigned. + * + * @param roles the roles value to set. + * @return the SystemAssignedIdentityAuthInfo object itself. + */ + public SystemAssignedIdentityAuthInfo withRoles(List roles) { + this.roles = roles; + return this; + } + + /** + * Get the username property: Username created in the database which is mapped to a user in AAD. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: Username created in the database which is mapped to a user in AAD. + * + * @param username the username value to set. + * @return the SystemAssignedIdentityAuthInfo object itself. + */ + public SystemAssignedIdentityAuthInfo withUsername(String username) { + this.username = username; + return this; + } + /** * Validates the instance. * diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/TargetServiceBase.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/TargetServiceBase.java index 1238b95ce799..c6cb06785ee1 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/TargetServiceBase.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/TargetServiceBase.java @@ -19,10 +19,15 @@ @JsonSubTypes({ @JsonSubTypes.Type(name = "AzureResource", value = AzureResource.class), @JsonSubTypes.Type(name = "ConfluentBootstrapServer", value = ConfluentBootstrapServer.class), + @JsonSubTypes.Type(name = "SelfHostedServer", value = SelfHostedServer.class), @JsonSubTypes.Type(name = "ConfluentSchemaRegistry", value = ConfluentSchemaRegistry.class) }) @Immutable public class TargetServiceBase { + /** Creates an instance of TargetServiceBase class. */ + public TargetServiceBase() { + } + /** * Validates the instance. * diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/TargetServiceType.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/TargetServiceType.java index 4d11eaf03f4b..a1d02c30d1cd 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/TargetServiceType.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/TargetServiceType.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for TargetServiceType. */ +/** The target service type. */ public final class TargetServiceType extends ExpandableStringEnum { /** Static value AzureResource for TargetServiceType. */ public static final TargetServiceType AZURE_RESOURCE = fromString("AzureResource"); @@ -19,6 +19,9 @@ public final class TargetServiceType extends ExpandableStringEnum roles; + + /* + * Username created in the database which is mapped to a user in AAD. + */ + @JsonProperty(value = "userName") + private String username; + + /** Creates an instance of UserAccountAuthInfo class. */ + public UserAccountAuthInfo() { + } + + /** + * Get the principalId property: Principal Id for user account. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: Principal Id for user account. + * + * @param principalId the principalId value to set. + * @return the UserAccountAuthInfo object itself. + */ + public UserAccountAuthInfo withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the deleteOrUpdateBehavior property: Indicates whether to clean up previous operation when Linker is updating + * or deleting. + * + * @return the deleteOrUpdateBehavior value. + */ + public DeleteOrUpdateBehavior deleteOrUpdateBehavior() { + return this.deleteOrUpdateBehavior; + } + + /** + * Set the deleteOrUpdateBehavior property: Indicates whether to clean up previous operation when Linker is updating + * or deleting. + * + * @param deleteOrUpdateBehavior the deleteOrUpdateBehavior value to set. + * @return the UserAccountAuthInfo object itself. + */ + public UserAccountAuthInfo withDeleteOrUpdateBehavior(DeleteOrUpdateBehavior deleteOrUpdateBehavior) { + this.deleteOrUpdateBehavior = deleteOrUpdateBehavior; + return this; + } + + /** + * Get the roles property: Optional, this value specifies the Azure roles to be assigned. Automatically. + * + * @return the roles value. + */ + public List roles() { + return this.roles; + } + + /** + * Set the roles property: Optional, this value specifies the Azure roles to be assigned. Automatically. + * + * @param roles the roles value to set. + * @return the UserAccountAuthInfo object itself. + */ + public UserAccountAuthInfo withRoles(List roles) { + this.roles = roles; + return this; + } + + /** + * Get the username property: Username created in the database which is mapped to a user in AAD. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: Username created in the database which is mapped to a user in AAD. + * + * @param username the username value to set. + * @return the UserAccountAuthInfo object itself. + */ + public UserAccountAuthInfo withUsername(String username) { + this.username = username; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/UserAssignedIdentityAuthInfo.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/UserAssignedIdentityAuthInfo.java index d5df511c9e11..e61e54d54a16 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/UserAssignedIdentityAuthInfo.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/UserAssignedIdentityAuthInfo.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; /** The authentication info when authType is userAssignedIdentity. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "authType") @@ -26,6 +27,28 @@ public final class UserAssignedIdentityAuthInfo extends AuthInfoBase { @JsonProperty(value = "subscriptionId") private String subscriptionId; + /* + * Indicates whether to clean up previous operation when Linker is updating or deleting + */ + @JsonProperty(value = "deleteOrUpdateBehavior") + private DeleteOrUpdateBehavior deleteOrUpdateBehavior; + + /* + * Optional, this value specifies the Azure role to be assigned + */ + @JsonProperty(value = "roles") + private List roles; + + /* + * Username created in the database which is mapped to a user in AAD. + */ + @JsonProperty(value = "userName") + private String username; + + /** Creates an instance of UserAssignedIdentityAuthInfo class. */ + public UserAssignedIdentityAuthInfo() { + } + /** * Get the clientId property: Client Id for userAssignedIdentity. * @@ -66,6 +89,68 @@ public UserAssignedIdentityAuthInfo withSubscriptionId(String subscriptionId) { return this; } + /** + * Get the deleteOrUpdateBehavior property: Indicates whether to clean up previous operation when Linker is updating + * or deleting. + * + * @return the deleteOrUpdateBehavior value. + */ + public DeleteOrUpdateBehavior deleteOrUpdateBehavior() { + return this.deleteOrUpdateBehavior; + } + + /** + * Set the deleteOrUpdateBehavior property: Indicates whether to clean up previous operation when Linker is updating + * or deleting. + * + * @param deleteOrUpdateBehavior the deleteOrUpdateBehavior value to set. + * @return the UserAssignedIdentityAuthInfo object itself. + */ + public UserAssignedIdentityAuthInfo withDeleteOrUpdateBehavior(DeleteOrUpdateBehavior deleteOrUpdateBehavior) { + this.deleteOrUpdateBehavior = deleteOrUpdateBehavior; + return this; + } + + /** + * Get the roles property: Optional, this value specifies the Azure role to be assigned. + * + * @return the roles value. + */ + public List roles() { + return this.roles; + } + + /** + * Set the roles property: Optional, this value specifies the Azure role to be assigned. + * + * @param roles the roles value to set. + * @return the UserAssignedIdentityAuthInfo object itself. + */ + public UserAssignedIdentityAuthInfo withRoles(List roles) { + this.roles = roles; + return this; + } + + /** + * Get the username property: Username created in the database which is mapped to a user in AAD. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: Username created in the database which is mapped to a user in AAD. + * + * @param username the username value to set. + * @return the UserAssignedIdentityAuthInfo object itself. + */ + public UserAssignedIdentityAuthInfo withUsername(String username) { + this.username = username; + return this; + } + /** * Validates the instance. * diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/VNetSolution.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/VNetSolution.java index dcda96357634..ff2a345546ba 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/VNetSolution.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/VNetSolution.java @@ -16,6 +16,16 @@ public final class VNetSolution { @JsonProperty(value = "type") private VNetSolutionType type; + /* + * Indicates whether to clean up previous operation when Linker is updating or deleting + */ + @JsonProperty(value = "deleteOrUpdateBehavior") + private DeleteOrUpdateBehavior deleteOrUpdateBehavior; + + /** Creates an instance of VNetSolution class. */ + public VNetSolution() { + } + /** * Get the type property: Type of VNet solution. * @@ -36,6 +46,28 @@ public VNetSolution withType(VNetSolutionType type) { return this; } + /** + * Get the deleteOrUpdateBehavior property: Indicates whether to clean up previous operation when Linker is updating + * or deleting. + * + * @return the deleteOrUpdateBehavior value. + */ + public DeleteOrUpdateBehavior deleteOrUpdateBehavior() { + return this.deleteOrUpdateBehavior; + } + + /** + * Set the deleteOrUpdateBehavior property: Indicates whether to clean up previous operation when Linker is updating + * or deleting. + * + * @param deleteOrUpdateBehavior the deleteOrUpdateBehavior value to set. + * @return the VNetSolution object itself. + */ + public VNetSolution withDeleteOrUpdateBehavior(DeleteOrUpdateBehavior deleteOrUpdateBehavior) { + this.deleteOrUpdateBehavior = deleteOrUpdateBehavior; + return this; + } + /** * Validates the instance. * diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/VNetSolutionType.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/VNetSolutionType.java index ed188a96f8a9..acdc087f6157 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/VNetSolutionType.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/VNetSolutionType.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for VNetSolutionType. */ +/** Type of VNet solution. */ public final class VNetSolutionType extends ExpandableStringEnum { /** Static value serviceEndpoint for VNetSolutionType. */ public static final VNetSolutionType SERVICE_ENDPOINT = fromString("serviceEndpoint"); diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ValidateOperationResult.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ValidateOperationResult.java index 0f94afd52643..c0e27cf0be7e 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ValidateOperationResult.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ValidateOperationResult.java @@ -11,7 +11,7 @@ /** An immutable client-side representation of ValidateOperationResult. */ public interface ValidateOperationResult { /** - * Gets the resourceId property: Validated linker id. + * Gets the resourceId property: Validated Linker id. * * @return the resourceId value. */ @@ -53,7 +53,7 @@ public interface ValidateOperationResult { OffsetDateTime reportEndTimeUtc(); /** - * Gets the sourceId property: The resource id of the linker source application. + * Gets the sourceId property: The resource id of the Linker source application. * * @return the sourceId value. */ diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ValidationResultItem.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ValidationResultItem.java index 5596845415ce..ea3a71d4a62c 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ValidationResultItem.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ValidationResultItem.java @@ -7,7 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The validation item for a linker. */ +/** The validation item for a Linker. */ @Fluent public final class ValidationResultItem { /* @@ -40,6 +40,10 @@ public final class ValidationResultItem { @JsonProperty(value = "errorCode") private String errorCode; + /** Creates an instance of ValidationResultItem class. */ + public ValidationResultItem() { + } + /** * Get the name property: The validation item name. * diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ValidationResultStatus.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ValidationResultStatus.java index 46a6ba0f4b6d..495776d6e15d 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ValidationResultStatus.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ValidationResultStatus.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ValidationResultStatus. */ +/** The result of validation. */ public final class ValidationResultStatus extends ExpandableStringEnum { /** Static value success for ValidationResultStatus. */ public static final ValidationResultStatus SUCCESS = fromString("success"); diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ValueSecretInfo.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ValueSecretInfo.java index 67c09bd77d97..9fa985106633 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ValueSecretInfo.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ValueSecretInfo.java @@ -20,6 +20,10 @@ public final class ValueSecretInfo extends SecretInfoBase { @JsonProperty(value = "value") private String value; + /** Creates an instance of ValueSecretInfo class. */ + public ValueSecretInfo() { + } + /** * Get the value property: The actual value of the secret. * diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConfigurationNamesOperationListSamples.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConfigurationNamesOperationListSamples.java new file mode 100644 index 000000000000..c950ecbf7ff5 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConfigurationNamesOperationListSamples.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.servicelinker.generated; + +import com.azure.core.util.Context; + +/** Samples for ConfigurationNamesOperation List. */ +public final class ConfigurationNamesOperationListSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/ConfigurationNamesList.json + */ + /** + * Sample code: GetConfigurationNames. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void getConfigurationNames(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager.configurationNamesOperations().list(null, null, Context.NONE); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorCreateDryrunSamples.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorCreateDryrunSamples.java new file mode 100644 index 000000000000..e8bd2a004752 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorCreateDryrunSamples.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.servicelinker.generated; + +import com.azure.resourcemanager.servicelinker.models.AzureResource; +import com.azure.resourcemanager.servicelinker.models.CreateOrUpdateDryrunParameters; +import com.azure.resourcemanager.servicelinker.models.SecretAuthInfo; +import com.azure.resourcemanager.servicelinker.models.ValueSecretInfo; + +/** Samples for Connector CreateDryrun. */ +public final class ConnectorCreateDryrunSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/ConnectorDryrunCreate.json + */ + /** + * Sample code: ConnectorDryrunCreate. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void connectorDryrunCreate(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager + .connectors() + .defineDryrun("dryrunName") + .withExistingLocation("00000000-0000-0000-0000-000000000000", "test-rg", "westus") + .withParameters( + new CreateOrUpdateDryrunParameters() + .withTargetService( + new AzureResource() + .withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db")) + .withAuthInfo( + new SecretAuthInfo() + .withName("name") + .withSecretInfo(new ValueSecretInfo().withValue("secret")))) + .create(); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorCreateOrUpdateSamples.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorCreateOrUpdateSamples.java new file mode 100644 index 000000000000..d8333a5fc413 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorCreateOrUpdateSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.generated; + +import com.azure.resourcemanager.servicelinker.models.AzureResource; +import com.azure.resourcemanager.servicelinker.models.SecretAuthInfo; +import com.azure.resourcemanager.servicelinker.models.SecretStore; + +/** Samples for Connector CreateOrUpdate. */ +public final class ConnectorCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/PutConnector.json + */ + /** + * Sample code: PutConnector. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void putConnector(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager + .connectors() + .define("connectorName") + .withExistingLocation("00000000-0000-0000-0000-000000000000", "test-rg", "westus") + .withTargetService( + new AzureResource() + .withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db")) + .withAuthInfo(new SecretAuthInfo()) + .withSecretStore(new SecretStore().withKeyVaultId("fakeTokenPlaceholder")) + .create(); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorDeleteDryrunSamples.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorDeleteDryrunSamples.java new file mode 100644 index 000000000000..1d6eab8ee839 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorDeleteDryrunSamples.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.servicelinker.generated; + +import com.azure.core.util.Context; + +/** Samples for Connector DeleteDryrun. */ +public final class ConnectorDeleteDryrunSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/ConnectorDryrunDelete.json + */ + /** + * Sample code: ConnectorDryrunDelete. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void connectorDryrunDelete(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager + .connectors() + .deleteDryrunWithResponse( + "00000000-0000-0000-0000-000000000000", "test-rg", "westus", "dryrunName", Context.NONE); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorDeleteSamples.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorDeleteSamples.java new file mode 100644 index 000000000000..59e9376a75f1 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.generated; + +import com.azure.core.util.Context; + +/** Samples for Connector Delete. */ +public final class ConnectorDeleteSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/DeleteConnector.json + */ + /** + * Sample code: DeleteConnector. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void deleteConnector(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager + .connectors() + .delete("00000000-0000-0000-0000-000000000000", "test-rg", "westus", "connectorName", Context.NONE); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorGenerateConfigurationsSamples.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorGenerateConfigurationsSamples.java new file mode 100644 index 000000000000..8000ef0ca2bf --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorGenerateConfigurationsSamples.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.servicelinker.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicelinker.models.ConfigurationInfo; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Connector GenerateConfigurations. */ +public final class ConnectorGenerateConfigurationsSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/GenerateConfigurations.json + */ + /** + * Sample code: GenerateConfiguration. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void generateConfiguration(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager + .connectors() + .generateConfigurationsWithResponse( + "00000000-0000-0000-0000-000000000000", + "test-rg", + "westus", + "connectorName", + new ConfigurationInfo() + .withCustomizedKeys(mapOf("ASL_DocumentDb_ConnectionString", "MyConnectionstring")), + Context.NONE); + } + + @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/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorGetDryrunSamples.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorGetDryrunSamples.java new file mode 100644 index 000000000000..ba3a1cfe8e79 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorGetDryrunSamples.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.servicelinker.generated; + +import com.azure.core.util.Context; + +/** Samples for Connector GetDryrun. */ +public final class ConnectorGetDryrunSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/ConnectorDryrunGet.json + */ + /** + * Sample code: ConnectorDryrunGet. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void connectorDryrunGet(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager + .connectors() + .getDryrunWithResponse( + "00000000-0000-0000-0000-000000000000", "test-rg", "westus", "dryrunName", Context.NONE); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorGetSamples.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorGetSamples.java new file mode 100644 index 000000000000..c7ba2f9f0896 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorGetSamples.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.servicelinker.generated; + +import com.azure.core.util.Context; + +/** Samples for Connector Get. */ +public final class ConnectorGetSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/Connectors.json + */ + /** + * Sample code: Connector. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void connector(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager + .connectors() + .getWithResponse( + "00000000-0000-0000-0000-000000000000", "test-rg", "westus", "connectorName", Context.NONE); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorListDryrunSamples.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorListDryrunSamples.java new file mode 100644 index 000000000000..5a0003d72348 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorListDryrunSamples.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.servicelinker.generated; + +import com.azure.core.util.Context; + +/** Samples for Connector ListDryrun. */ +public final class ConnectorListDryrunSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/ConnectorDryrunList.json + */ + /** + * Sample code: ConnectorDryrunList. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void connectorDryrunList(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager.connectors().listDryrun("00000000-0000-0000-0000-000000000000", "test-rg", "westus", Context.NONE); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorListSamples.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorListSamples.java new file mode 100644 index 000000000000..cc185b44cafe --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorListSamples.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.servicelinker.generated; + +import com.azure.core.util.Context; + +/** Samples for Connector List. */ +public final class ConnectorListSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/ConnectorList.json + */ + /** + * Sample code: ConnectorList. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void connectorList(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager.connectors().list("00000000-0000-0000-0000-000000000000", "test-rg", "westus", Context.NONE); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorUpdateDryrunSamples.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorUpdateDryrunSamples.java new file mode 100644 index 000000000000..06ad044f0fe5 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorUpdateDryrunSamples.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.servicelinker.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicelinker.models.AzureResource; +import com.azure.resourcemanager.servicelinker.models.CreateOrUpdateDryrunParameters; +import com.azure.resourcemanager.servicelinker.models.DryrunResource; +import com.azure.resourcemanager.servicelinker.models.SecretAuthInfo; +import com.azure.resourcemanager.servicelinker.models.ValueSecretInfo; + +/** Samples for Connector UpdateDryrun. */ +public final class ConnectorUpdateDryrunSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/ConnectorDryrunUpdate.json + */ + /** + * Sample code: ConnectorDryrunUpdate. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void connectorDryrunUpdate(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + DryrunResource resource = + manager + .connectors() + .getDryrunWithResponse( + "00000000-0000-0000-0000-000000000000", "test-rg", "westus", "dryrunName", Context.NONE) + .getValue(); + resource + .update() + .withParameters( + new CreateOrUpdateDryrunParameters() + .withTargetService( + new AzureResource() + .withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db")) + .withAuthInfo( + new SecretAuthInfo() + .withName("name") + .withSecretInfo(new ValueSecretInfo().withValue("secret")))) + .apply(); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorUpdateSamples.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorUpdateSamples.java new file mode 100644 index 000000000000..cec90d0316cb --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorUpdateSamples.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.servicelinker.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicelinker.models.AzureResource; +import com.azure.resourcemanager.servicelinker.models.LinkerResource; +import com.azure.resourcemanager.servicelinker.models.ServicePrincipalSecretAuthInfo; + +/** Samples for Connector Update. */ +public final class ConnectorUpdateSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/PatchConnector.json + */ + /** + * Sample code: PatchConnector. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void patchConnector(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + LinkerResource resource = + manager + .connectors() + .getWithResponse( + "00000000-0000-0000-0000-000000000000", "test-rg", "westus", "connectorName", Context.NONE) + .getValue(); + resource + .update() + .withTargetService( + new AzureResource() + .withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db")) + .withAuthInfo( + new ServicePrincipalSecretAuthInfo() + .withClientId("name") + .withPrincipalId("id") + .withSecret("fakeTokenPlaceholder")) + .apply(); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorValidateSamples.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorValidateSamples.java new file mode 100644 index 000000000000..9c2903fa4d62 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorValidateSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.generated; + +import com.azure.core.util.Context; + +/** Samples for Connector Validate. */ +public final class ConnectorValidateSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/ValidateConnectorSuccess.json + */ + /** + * Sample code: ValidateConnectorSuccess. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void validateConnectorSuccess(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager + .connectors() + .validate("00000000-0000-0000-0000-000000000000", "test-rg", "westus", "connectorName", Context.NONE); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkerCreateOrUpdateSamples.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkerCreateOrUpdateSamples.java index c844ea98b6c0..2d48b7efa099 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkerCreateOrUpdateSamples.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkerCreateOrUpdateSamples.java @@ -4,10 +4,10 @@ package com.azure.resourcemanager.servicelinker.generated; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicelinker.fluent.models.LinkerResourceInner; import com.azure.resourcemanager.servicelinker.models.AzureResource; -import com.azure.resourcemanager.servicelinker.models.KeyVaultSecretUriSecretInfo; import com.azure.resourcemanager.servicelinker.models.SecretAuthInfo; -import com.azure.resourcemanager.servicelinker.models.SecretStore; import com.azure.resourcemanager.servicelinker.models.VNetSolution; import com.azure.resourcemanager.servicelinker.models.VNetSolutionType; import com.azure.resourcemanager.servicelinker.models.ValueSecretInfo; @@ -15,81 +15,27 @@ /** Samples for Linker CreateOrUpdate. */ public final class LinkerCreateOrUpdateSamples { /* - * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/PutLinkWithSecretStore.json + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/PutLinker.json */ /** - * Sample code: PutLinkWithSecretStore. + * Sample code: PutLinker. * * @param manager Entry point to ServiceLinkerManager. */ - public static void putLinkWithSecretStore(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + public static void putLinker(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { manager .linkers() - .define("linkName") - .withExistingResourceUri( - "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app") - .withTargetService( - new AzureResource() - .withId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db")) - .withAuthInfo(new SecretAuthInfo()) - .withSecretStore( - new SecretStore() - .withKeyVaultId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.KeyVault/vaults/test-kv")) - .create(); - } - - /* - * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/PutLinkWithServiceEndpoint.json - */ - /** - * Sample code: PutLinkWithServiceEndpoint. - * - * @param manager Entry point to ServiceLinkerManager. - */ - public static void putLinkWithServiceEndpoint( - com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { - manager - .linkers() - .define("linkName") - .withExistingResourceUri( - "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app") - .withTargetService( - new AzureResource() - .withId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DBforPostgreSQL/servers/test-pg/databases/test-db")) - .withAuthInfo( - new SecretAuthInfo() - .withName("name") - .withSecretInfo( - new KeyVaultSecretUriSecretInfo() - .withValue( - "https://vault-name.vault.azure.net/secrets/secret-name/00000000000000000000000000000000"))) - .withVNetSolution(new VNetSolution().withType(VNetSolutionType.SERVICE_ENDPOINT)) - .create(); - } - - /* - * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/PutLink.json - */ - /** - * Sample code: PutLink. - * - * @param manager Entry point to ServiceLinkerManager. - */ - public static void putLink(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { - manager - .linkers() - .define("linkName") - .withExistingResourceUri( - "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app") - .withTargetService( - new AzureResource() - .withId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DBforPostgreSQL/servers/test-pg/databases/test-db")) - .withAuthInfo( - new SecretAuthInfo().withName("name").withSecretInfo(new ValueSecretInfo().withValue("secret"))) - .create(); + .createOrUpdate( + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", + "linkName", + new LinkerResourceInner() + .withTargetService( + new AzureResource() + .withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DBforPostgreSQL/servers/test-pg/databases/test-db")) + .withAuthInfo( + new SecretAuthInfo().withName("name").withSecretInfo(new ValueSecretInfo().withValue("secret"))) + .withVNetSolution(new VNetSolution().withType(VNetSolutionType.SERVICE_ENDPOINT)), + Context.NONE); } } diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkerDeleteSamples.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkerDeleteSamples.java index c45355310f4f..f966b61b6b6d 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkerDeleteSamples.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkerDeleteSamples.java @@ -9,14 +9,14 @@ /** Samples for Linker Delete. */ public final class LinkerDeleteSamples { /* - * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/DeleteLink.json + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/DeleteLinker.json */ /** - * Sample code: DeleteLink. + * Sample code: DeleteLinker. * * @param manager Entry point to ServiceLinkerManager. */ - public static void deleteLink(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + public static void deleteLinker(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { manager .linkers() .delete( diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkerGetSamples.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkerGetSamples.java index 106923971767..16458170fdbd 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkerGetSamples.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkerGetSamples.java @@ -9,14 +9,14 @@ /** Samples for Linker Get. */ public final class LinkerGetSamples { /* - * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/Link.json + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/Linker.json */ /** - * Sample code: Link. + * Sample code: Linker. * * @param manager Entry point to ServiceLinkerManager. */ - public static void link(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + public static void linker(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { manager .linkers() .getWithResponse( diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkerListConfigurationsSamples.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkerListConfigurationsSamples.java index d32acd289414..950cf92f4b6b 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkerListConfigurationsSamples.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkerListConfigurationsSamples.java @@ -9,7 +9,7 @@ /** Samples for Linker ListConfigurations. */ public final class LinkerListConfigurationsSamples { /* - * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/GetConfigurations.json + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/GetConfigurations.json */ /** * Sample code: GetConfiguration. diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkerListSamples.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkerListSamples.java index 9d9701379515..fb376780734d 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkerListSamples.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkerListSamples.java @@ -9,14 +9,14 @@ /** Samples for Linker List. */ public final class LinkerListSamples { /* - * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/LinkList.json + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/LinkerList.json */ /** - * Sample code: LinkList. + * Sample code: LinkerList. * * @param manager Entry point to ServiceLinkerManager. */ - public static void linkList(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + public static void linkerList(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { manager .linkers() .list( diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkerUpdateSamples.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkerUpdateSamples.java index a02c0746e021..17e4757157c8 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkerUpdateSamples.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkerUpdateSamples.java @@ -6,36 +6,35 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.servicelinker.models.AzureResource; -import com.azure.resourcemanager.servicelinker.models.LinkerResource; +import com.azure.resourcemanager.servicelinker.models.LinkerPatch; import com.azure.resourcemanager.servicelinker.models.ServicePrincipalSecretAuthInfo; /** Samples for Linker Update. */ public final class LinkerUpdateSamples { /* - * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/PatchLink.json + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/PatchLinker.json */ /** - * Sample code: PatchLink. + * Sample code: PatchLinker. * * @param manager Entry point to ServiceLinkerManager. */ - public static void patchLink(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { - LinkerResource resource = - manager - .linkers() - .getWithResponse( - "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", - "linkName", - Context.NONE) - .getValue(); - resource - .update() - .withTargetService( - new AzureResource() - .withId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db")) - .withAuthInfo( - new ServicePrincipalSecretAuthInfo().withClientId("name").withPrincipalId("id").withSecret("secret")) - .apply(); + public static void patchLinker(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager + .linkers() + .update( + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", + "linkName", + new LinkerPatch() + .withTargetService( + new AzureResource() + .withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db")) + .withAuthInfo( + new ServicePrincipalSecretAuthInfo() + .withClientId("name") + .withPrincipalId("id") + .withSecret("fakeTokenPlaceholder")), + Context.NONE); } } diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkerValidateSamples.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkerValidateSamples.java index c4774b19c20a..823261c4fd28 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkerValidateSamples.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkerValidateSamples.java @@ -9,14 +9,14 @@ /** Samples for Linker Validate. */ public final class LinkerValidateSamples { /* - * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/ValidateLinkSuccess.json + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/ValidateLinkerSuccess.json */ /** - * Sample code: ValidateLinkSuccess. + * Sample code: ValidateLinkerSuccess. * * @param manager Entry point to ServiceLinkerManager. */ - public static void validateLinkSuccess(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + public static void validateLinkerSuccess(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { manager .linkers() .validate( diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkersOperationCreateDryrunSamples.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkersOperationCreateDryrunSamples.java new file mode 100644 index 000000000000..0bd67d1eac03 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkersOperationCreateDryrunSamples.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.servicelinker.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicelinker.fluent.models.DryrunResourceInner; +import com.azure.resourcemanager.servicelinker.models.AzureResource; +import com.azure.resourcemanager.servicelinker.models.CreateOrUpdateDryrunParameters; +import com.azure.resourcemanager.servicelinker.models.SecretAuthInfo; +import com.azure.resourcemanager.servicelinker.models.ValueSecretInfo; + +/** Samples for LinkersOperation CreateDryrun. */ +public final class LinkersOperationCreateDryrunSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/PutDryrun.json + */ + /** + * Sample code: PutDryrun. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void putDryrun(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager + .linkersOperations() + .createDryrun( + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", + "dryrunName", + new DryrunResourceInner() + .withParameters( + new CreateOrUpdateDryrunParameters() + .withTargetService( + new AzureResource() + .withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db")) + .withAuthInfo( + new SecretAuthInfo() + .withName("name") + .withSecretInfo(new ValueSecretInfo().withValue("secret")))), + Context.NONE); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkersOperationDeleteDryrunSamples.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkersOperationDeleteDryrunSamples.java new file mode 100644 index 000000000000..8a8d9873415d --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkersOperationDeleteDryrunSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.generated; + +import com.azure.core.util.Context; + +/** Samples for LinkersOperation DeleteDryrun. */ +public final class LinkersOperationDeleteDryrunSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/DeleteDryrun.json + */ + /** + * Sample code: DeleteDryrun. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void deleteDryrun(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager + .linkersOperations() + .deleteDryrunWithResponse( + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", + "dryrunName", + Context.NONE); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkersOperationGenerateConfigurationsSamples.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkersOperationGenerateConfigurationsSamples.java new file mode 100644 index 000000000000..ff6c21c6a0c1 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkersOperationGenerateConfigurationsSamples.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.servicelinker.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicelinker.models.ConfigurationInfo; +import java.util.HashMap; +import java.util.Map; + +/** Samples for LinkersOperation GenerateConfigurations. */ +public final class LinkersOperationGenerateConfigurationsSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/LinkerGenerateConfigurations.json + */ + /** + * Sample code: GenerateConfiguration. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void generateConfiguration(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager + .linkersOperations() + .generateConfigurationsWithResponse( + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", + "linkName", + new ConfigurationInfo() + .withCustomizedKeys(mapOf("ASL_DocumentDb_ConnectionString", "MyConnectionstring")), + Context.NONE); + } + + @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/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkersOperationGetDryrunSamples.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkersOperationGetDryrunSamples.java new file mode 100644 index 000000000000..05a7b6be4fda --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkersOperationGetDryrunSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.generated; + +import com.azure.core.util.Context; + +/** Samples for LinkersOperation GetDryrun. */ +public final class LinkersOperationGetDryrunSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/GetDryrun.json + */ + /** + * Sample code: GetDryrun. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void getDryrun(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager + .linkersOperations() + .getDryrunWithResponse( + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", + "dryrunName", + Context.NONE); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkersOperationListDryrunSamples.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkersOperationListDryrunSamples.java new file mode 100644 index 000000000000..f369ea8914a2 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkersOperationListDryrunSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.generated; + +import com.azure.core.util.Context; + +/** Samples for LinkersOperation ListDryrun. */ +public final class LinkersOperationListDryrunSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/ListDryrun.json + */ + /** + * Sample code: ListDryrun. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void listDryrun(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager + .linkersOperations() + .listDryrun( + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", + Context.NONE); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkersOperationUpdateDryrunSamples.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkersOperationUpdateDryrunSamples.java new file mode 100644 index 000000000000..537587b3bf72 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkersOperationUpdateDryrunSamples.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.servicelinker.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicelinker.models.AzureResource; +import com.azure.resourcemanager.servicelinker.models.CreateOrUpdateDryrunParameters; +import com.azure.resourcemanager.servicelinker.models.DryrunPatch; +import com.azure.resourcemanager.servicelinker.models.SecretAuthInfo; +import com.azure.resourcemanager.servicelinker.models.ValueSecretInfo; + +/** Samples for LinkersOperation UpdateDryrun. */ +public final class LinkersOperationUpdateDryrunSamples { + /* + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/PatchDryrun.json + */ + /** + * Sample code: PatchDryrun. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void patchDryrun(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager + .linkersOperations() + .updateDryrun( + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", + "dryrunName", + new DryrunPatch() + .withParameters( + new CreateOrUpdateDryrunParameters() + .withTargetService( + new AzureResource() + .withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db")) + .withAuthInfo( + new SecretAuthInfo() + .withName("name") + .withSecretInfo(new ValueSecretInfo().withValue("secret")))), + Context.NONE); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/OperationsListSamples.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/OperationsListSamples.java index 814216b514cc..f5c6fd54a70c 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/OperationsListSamples.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/OperationsListSamples.java @@ -9,7 +9,7 @@ /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/OperationsList.json + * x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/OperationsList.json */ /** * Sample code: GetConfiguration.