diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/CHANGELOG.md b/sdk/servicelinker/azure-resourcemanager-servicelinker/CHANGELOG.md index c3cc4af24ac3..1e1fb593327f 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/CHANGELOG.md +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/CHANGELOG.md @@ -1,14 +1,257 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2025-05-07) -### Features Added +- Azure Resource Manager ServiceLinker client library for Java. This package contains Microsoft Azure SDK for ServiceLinker Management SDK. Microsoft.ServiceLinker provider. Package tag package-2024-07-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.LinkerList` was removed -### Other Changes +#### `models.SourceConfigurationResult` was removed + +#### `models.LinkerResource$DefinitionStages` was modified + +* `withExistingResourceUri(java.lang.String)` was removed in stage 1 + +#### `models.LinkerResource$Definition` was modified + +* `withExistingResourceUri(java.lang.String)` was removed + +#### `models.LinkerResource` was modified + +* `listConfigurationsWithResponse(com.azure.core.util.Context)` was removed +* `listConfigurations()` was removed + +#### `models.Linkers` was modified + +* `listConfigurations(java.lang.String,java.lang.String)` was removed +* `validate(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `deleteByResourceGroup(java.lang.String,java.lang.String)` was removed +* `validate(java.lang.String,java.lang.String)` was removed +* `get(java.lang.String,java.lang.String)` was removed +* `delete(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `define(java.lang.String)` was removed +* `getByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `list(java.lang.String,com.azure.core.util.Context)` was removed +* `deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `list(java.lang.String)` was removed +* `deleteById(java.lang.String)` was removed +* `listConfigurationsWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `getById(java.lang.String)` was removed +* `getWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed + +### Features Added + +* `models.AccessKeyInfoBase` was added + +* `models.ConfigurationNameItem` was added + +* `models.ConfigurationNamesOperations` was added + +* `models.CreateOrUpdateDryrunParameters` was added + +* `models.DryrunPrerequisiteResultType` was added + +* `models.ConfigurationName` was added + +* `models.DryrunResource$Update` was added + +* `models.SelfHostedServer` was added + +* `models.FirewallRules` was added + +* `models.ConfigurationInfo` was added + +* `models.DryrunParameters` was added + +* `models.DryrunList` was added + +* `models.UserAccountAuthInfo` was added + +* `models.DeleteOrUpdateBehavior` was added + +* `models.DryrunPatch` was added + +* `models.AllowType` was added + +* `models.DryrunPrerequisiteResult` was added + +* `models.PermissionsMissingDryrunPrerequisiteResult` was added + +* `models.DaprMetadataRequired` was added + +* `models.ConfigurationStore` was added + +* `models.EasyAuthMicrosoftEntraIdAuthInfo` was added + +* `models.AzureAppConfigProperties` was added + +* `models.Connectors` was added + +* `models.DaprMetadata` was added + +* `models.DryrunResource$DefinitionStages` was added + +* `models.SecretSourceType` was added + +* `models.DryrunOperationPreview` was added + +* `models.LinkersUpdateHeaders` was added + +* `models.ConfigurationResult` was added + +* `models.DryrunResource` was added + +* `models.LinkerConfigurationType` was added + +* `models.ResourceList` was added + +* `models.LinkersOperations` was added + +* `models.PublicNetworkSolution` was added + +* `models.AuthMode` was added + +* `models.DaprConfigurationResource` was added + +* `models.LinkersUpdateResponse` was added + +* `models.DaprBindingComponentDirection` was added + +* `models.ConfigurationNameResult` was added + +* `models.DryrunActionName` was added + +* `models.DryrunResource$Definition` was added + +* `models.DaprConfigurationList` was added + +* `models.AccessKeyPermissions` was added + +* `models.BasicErrorDryrunPrerequisiteResult` was added + +* `models.FabricPlatform` was added + +* `models.DryrunResource$UpdateStages` was added + +* `models.DaprProperties` was added + +* `models.DryrunPreviewOperationType` was added + +#### `ServiceLinkerManager` was modified + +* `linkersOperations()` was added +* `configurationNamesOperations()` was added +* `connectors()` was added + +#### `models.LinkerResource$Definition` was modified + +* `withPublicNetworkSolution(models.PublicNetworkSolution)` was added +* `withConfigurationInfo(models.ConfigurationInfo)` was added +* `withExistingLocation(java.lang.String,java.lang.String)` was added + +#### `models.LinkerResource` was modified + +* `generateConfigurationsWithResponse(models.ConfigurationInfo,com.azure.core.util.Context)` was added +* `resourceGroupName()` was added +* `configurationInfo()` was added +* `generateConfigurations()` was added +* `publicNetworkSolution()` was added + +#### `models.LinkerResource$Update` was modified + +* `withPublicNetworkSolution(models.PublicNetworkSolution)` was added +* `withConfigurationInfo(models.ConfigurationInfo)` was added + +#### `models.VNetSolution` was modified + +* `deleteOrUpdateBehavior()` was added +* `withDeleteOrUpdateBehavior(models.DeleteOrUpdateBehavior)` was added + +#### `models.LinkerPatch` was modified + +* `withConfigurationInfo(models.ConfigurationInfo)` was added +* `configurationInfo()` was added +* `publicNetworkSolution()` was added +* `withPublicNetworkSolution(models.PublicNetworkSolution)` was added + +#### `models.ServicePrincipalCertificateAuthInfo` was modified + +* `deleteOrUpdateBehavior()` was added +* `withAuthMode(models.AuthMode)` was added +* `roles()` was added +* `withRoles(java.util.List)` was added +* `withDeleteOrUpdateBehavior(models.DeleteOrUpdateBehavior)` was added + +#### `models.Linkers` was modified + +* `validate(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was added +* `validate(java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `delete(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was added +* `get(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was added +* `update(java.lang.String,java.lang.String,java.lang.String,java.lang.String,models.LinkerPatch)` was added +* `createOrUpdate(java.lang.String,java.lang.String,java.lang.String,java.lang.String,fluent.models.LinkerResourceInner,com.azure.core.util.Context)` was added +* `updateWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,models.LinkerPatch,com.azure.core.util.Context)` was added +* `listConfigurationsWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `getWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `delete(java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `list(java.lang.String,java.lang.String)` was added +* `listConfigurations(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was added +* `createOrUpdate(java.lang.String,java.lang.String,java.lang.String,java.lang.String,fluent.models.LinkerResourceInner)` was added +* `list(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added + +#### `models.SourceConfiguration` was modified + +* `withDescription(java.lang.String)` was added +* `withKeyVaultReferenceIdentity(java.lang.String)` was added +* `description()` was added +* `keyVaultReferenceIdentity()` was added +* `configType()` was added + +#### `models.ServicePrincipalSecretAuthInfo` was modified + +* `withRoles(java.util.List)` was added +* `withAuthMode(models.AuthMode)` was added +* `withUsername(java.lang.String)` was added +* `deleteOrUpdateBehavior()` was added +* `roles()` was added +* `withDeleteOrUpdateBehavior(models.DeleteOrUpdateBehavior)` was added +* `username()` was added + +#### `models.UserAssignedIdentityAuthInfo` was modified + +* `withAuthMode(models.AuthMode)` was added +* `withUsername(java.lang.String)` was added +* `username()` was added +* `roles()` was added +* `deleteOrUpdateBehavior()` was added +* `withDeleteOrUpdateBehavior(models.DeleteOrUpdateBehavior)` was added +* `withRoles(java.util.List)` was added + +#### `models.SecretStore` was modified + +* `keyVaultSecretName()` was added +* `withKeyVaultSecretName(java.lang.String)` was added + +#### `models.SystemAssignedIdentityAuthInfo` was modified + +* `withAuthMode(models.AuthMode)` was added +* `roles()` was added +* `username()` was added +* `withRoles(java.util.List)` was added +* `deleteOrUpdateBehavior()` was added +* `withUsername(java.lang.String)` was added +* `withDeleteOrUpdateBehavior(models.DeleteOrUpdateBehavior)` was added + +#### `models.SecretAuthInfo` was modified + +* `withAuthMode(models.AuthMode)` was added + +#### `models.AuthInfoBase` was modified + +* `authMode()` was added +* `withAuthMode(models.AuthMode)` was added ## 1.0.0 (2024-12-26) diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/README.md b/sdk/servicelinker/azure-resourcemanager-servicelinker/README.md index cffab9cb503f..4defe913113f 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-2024-07-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 @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ ServiceLinkerManager manager = ServiceLinkerManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -100,5 +100,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [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 414362be96f9..e56563f26a8a 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,16 +30,182 @@ - [Update](#linker_update) - [Validate](#linker_validate) +## LinkersOperation + +- [CreateDryrun](#linkersoperation_createdryrun) +- [DeleteDryrun](#linkersoperation_deletedryrun) +- [GenerateConfigurations](#linkersoperation_generateconfigurations) +- [GetDryrun](#linkersoperation_getdryrun) +- [ListDaprConfigurations](#linkersoperation_listdaprconfigurations) +- [ListDryrun](#linkersoperation_listdryrun) +- [UpdateDryrun](#linkersoperation_updatedryrun) + ## Operations - [List](#operations_list) -### Linker_CreateOrUpdate +### ConfigurationNamesOperation_List + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/ + * OperationsList.json + */ + /** + * Sample code: GetConfiguration. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void getConfiguration(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Connector_CreateDryrun + +```java +/** + * Samples for Connector Delete. + */ +public final class ConnectorDeleteSamples { + /* + * x-ms-original-file: + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-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("test-rg", "westus", "connectorName", com.azure.core.util.Context.NONE); + } +} +``` + +### Connector_CreateOrUpdate ```java import com.azure.resourcemanager.servicelinker.models.AzureResource; -import com.azure.resourcemanager.servicelinker.models.KeyVaultSecretUriSecretInfo; +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/preview/2024-07-01-preview/examples/ + * PatchLinker.json + */ + /** + * Sample code: PatchLinker. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void patchLinker(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager.linkers() + .updateWithResponse(null, null, + "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")), + com.azure.core.util.Context.NONE); + } +} +``` + +### Connector_Delete + +```java +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/2024-07-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(null, null, + "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")))), + com.azure.core.util.Context.NONE); + } +} +``` + +### Connector_DeleteDryrun + +```java +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/2024-07-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("test-rg", "westus", "dryrunName", com.azure.core.util.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_GenerateConfigurations + +```java +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.SecretStore; import com.azure.resourcemanager.servicelinker.models.VNetSolution; import com.azure.resourcemanager.servicelinker.models.VNetSolutionType; import com.azure.resourcemanager.servicelinker.models.ValueSecretInfo; @@ -31,100 +216,126 @@ import com.azure.resourcemanager.servicelinker.models.ValueSecretInfo; public final class LinkerCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/ - * PutLinkWithSecretStore.json + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-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("fakeTokenPlaceholder")) - .create(); + .createOrUpdate(null, null, + "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)), + com.azure.core.util.Context.NONE); } +} +``` + +### Connector_Get +```java +/** + * Samples for Connector Validate. + */ +public final class ConnectorValidateSamples { /* * x-ms-original-file: - * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/ - * PutLinkWithServiceEndpoint.json + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/ + * ValidateConnectorSuccess.json */ /** - * Sample code: PutLinkWithServiceEndpoint. + * Sample code: ValidateConnectorSuccess. * * @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(); + public static void validateConnectorSuccess(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager.connectors().validate("test-rg", "westus", "connectorName", com.azure.core.util.Context.NONE); } +} +``` + +### Connector_GetDryrun +```java +/** + * Samples for ConfigurationNamesOperation List. + */ +public final class ConfigurationNamesOperationListSamples { /* * x-ms-original-file: - * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/PutLink.json + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/ + * ConfigurationNamesList.json */ /** - * Sample code: PutLink. + * Sample code: GetConfigurationNames. * * @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(); + public static void getConfigurationNames(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager.configurationNamesOperations().list(null, null, com.azure.core.util.Context.NONE); } } ``` -### Linker_Delete +### Connector_List ```java /** - * Samples for Linker Delete. + * Samples for LinkersOperation DeleteDryrun. */ -public final class LinkerDeleteSamples { +public final class LinkersOperationDeleteDryrunSamples { /* * x-ms-original-file: - * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/DeleteLink.json + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/ + * DeleteDryrun.json */ /** - * Sample code: DeleteLink. + * Sample code: DeleteDryrun. * * @param manager Entry point to ServiceLinkerManager. */ - public static void deleteLink(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { - manager.linkers() - .delete( + public static void deleteDryrun(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager.linkersOperations() + .deleteDryrunWithResponse(null, null, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", - "linkName", com.azure.core.util.Context.NONE); + "dryrunName", com.azure.core.util.Context.NONE); } } ``` -### Linker_Get +### Connector_ListDryrun + +```java +/** + * Samples for Connector DeleteDryrun. + */ +public final class ConnectorDeleteDryrunSamples { + /* + * x-ms-original-file: + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-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("test-rg", "westus", "dryrunName", com.azure.core.util.Context.NONE); + } +} +``` + +### Connector_Update ```java /** @@ -133,74 +344,134 @@ public final class LinkerDeleteSamples { public final class LinkerGetSamples { /* * x-ms-original-file: - * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/Link.json + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-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( + .getWithResponse(null, null, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", "linkName", com.azure.core.util.Context.NONE); } } ``` -### Linker_List +### Connector_UpdateDryrun ```java /** - * Samples for Linker List. + * Samples for LinkersOperation ListDaprConfigurations. */ -public final class LinkerListSamples { +public final class LinkersOperationListDaprConfigurationsSamples { /* * x-ms-original-file: - * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/LinkList.json + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/ + * GetDaprConfigurations.json */ /** - * Sample code: LinkList. + * Sample code: GetDaprConfigurations. * * @param manager Entry point to ServiceLinkerManager. */ - public static void linkList(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { - manager.linkers() - .list( + public static void getDaprConfigurations(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager.linkersOperations() + .listDaprConfigurations( "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", com.azure.core.util.Context.NONE); } } ``` -### Linker_ListConfigurations +### Connector_Validate ```java +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 Linker ListConfigurations. + * Samples for Connector CreateDryrun. */ -public final class LinkerListConfigurationsSamples { +public final class ConnectorCreateDryrunSamples { /* * x-ms-original-file: - * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/GetConfigurations - * .json + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/ + * ConnectorDryrunCreate.json */ /** - * Sample code: GetConfiguration. + * Sample code: ConnectorDryrunCreate. * * @param manager Entry point to ServiceLinkerManager. */ - public static void getConfiguration(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { - manager.linkers() - .listConfigurationsWithResponse( + public static void connectorDryrunCreate(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager.connectors() + .defineDryrun("dryrunName") + .withExistingLocation("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(); + } +} +``` + +### Linker_CreateOrUpdate + +```java +/** + * Samples for Connector List. + */ +public final class ConnectorListSamples { + /* + * x-ms-original-file: + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-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("test-rg", "westus", com.azure.core.util.Context.NONE); + } +} +``` + +### Linker_Delete + +```java +/** + * Samples for LinkersOperation GetDryrun. + */ +public final class LinkersOperationGetDryrunSamples { + /* + * x-ms-original-file: + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-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(null, null, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", - "linkName", com.azure.core.util.Context.NONE); + "dryrunName", com.azure.core.util.Context.NONE); } } ``` -### Linker_Update +### Linker_Get ```java import com.azure.resourcemanager.servicelinker.models.AzureResource; @@ -208,23 +479,22 @@ import com.azure.resourcemanager.servicelinker.models.LinkerResource; import com.azure.resourcemanager.servicelinker.models.ServicePrincipalSecretAuthInfo; /** - * Samples for Linker Update. + * Samples for Connector Update. */ -public final class LinkerUpdateSamples { +public final class ConnectorUpdateSamples { /* * x-ms-original-file: - * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/PatchLink.json + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/ + * PatchConnector.json */ /** - * Sample code: PatchLink. + * Sample code: PatchConnector. * * @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", com.azure.core.util.Context.NONE) + public static void patchConnector(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + LinkerResource resource = manager.connectors() + .getWithResponse("test-rg", "westus", "connectorName", com.azure.core.util.Context.NONE) .getValue(); resource.update() .withTargetService(new AzureResource().withId( @@ -237,8 +507,203 @@ public final class LinkerUpdateSamples { } ``` +### Linker_List + +```java +/** + * Samples for Linker Delete. + */ +public final class LinkerDeleteSamples { + /* + * x-ms-original-file: + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/ + * DeleteLinker.json + */ + /** + * Sample code: DeleteLinker. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void deleteLinker(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager.linkers() + .delete(null, null, + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", + "linkName", com.azure.core.util.Context.NONE); + } +} +``` + +### Linker_ListConfigurations + +```java +/** + * Samples for LinkersOperation ListDryrun. + */ +public final class LinkersOperationListDryrunSamples { + /* + * x-ms-original-file: + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-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(null, + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", + com.azure.core.util.Context.NONE); + } +} +``` + +### Linker_Update + +```java +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/2024-07-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("test-rg", "westus", "connectorName", new ConfigurationInfo() + .withCustomizedKeys(mapOf("ASL_DocumentDb_ConnectionString", "MyConnectionstring")), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @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; + } +} +``` + ### Linker_Validate +```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/2024-07-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("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(); + } +} +``` + +### LinkersOperation_CreateDryrun + +```java +/** + * Samples for Connector Get. + */ +public final class ConnectorGetSamples { + /* + * x-ms-original-file: + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-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("test-rg", "westus", "connectorName", com.azure.core.util.Context.NONE); + } +} +``` + +### LinkersOperation_DeleteDryrun + +```java +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/2024-07-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(null, null, + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", + "linkName", new ConfigurationInfo().withCustomizedKeys( + mapOf("ASL_DocumentDb_ConnectionString", "MyConnectionstring")), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @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_GenerateConfigurations + ```java /** * Samples for Linker Validate. @@ -246,34 +711,98 @@ public final class LinkerUpdateSamples { public final class LinkerValidateSamples { /* * x-ms-original-file: - * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/ - * ValidateLinkSuccess.json + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-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( + .validate(null, null, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", "linkName", com.azure.core.util.Context.NONE); } } ``` -### Operations_List +### LinkersOperation_GetDryrun ```java +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 Operations List. + * Samples for LinkersOperation CreateDryrun. */ -public final class OperationsListSamples { +public final class LinkersOperationCreateDryrunSamples { /* * x-ms-original-file: - * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/OperationsList. - * json + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-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(null, null, + "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")))), + com.azure.core.util.Context.NONE); + } +} +``` + +### LinkersOperation_ListDaprConfigurations + +```java +/** + * Samples for Linker List. + */ +public final class LinkerListSamples { + /* + * x-ms-original-file: + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/ + * LinkerList.json + */ + /** + * Sample code: LinkerList. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void linkerList(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager.linkers() + .list(null, + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", + com.azure.core.util.Context.NONE); + } +} +``` + +### LinkersOperation_ListDryrun + +```java +/** + * Samples for Linker ListConfigurations. + */ +public final class LinkerListConfigurationsSamples { + /* + * x-ms-original-file: + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/ + * GetConfigurations.json */ /** * Sample code: GetConfiguration. @@ -281,7 +810,56 @@ public final class OperationsListSamples { * @param manager Entry point to ServiceLinkerManager. */ public static void getConfiguration(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); + manager.linkers() + .listConfigurationsWithResponse(null, null, + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.App/containerApps/test-app", + "linkName", com.azure.core.util.Context.NONE); + } +} +``` + +### LinkersOperation_UpdateDryrun + +```java +/** + * Samples for Connector ListDryrun. + */ +public final class ConnectorListDryrunSamples { + /* + * x-ms-original-file: + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-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("test-rg", "westus", com.azure.core.util.Context.NONE); + } +} +``` + +### Operations_List + +```java +/** + * Samples for Connector GetDryrun. + */ +public final class ConnectorGetDryrunSamples { + /* + * x-ms-original-file: + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-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("test-rg", "westus", "dryrunName", com.azure.core.util.Context.NONE); } } ``` diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/pom.xml b/sdk/servicelinker/azure-resourcemanager-servicelinker/pom.xml index a0c641cac93c..71030e909512 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/pom.xml +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/pom.xml @@ -18,7 +18,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-2024-07-01-preview. https://github.com/Azure/azure-sdk-for-java @@ -45,7 +45,7 @@ UTF-8 0 0 - false + true 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 d6f79d234af0..ac842f907abc 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 @@ -22,17 +22,25 @@ import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; 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; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; @@ -43,8 +51,14 @@ public final class ServiceLinkerManager { private Linkers linkers; + private LinkersOperations linkersOperations; + + private ConfigurationNamesOperations configurationNamesOperations; + private Operations operations; + private Connectors connectors; + private final ServiceLinkerManagementClient clientObject; private ServiceLinkerManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -52,6 +66,7 @@ private ServiceLinkerManager(HttpPipeline httpPipeline, AzureProfile profile, Du Objects.requireNonNull(profile, "'profile' cannot be null."); this.clientObject = new ServiceLinkerManagementClientBuilder().pipeline(httpPipeline) .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) .defaultPollInterval(defaultPollInterval) .buildClient(); } @@ -96,6 +111,9 @@ public static Configurable configure() { */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-servicelinker.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -203,12 +221,14 @@ public ServiceLinkerManager authenticate(TokenCredential credential, AzureProfil Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.servicelinker") .append("/") - .append("1.0.0"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -255,7 +275,7 @@ public ServiceLinkerManager authenticate(TokenCredential credential, AzureProfil } /** - * Gets the resource collection API of Linkers. It manages LinkerResource. + * Gets the resource collection API of Linkers. * * @return Resource collection API of Linkers. */ @@ -266,6 +286,31 @@ 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 ConfigurationNamesOperations. + * + * @return Resource collection API of ConfigurationNamesOperations. + */ + public ConfigurationNamesOperations configurationNamesOperations() { + if (this.configurationNamesOperations == null) { + this.configurationNamesOperations + = new ConfigurationNamesOperationsImpl(clientObject.getConfigurationNamesOperations(), this); + } + return configurationNamesOperations; + } + /** * Gets the resource collection API of Operations. * @@ -278,6 +323,18 @@ public Operations operations() { return operations; } + /** + * Gets the resource collection API of Connectors. It manages LinkerResource, DryrunResource. + * + * @return Resource collection API of Connectors. + */ + public Connectors connectors() { + if (this.connectors == null) { + this.connectors = new ConnectorsImpl(clientObject.getConnectors(), this); + } + return connectors; + } + /** * Gets 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..31e6122c78a7 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/ConfigurationNamesOperationsClient.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.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..3f3d926a6050 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/ConnectorsClient.java @@ -0,0 +1,583 @@ +// 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 { + /** + * Returns list of connector which connects to the resource, which supports to config the target service during the + * resource provision. + * + * @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 resourceGroupName, String location); + + /** + * Returns list of connector which connects to the resource, which supports to config the target service during the + * resource provision. + * + * @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 resourceGroupName, String location, Context context); + + /** + * Returns Connector resource for a given name. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName, + Context context); + + /** + * Returns Connector resource for a given name. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName); + + /** + * Create or update Connector resource. + * + * @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 the LinkerResource. + * @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 resourceGroupName, + String location, String connectorName, LinkerResourceInner parameters); + + /** + * Create or update Connector resource. + * + * @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 the LinkerResource. + * @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 resourceGroupName, + String location, String connectorName, LinkerResourceInner parameters, Context context); + + /** + * Create or update Connector resource. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName, + LinkerResourceInner parameters); + + /** + * Create or update Connector resource. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName, + LinkerResourceInner parameters, Context context); + + /** + * Operation to update an existing Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, + String location, String connectorName, LinkerPatch parameters); + + /** + * Operation to update an existing Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, + String location, String connectorName, LinkerPatch parameters, Context context); + + /** + * Operation to update an existing Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName, LinkerPatch parameters); + + /** + * Operation to update an existing Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName, LinkerPatch parameters, + Context context); + + /** + * Delete a Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName); + + /** + * Delete a Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName, + Context context); + + /** + * Delete a Connector. + * + * @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 the LinkerResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String location, String connectorName); + + /** + * Delete a Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName, Context context); + + /** + * Generate configurations for a Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, + String connectorName, ConfigurationInfo parameters, Context context); + + /** + * Generate configurations for a Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName); + + /** + * Validate a Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName); + + /** + * Validate a Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName, Context context); + + /** + * Validate a Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName); + + /** + * Validate a Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName, + Context context); + + /** + * list dryrun jobs. + * + * @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 resourceGroupName, String location); + + /** + * list dryrun jobs. + * + * @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 resourceGroupName, String location, Context context); + + /** + * get a dryrun job. + * + * @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 the DryrunResource. + * @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 resourceGroupName, String location, String dryrunName, + Context context); + + /** + * get a dryrun job. + * + * @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 the DryrunResource. + * @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 resourceGroupName, String location, String dryrunName); + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @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 the DryrunResource. + * @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 resourceGroupName, + String location, String dryrunName, DryrunResourceInner parameters); + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @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 the DryrunResource. + * @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 resourceGroupName, + String location, String dryrunName, DryrunResourceInner parameters, Context context); + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @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 the DryrunResource. + * @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 resourceGroupName, String location, String dryrunName, + DryrunResourceInner parameters); + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @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 the DryrunResource. + * @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 resourceGroupName, String location, String dryrunName, + DryrunResourceInner parameters, Context context); + + /** + * update a dryrun job to do necessary check before actual creation. + * + * @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 the DryrunResource. + * @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 resourceGroupName, + String location, String dryrunName, DryrunPatch parameters); + + /** + * update a dryrun job to do necessary check before actual creation. + * + * @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 the DryrunResource. + * @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 resourceGroupName, + String location, String dryrunName, DryrunPatch parameters, Context context); + + /** + * update a dryrun job to do necessary check before actual creation. + * + * @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 the DryrunResource. + * @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 resourceGroupName, String location, String dryrunName, + DryrunPatch parameters); + + /** + * update a dryrun job to do necessary check before actual creation. + * + * @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 the DryrunResource. + * @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 resourceGroupName, String location, String dryrunName, + DryrunPatch parameters, Context context); + + /** + * delete a dryrun job. + * + * @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 the DryrunResource. + * @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 resourceGroupName, String location, String dryrunName, + Context context); + + /** + * delete a dryrun job. + * + * @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 the DryrunResource. + * @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 resourceGroupName, String location, String dryrunName); +} 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 ddc3f19ad9e4..168aded3da2c 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,18 +11,21 @@ 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; +import com.azure.resourcemanager.servicelinker.models.LinkersUpdateResponse; /** * 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 providers {resourceUri}. * @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. @@ -30,11 +33,13 @@ public interface LinkersClient { * @return the list of Linker as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceUri); + PagedIterable list(String providers, 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 providers {resourceUri}. * @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. @@ -43,11 +48,13 @@ public interface LinkersClient { * @return the list of Linker as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceUri, Context context); + PagedIterable list(String providers, String resourceUri, Context context); /** * Returns Linker resource for a given name. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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. @@ -57,11 +64,14 @@ public interface LinkersClient { * @return linker of source and target resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceUri, String linkerName, Context context); + Response getWithResponse(String providers, String linkers, String resourceUri, + String linkerName, Context context); /** * Returns Linker resource for a given name. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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. @@ -70,11 +80,13 @@ public interface LinkersClient { * @return linker of source and target resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - LinkerResourceInner get(String resourceUri, String linkerName); + LinkerResourceInner get(String providers, String linkers, String resourceUri, String linkerName); /** - * Create or update linker resource. + * Create or update Linker resource. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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. @@ -84,12 +96,14 @@ public interface LinkersClient { * @return the {@link SyncPoller} for polling of linker of source and target resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, LinkerResourceInner> beginCreateOrUpdate(String resourceUri, - String linkerName, LinkerResourceInner parameters); + SyncPoller, LinkerResourceInner> beginCreateOrUpdate(String providers, + String linkers, String resourceUri, String linkerName, LinkerResourceInner parameters); /** - * Create or update linker resource. + * Create or update Linker resource. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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. @@ -100,12 +114,14 @@ SyncPoller, LinkerResourceInner> beginCreateOrUp * @return the {@link SyncPoller} for polling of linker of source and target resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, LinkerResourceInner> beginCreateOrUpdate(String resourceUri, - String linkerName, LinkerResourceInner parameters, Context context); + SyncPoller, LinkerResourceInner> beginCreateOrUpdate(String providers, + String linkers, String resourceUri, String linkerName, LinkerResourceInner parameters, Context context); /** - * Create or update linker resource. + * Create or update Linker resource. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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. @@ -115,11 +131,14 @@ SyncPoller, LinkerResourceInner> beginCreateOrUp * @return linker of source and target resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - LinkerResourceInner createOrUpdate(String resourceUri, String linkerName, LinkerResourceInner parameters); + LinkerResourceInner createOrUpdate(String providers, String linkers, String resourceUri, String linkerName, + LinkerResourceInner parameters); /** - * Create or update linker resource. + * Create or update Linker resource. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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. @@ -130,203 +149,202 @@ SyncPoller, LinkerResourceInner> beginCreateOrUp * @return linker of source and target resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - LinkerResourceInner createOrUpdate(String resourceUri, String linkerName, LinkerResourceInner parameters, - Context context); + LinkerResourceInner createOrUpdate(String providers, String linkers, String resourceUri, String linkerName, + LinkerResourceInner parameters, Context context); /** - * Delete a link. - * - * @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 long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceUri, String linkerName); - - /** - * Delete a link. + * Operation to update an existing Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceUri, String linkerName, Context context); - - /** - * Delete a link. - * - * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceUri, String linkerName); + LinkersUpdateResponse updateWithResponse(String providers, String linkers, String resourceUri, String linkerName, + LinkerPatch parameters, Context context); /** - * Delete a link. + * Operation to update an existing Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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. + * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceUri, String linkerName, Context context); + LinkerResourceInner update(String providers, String linkers, String resourceUri, String linkerName, + LinkerPatch parameters); /** - * Operation to update an existing link. + * Delete a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 the {@link SyncPoller} for polling of linker of source and target resource. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, LinkerResourceInner> beginUpdate(String resourceUri, String linkerName, - LinkerPatch parameters); + SyncPoller, Void> beginDelete(String providers, String linkers, String resourceUri, + String linkerName); /** - * Operation to update an existing link. + * Delete a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 the {@link SyncPoller} for polling of linker of source and target resource. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, LinkerResourceInner> beginUpdate(String resourceUri, String linkerName, - LinkerPatch parameters, Context context); + SyncPoller, Void> beginDelete(String providers, String linkers, String resourceUri, + String linkerName, Context context); /** - * Operation to update an existing link. + * Delete a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - LinkerResourceInner update(String resourceUri, String linkerName, LinkerPatch parameters); + void delete(String providers, String linkers, String resourceUri, String linkerName); /** - * Operation to update an existing link. + * Delete a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - LinkerResourceInner update(String resourceUri, String linkerName, LinkerPatch parameters, Context context); + void delete(String providers, String linkers, String resourceUri, String linkerName, Context context); /** - * Validate a link. + * list source configurations for a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 the {@link SyncPoller} for polling of the validation operation result for a linker. + * @return configurations for source resource, include appSettings, connectionString and serviceBindings along with + * {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ValidateOperationResultInner> beginValidate(String resourceUri, - String linkerName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response listConfigurationsWithResponse(String providers, String linkers, + String resourceUri, String linkerName, Context context); /** - * Validate a link. + * list source configurations for a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 the {@link SyncPoller} for polling of the validation operation result for a linker. + * @return configurations for source resource, include appSettings, connectionString and serviceBindings. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ValidateOperationResultInner> beginValidate(String resourceUri, - String linkerName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigurationResultInner listConfigurations(String providers, String linkers, String resourceUri, + String linkerName); /** - * Validate a link. + * Validate a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 {@link SyncPoller} for polling of the validation operation result for a Linker. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ValidateOperationResultInner validate(String resourceUri, String linkerName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ValidateOperationResultInner> beginValidate(String providers, + String linkers, String resourceUri, String linkerName); /** - * Validate a link. + * Validate a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 the validation operation result for a linker. + * @return the {@link SyncPoller} for polling of the validation operation result for a Linker. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ValidateOperationResultInner validate(String resourceUri, String linkerName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ValidateOperationResultInner> beginValidate(String providers, + String linkers, String resourceUri, String linkerName, Context context); /** - * list source configurations for a linker. + * Validate a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 the validation operation result for a Linker. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listConfigurationsWithResponse(String resourceUri, String linkerName, - Context context); + ValidateOperationResultInner validate(String providers, String linkers, String resourceUri, String linkerName); /** - * list source configurations for a linker. + * Validate a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 the validation operation result for a Linker. */ @ServiceMethod(returns = ReturnType.SINGLE) - SourceConfigurationResultInner listConfigurations(String resourceUri, String linkerName); + ValidateOperationResultInner validate(String providers, String linkers, String resourceUri, String linkerName, + Context context); } 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..51336aba4a0d --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/LinkersOperationsClient.java @@ -0,0 +1,313 @@ +// 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.DaprConfigurationResourceInner; +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 providers {resourceUri}. + * @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 providers, String resourceUri); + + /** + * list dryrun jobs. + * + * @param providers {resourceUri}. + * @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 providers, String resourceUri, Context context); + + /** + * get a dryrun job. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, String resourceUri, + String dryrunName, Context context); + + /** + * get a dryrun job. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, String resourceUri, String dryrunName); + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, + String resourceUri, String dryrunName, DryrunResourceInner parameters); + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, + String resourceUri, String dryrunName, DryrunResourceInner parameters, Context context); + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, String resourceUri, String dryrunName, + DryrunResourceInner parameters); + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, String resourceUri, String dryrunName, + DryrunResourceInner parameters, Context context); + + /** + * add a dryrun job to do necessary check before actual creation. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, + String resourceUri, String dryrunName, DryrunPatch parameters); + + /** + * add a dryrun job to do necessary check before actual creation. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, + String resourceUri, String dryrunName, DryrunPatch parameters, Context context); + + /** + * add a dryrun job to do necessary check before actual creation. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, String resourceUri, String dryrunName, + DryrunPatch parameters); + + /** + * add a dryrun job to do necessary check before actual creation. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, String resourceUri, String dryrunName, + DryrunPatch parameters, Context context); + + /** + * delete a dryrun job. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, String resourceUri, String dryrunName, + Context context); + + /** + * delete a dryrun job. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, String resourceUri, String dryrunName); + + /** + * Generate configurations for a Linker. + * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. + * @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 providers, String linkers, + String resourceUri, String linkerName, ConfigurationInfo parameters, Context context); + + /** + * Generate configurations for a Linker. + * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. + * @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 providers, String linkers, String resourceUri, + String linkerName); + + /** + * List the dapr configuration supported by Service Connector. + * + * @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 dapr configuration list supported by Service Connector as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listDaprConfigurations(String resourceUri); + + /** + * List the dapr configuration supported by Service Connector. + * + * @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 dapr configuration list supported by Service Connector as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listDaprConfigurations(String resourceUri, Context context); +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/OperationsClient.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/OperationsClient.java index 89438c26d05a..43bda97deca7 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/OperationsClient.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/OperationsClient.java @@ -15,7 +15,7 @@ */ public interface OperationsClient { /** - * Lists the available ServiceLinker REST API operations. + * List the operations for the provider. * * @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. @@ -26,7 +26,7 @@ public interface OperationsClient { PagedIterable list(); /** - * Lists the available ServiceLinker REST API operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. 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 0b8c276b7498..13a2891a04e9 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 @@ -11,6 +11,13 @@ * The interface for ServiceLinkerManagementClient class. */ public interface ServiceLinkerManagementClient { + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + /** * Gets server parameter. * @@ -46,10 +53,31 @@ public interface ServiceLinkerManagementClient { */ LinkersClient getLinkers(); + /** + * Gets the LinkersOperationsClient object to access its operations. + * + * @return the LinkersOperationsClient object. + */ + LinkersOperationsClient getLinkersOperations(); + + /** + * Gets the ConfigurationNamesOperationsClient object to access its operations. + * + * @return the ConfigurationNamesOperationsClient object. + */ + ConfigurationNamesOperationsClient getConfigurationNamesOperations(); + /** * Gets the OperationsClient object to access its operations. * * @return the OperationsClient object. */ OperationsClient getOperations(); + + /** + * Gets the ConnectorsClient object to access its operations. + * + * @return the ConnectorsClient object. + */ + ConnectorsClient getConnectors(); } 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..836ce6357c51 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/ConfigurationNameItemInner.java @@ -0,0 +1,231 @@ +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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.DaprProperties; +import com.azure.resourcemanager.servicelinker.models.SecretSourceType; +import java.io.IOException; +import java.util.List; + +/** + * The ConfigurationNameItem model. + */ +@Fluent +public final class ConfigurationNameItemInner implements JsonSerializable { + /* + * The result detail. + */ + 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 secretType property: Indicates where the secrets in configuration from. Used when secrets are from + * Keyvault. + * + * @return the secretType value. + */ + public SecretSourceType secretType() { + return this.innerProperties() == null ? null : this.innerProperties().secretType(); + } + + /** + * Set the secretType property: Indicates where the secrets in configuration from. Used when secrets are from + * Keyvault. + * + * @param secretType the secretType value to set. + * @return the ConfigurationNameItemInner object itself. + */ + public ConfigurationNameItemInner withSecretType(SecretSourceType secretType) { + if (this.innerProperties() == null) { + this.innerProperties = new ConfigurationNames(); + } + this.innerProperties().withSecretType(secretType); + return this; + } + + /** + * Get the daprProperties property: Deprecated, please use #/definitions/DaprConfigurationList instead. + * + * @return the daprProperties value. + */ + public DaprProperties daprProperties() { + return this.innerProperties() == null ? null : this.innerProperties().daprProperties(); + } + + /** + * Set the daprProperties property: Deprecated, please use #/definitions/DaprConfigurationList instead. + * + * @param daprProperties the daprProperties value to set. + * @return the ConfigurationNameItemInner object itself. + */ + public ConfigurationNameItemInner withDaprProperties(DaprProperties daprProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ConfigurationNames(); + } + this.innerProperties().withDaprProperties(daprProperties); + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfigurationNameItemInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfigurationNameItemInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConfigurationNameItemInner. + */ + public static ConfigurationNameItemInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfigurationNameItemInner deserializedConfigurationNameItemInner = new ConfigurationNameItemInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedConfigurationNameItemInner.innerProperties = ConfigurationNames.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedConfigurationNameItemInner; + }); + } +} 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..35456d014a3e --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/ConfigurationNames.java @@ -0,0 +1,248 @@ +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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.DaprProperties; +import com.azure.resourcemanager.servicelinker.models.SecretSourceType; +import java.io.IOException; +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 implements JsonSerializable { + /* + * The target service provider name and resource name. + */ + private String targetService; + + /* + * The client type for configuration names. + */ + private ClientType clientType; + + /* + * The auth type. + */ + private AuthType authType; + + /* + * Indicates where the secrets in configuration from. Used when secrets are from Keyvault. + */ + private SecretSourceType secretType; + + /* + * Deprecated, please use #/definitions/DaprConfigurationList instead + */ + private DaprProperties daprProperties; + + /* + * The configuration names to be set in compute service environment. + */ + 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 secretType property: Indicates where the secrets in configuration from. Used when secrets are from + * Keyvault. + * + * @return the secretType value. + */ + public SecretSourceType secretType() { + return this.secretType; + } + + /** + * Set the secretType property: Indicates where the secrets in configuration from. Used when secrets are from + * Keyvault. + * + * @param secretType the secretType value to set. + * @return the ConfigurationNames object itself. + */ + public ConfigurationNames withSecretType(SecretSourceType secretType) { + this.secretType = secretType; + return this; + } + + /** + * Get the daprProperties property: Deprecated, please use #/definitions/DaprConfigurationList instead. + * + * @return the daprProperties value. + */ + public DaprProperties daprProperties() { + return this.daprProperties; + } + + /** + * Set the daprProperties property: Deprecated, please use #/definitions/DaprConfigurationList instead. + * + * @param daprProperties the daprProperties value to set. + * @return the ConfigurationNames object itself. + */ + public ConfigurationNames withDaprProperties(DaprProperties daprProperties) { + this.daprProperties = daprProperties; + 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 (daprProperties() != null) { + daprProperties().validate(); + } + if (names() != null) { + names().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("targetService", this.targetService); + jsonWriter.writeStringField("clientType", this.clientType == null ? null : this.clientType.toString()); + jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeStringField("secretType", this.secretType == null ? null : this.secretType.toString()); + jsonWriter.writeJsonField("daprProperties", this.daprProperties); + jsonWriter.writeArrayField("names", this.names, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfigurationNames from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfigurationNames if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ConfigurationNames. + */ + public static ConfigurationNames fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfigurationNames deserializedConfigurationNames = new ConfigurationNames(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetService".equals(fieldName)) { + deserializedConfigurationNames.targetService = reader.getString(); + } else if ("clientType".equals(fieldName)) { + deserializedConfigurationNames.clientType = ClientType.fromString(reader.getString()); + } else if ("authType".equals(fieldName)) { + deserializedConfigurationNames.authType = AuthType.fromString(reader.getString()); + } else if ("secretType".equals(fieldName)) { + deserializedConfigurationNames.secretType = SecretSourceType.fromString(reader.getString()); + } else if ("daprProperties".equals(fieldName)) { + deserializedConfigurationNames.daprProperties = DaprProperties.fromJson(reader); + } else if ("names".equals(fieldName)) { + List names = reader.readArray(reader1 -> ConfigurationName.fromJson(reader1)); + deserializedConfigurationNames.names = names; + } else { + reader.skipChildren(); + } + } + + return deserializedConfigurationNames; + }); + } +} 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 70% 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 20e2d8ec6a64..aa97729b424d 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 @@ -17,16 +17,16 @@ * Configurations for source resource, include appSettings, connectionString and serviceBindings. */ @Fluent -public final class SourceConfigurationResultInner implements JsonSerializable { +public final class ConfigurationResultInner implements JsonSerializable { /* * The configuration properties for source resource. */ private List configurations; /** - * Creates an instance of SourceConfigurationResultInner class. + * Creates an instance of ConfigurationResultInner class. */ - public SourceConfigurationResultInner() { + public ConfigurationResultInner() { } /** @@ -42,9 +42,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; } @@ -72,17 +72,16 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of SourceConfigurationResultInner from the JsonReader. + * Reads an instance of ConfigurationResultInner from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of SourceConfigurationResultInner if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the SourceConfigurationResultInner. + * @return An instance of ConfigurationResultInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConfigurationResultInner. */ - public static SourceConfigurationResultInner fromJson(JsonReader jsonReader) throws IOException { + public static ConfigurationResultInner fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - SourceConfigurationResultInner deserializedSourceConfigurationResultInner - = new SourceConfigurationResultInner(); + ConfigurationResultInner deserializedConfigurationResultInner = new ConfigurationResultInner(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -90,13 +89,13 @@ public static SourceConfigurationResultInner fromJson(JsonReader jsonReader) thr if ("configurations".equals(fieldName)) { List configurations = reader.readArray(reader1 -> SourceConfiguration.fromJson(reader1)); - deserializedSourceConfigurationResultInner.configurations = configurations; + deserializedConfigurationResultInner.configurations = configurations; } else { reader.skipChildren(); } } - return deserializedSourceConfigurationResultInner; + return deserializedConfigurationResultInner; }); } } diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/DaprConfigurationProperties.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/DaprConfigurationProperties.java new file mode 100644 index 000000000000..085e1b4a4ae8 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/DaprConfigurationProperties.java @@ -0,0 +1,154 @@ +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.servicelinker.models.AuthType; +import com.azure.resourcemanager.servicelinker.models.DaprProperties; +import java.io.IOException; + +/** + * The DaprConfigurationProperties model. + */ +@Fluent +public final class DaprConfigurationProperties implements JsonSerializable { + /* + * Supported target resource type, extract from resource id, uppercase + */ + private String targetType; + + /* + * The authentication type. + */ + private AuthType authType; + + /* + * Indicates some additional properties for dapr client type + */ + private DaprProperties daprProperties; + + /** + * Creates an instance of DaprConfigurationProperties class. + */ + public DaprConfigurationProperties() { + } + + /** + * Get the targetType property: Supported target resource type, extract from resource id, uppercase. + * + * @return the targetType value. + */ + public String targetType() { + return this.targetType; + } + + /** + * Set the targetType property: Supported target resource type, extract from resource id, uppercase. + * + * @param targetType the targetType value to set. + * @return the DaprConfigurationProperties object itself. + */ + public DaprConfigurationProperties withTargetType(String targetType) { + this.targetType = targetType; + return this; + } + + /** + * Get the authType property: The authentication type. + * + * @return the authType value. + */ + public AuthType authType() { + return this.authType; + } + + /** + * Set the authType property: The authentication type. + * + * @param authType the authType value to set. + * @return the DaprConfigurationProperties object itself. + */ + public DaprConfigurationProperties withAuthType(AuthType authType) { + this.authType = authType; + return this; + } + + /** + * Get the daprProperties property: Indicates some additional properties for dapr client type. + * + * @return the daprProperties value. + */ + public DaprProperties daprProperties() { + return this.daprProperties; + } + + /** + * Set the daprProperties property: Indicates some additional properties for dapr client type. + * + * @param daprProperties the daprProperties value to set. + * @return the DaprConfigurationProperties object itself. + */ + public DaprConfigurationProperties withDaprProperties(DaprProperties daprProperties) { + this.daprProperties = daprProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (daprProperties() != null) { + daprProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("targetType", this.targetType); + jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeJsonField("daprProperties", this.daprProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprConfigurationProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DaprConfigurationProperties. + */ + public static DaprConfigurationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprConfigurationProperties deserializedDaprConfigurationProperties = new DaprConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetType".equals(fieldName)) { + deserializedDaprConfigurationProperties.targetType = reader.getString(); + } else if ("authType".equals(fieldName)) { + deserializedDaprConfigurationProperties.authType = AuthType.fromString(reader.getString()); + } else if ("daprProperties".equals(fieldName)) { + deserializedDaprConfigurationProperties.daprProperties = DaprProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprConfigurationProperties; + }); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/DaprConfigurationResourceInner.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/DaprConfigurationResourceInner.java new file mode 100644 index 000000000000..12ba3d2d4948 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/DaprConfigurationResourceInner.java @@ -0,0 +1,158 @@ +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.servicelinker.models.AuthType; +import com.azure.resourcemanager.servicelinker.models.DaprProperties; +import java.io.IOException; + +/** + * Represent one resource of the dapr configuration list. + */ +@Fluent +public final class DaprConfigurationResourceInner implements JsonSerializable { + /* + * The properties of the dapr configuration. + */ + private DaprConfigurationProperties innerProperties; + + /** + * Creates an instance of DaprConfigurationResourceInner class. + */ + public DaprConfigurationResourceInner() { + } + + /** + * Get the innerProperties property: The properties of the dapr configuration. + * + * @return the innerProperties value. + */ + private DaprConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the targetType property: Supported target resource type, extract from resource id, uppercase. + * + * @return the targetType value. + */ + public String targetType() { + return this.innerProperties() == null ? null : this.innerProperties().targetType(); + } + + /** + * Set the targetType property: Supported target resource type, extract from resource id, uppercase. + * + * @param targetType the targetType value to set. + * @return the DaprConfigurationResourceInner object itself. + */ + public DaprConfigurationResourceInner withTargetType(String targetType) { + if (this.innerProperties() == null) { + this.innerProperties = new DaprConfigurationProperties(); + } + this.innerProperties().withTargetType(targetType); + return this; + } + + /** + * Get the authType property: The authentication type. + * + * @return the authType value. + */ + public AuthType authType() { + return this.innerProperties() == null ? null : this.innerProperties().authType(); + } + + /** + * Set the authType property: The authentication type. + * + * @param authType the authType value to set. + * @return the DaprConfigurationResourceInner object itself. + */ + public DaprConfigurationResourceInner withAuthType(AuthType authType) { + if (this.innerProperties() == null) { + this.innerProperties = new DaprConfigurationProperties(); + } + this.innerProperties().withAuthType(authType); + return this; + } + + /** + * Get the daprProperties property: Indicates some additional properties for dapr client type. + * + * @return the daprProperties value. + */ + public DaprProperties daprProperties() { + return this.innerProperties() == null ? null : this.innerProperties().daprProperties(); + } + + /** + * Set the daprProperties property: Indicates some additional properties for dapr client type. + * + * @param daprProperties the daprProperties value to set. + * @return the DaprConfigurationResourceInner object itself. + */ + public DaprConfigurationResourceInner withDaprProperties(DaprProperties daprProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new DaprConfigurationProperties(); + } + this.innerProperties().withDaprProperties(daprProperties); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprConfigurationResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprConfigurationResourceInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DaprConfigurationResourceInner. + */ + public static DaprConfigurationResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprConfigurationResourceInner deserializedDaprConfigurationResourceInner + = new DaprConfigurationResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedDaprConfigurationResourceInner.innerProperties + = DaprConfigurationProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprConfigurationResourceInner; + }); + } +} 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..d00847ce46c8 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/DryrunProperties.java @@ -0,0 +1,158 @@ +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.servicelinker.models.DryrunOperationPreview; +import com.azure.resourcemanager.servicelinker.models.DryrunParameters; +import com.azure.resourcemanager.servicelinker.models.DryrunPrerequisiteResult; +import java.io.IOException; +import java.util.List; + +/** + * The properties of the dryrun job. + */ +@Fluent +public final class DryrunProperties implements JsonSerializable { + /* + * The parameters of the dryrun + */ + private DryrunParameters parameters; + + /* + * the result of the dryrun + */ + private List prerequisiteResults; + + /* + * the preview of the operations for creation + */ + private List operationPreviews; + + /* + * The provisioning state. + */ + 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("parameters", this.parameters); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DryrunProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DryrunProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DryrunProperties. + */ + public static DryrunProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DryrunProperties deserializedDryrunProperties = new DryrunProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameters".equals(fieldName)) { + deserializedDryrunProperties.parameters = DryrunParameters.fromJson(reader); + } else if ("prerequisiteResults".equals(fieldName)) { + List prerequisiteResults + = reader.readArray(reader1 -> DryrunPrerequisiteResult.fromJson(reader1)); + deserializedDryrunProperties.prerequisiteResults = prerequisiteResults; + } else if ("operationPreviews".equals(fieldName)) { + List operationPreviews + = reader.readArray(reader1 -> DryrunOperationPreview.fromJson(reader1)); + deserializedDryrunProperties.operationPreviews = operationPreviews; + } else if ("provisioningState".equals(fieldName)) { + deserializedDryrunProperties.provisioningState = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDryrunProperties; + }); + } +} 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..863e9e4d8f34 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/DryrunResourceInner.java @@ -0,0 +1,208 @@ +// 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.servicelinker.models.DryrunOperationPreview; +import com.azure.resourcemanager.servicelinker.models.DryrunParameters; +import com.azure.resourcemanager.servicelinker.models.DryrunPrerequisiteResult; +import java.io.IOException; +import java.util.List; + +/** + * a dryrun job resource. + */ +@Fluent +public final class DryrunResourceInner extends ProxyResource { + /* + * The properties of the dryrun job. + */ + private DryrunProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * 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 type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DryrunResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DryrunResourceInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DryrunResourceInner. + */ + public static DryrunResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DryrunResourceInner deserializedDryrunResourceInner = new DryrunResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDryrunResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDryrunResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDryrunResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDryrunResourceInner.innerProperties = DryrunProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDryrunResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDryrunResourceInner; + }); + } +} 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 84d04089000a..3c816df5ad16 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 @@ -11,13 +11,15 @@ import com.azure.json.JsonWriter; 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 java.io.IOException; /** - * The properties of the linker. + * The properties of the Linker. */ @Fluent public final class LinkerProperties implements JsonSerializable { @@ -56,6 +58,16 @@ public final class LinkerProperties implements JsonSerializable { @@ -26,7 +26,7 @@ public final class ValidateOperationResultInner implements JsonSerializable { @@ -43,7 +43,7 @@ public final class ValidateResult implements JsonSerializable { private OffsetDateTime reportEndTimeUtc; /* - * The resource id of the linker source application. + * The resource id of the Linker source application. */ private String sourceId; @@ -149,7 +149,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. */ @@ -158,7 +158,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..f1a7638e2a2e --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ConfigurationNameItemImpl.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 com.azure.resourcemanager.servicelinker.models.DaprProperties; +import com.azure.resourcemanager.servicelinker.models.SecretSourceType; +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 SecretSourceType secretType() { + return this.innerModel().secretType(); + } + + public DaprProperties daprProperties() { + return this.innerModel().daprProperties(); + } + + 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..927cb2a9a14f --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ConfigurationNamesOperationsClientImpl.java @@ -0,0 +1,268 @@ +// 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. + * @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. + * @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..d61ea9d4461c --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ConfigurationNamesOperationsImpl.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.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 ResourceManagerUtils.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 ResourceManagerUtils.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 b34d9322e7f5..7ed966817cd3 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,18 +4,18 @@ 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; @@ -30,7 +30,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..7e4c75c8dbb4 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ConnectorsClientImpl.java @@ -0,0 +1,2579 @@ +// 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}/connectors") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @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, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @PathParam("connectorName") String connectorName, @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, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @PathParam("connectorName") String connectorName, + @BodyParam("application/json") LinkerResourceInner parameters, @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, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @PathParam("connectorName") String connectorName, @BodyParam("application/json") LinkerPatch 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, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @PathParam("connectorName") String connectorName, @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, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @PathParam("connectorName") String connectorName, + @BodyParam("application/json") ConfigurationInfo 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, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @PathParam("connectorName") String connectorName, @HeaderParam("Accept") String accept, Context context); + + @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, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @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, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @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, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @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, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @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, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @PathParam("dryrunName") String dryrunName, @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); + + @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); + } + + /** + * Returns list of connector which connects to the resource, which supports to config the target service during the + * resource provision. + * + * @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 resourceGroupName, String location) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, 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 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 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 (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, location, 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 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 resourceGroupName, String location) { + return new PagedFlux<>(() -> listSinglePageAsync(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 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 resourceGroupName, String location, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(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 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 resourceGroupName, String location) { + return new PagedIterable<>(listAsync(resourceGroupName, location)); + } + + /** + * Returns list of connector which connects to the resource, which supports to config the target service during the + * resource provision. + * + * @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 resourceGroupName, String location, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, location, context)); + } + + /** + * Returns Connector resource for a given name. + * + * @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 the LinkerResource. + * @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 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 (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, connectorName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns Connector resource for a given name. + * + * @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 the LinkerResource. + * @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 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 (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, location, connectorName, accept, context); + } + + /** + * Returns Connector resource for a given name. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName) { + return getWithResponseAsync(resourceGroupName, location, connectorName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns Connector resource for a given name. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, + String connectorName, Context context) { + return getWithResponseAsync(resourceGroupName, location, connectorName, context).block(); + } + + /** + * Returns Connector resource for a given name. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName) { + return getWithResponse(resourceGroupName, location, connectorName, Context.NONE).getValue(); + } + + /** + * Create or update Connector resource. + * + * @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 the LinkerResource. + * @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 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 (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, connectorName, parameters, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update Connector resource. + * + * @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 the LinkerResource. + * @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 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 (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, connectorName, parameters, accept, context); + } + + /** + * Create or update Connector resource. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName, LinkerResourceInner parameters) { + Mono>> mono + = createOrUpdateWithResponseAsync(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 resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of the LinkerResource. + * @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 resourceGroupName, String location, String connectorName, LinkerResourceInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, location, connectorName, parameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + LinkerResourceInner.class, LinkerResourceInner.class, context); + } + + /** + * Create or update Connector resource. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName, LinkerResourceInner parameters) { + return this.beginCreateOrUpdateAsync(resourceGroupName, location, connectorName, parameters).getSyncPoller(); + } + + /** + * Create or update Connector resource. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName, LinkerResourceInner parameters, + Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, location, connectorName, parameters, context) + .getSyncPoller(); + } + + /** + * Create or update Connector resource. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, + String connectorName, LinkerResourceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, location, connectorName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update Connector resource. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, + String connectorName, LinkerResourceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, location, connectorName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update Connector resource. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName, + LinkerResourceInner parameters) { + return createOrUpdateAsync(resourceGroupName, location, connectorName, parameters).block(); + } + + /** + * Create or update Connector resource. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName, + LinkerResourceInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, location, connectorName, parameters, context).block(); + } + + /** + * Operation to update an existing Connector. + * + * @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 the LinkerResource. + * @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 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 (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, connectorName, parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Operation to update an existing Connector. + * + * @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 the LinkerResource. + * @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 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 (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, location, connectorName, parameters, accept, context); + } + + /** + * Operation to update an existing Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, + String location, String connectorName, LinkerPatch parameters) { + Mono>> mono + = updateWithResponseAsync(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 resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of the LinkerResource. + * @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 resourceGroupName, + String location, String connectorName, LinkerPatch parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateWithResponseAsync(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 resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param connectorName The name of the LinkerResource. + * @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 resourceGroupName, + String location, String connectorName, LinkerPatch parameters) { + return this.beginUpdateAsync(resourceGroupName, location, connectorName, parameters).getSyncPoller(); + } + + /** + * Operation to update an existing Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, + String location, String connectorName, LinkerPatch parameters, Context context) { + return this.beginUpdateAsync(resourceGroupName, location, connectorName, parameters, context).getSyncPoller(); + } + + /** + * Operation to update an existing Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName, + LinkerPatch parameters) { + return beginUpdateAsync(resourceGroupName, location, connectorName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to update an existing Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName, + LinkerPatch parameters, Context context) { + return beginUpdateAsync(resourceGroupName, location, connectorName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to update an existing Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName, + LinkerPatch parameters) { + return updateAsync(resourceGroupName, location, connectorName, parameters).block(); + } + + /** + * Operation to update an existing Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName, + LinkerPatch parameters, Context context) { + return updateAsync(resourceGroupName, location, connectorName, parameters, context).block(); + } + + /** + * Delete a Connector. + * + * @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 the LinkerResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String location, + String connectorName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, connectorName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Connector. + * + * @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 the LinkerResource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String 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 (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, location, connectorName, accept, context); + } + + /** + * Delete a Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, + String connectorName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, location, connectorName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, + String connectorName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, location, connectorName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, + String connectorName) { + return this.beginDeleteAsync(resourceGroupName, location, connectorName).getSyncPoller(); + } + + /** + * Delete a Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, + String connectorName, Context context) { + return this.beginDeleteAsync(resourceGroupName, location, connectorName, context).getSyncPoller(); + } + + /** + * Delete a Connector. + * + * @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 the LinkerResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String location, String connectorName) { + return beginDeleteAsync(resourceGroupName, location, connectorName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName, Context context) { + return beginDeleteAsync(resourceGroupName, location, connectorName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Connector. + * + * @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 the LinkerResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String location, String connectorName) { + deleteAsync(resourceGroupName, location, connectorName).block(); + } + + /** + * Delete a Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName, Context context) { + deleteAsync(resourceGroupName, location, connectorName, context).block(); + } + + /** + * Generate configurations for a Connector. + * + * @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 the LinkerResource. + * @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 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 (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, location, + connectorName, parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generate configurations for a Connector. + * + * @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 the LinkerResource. + * @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 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 (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, connectorName, parameters, accept, context); + } + + /** + * Generate configurations for a Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, + String connectorName) { + final ConfigurationInfo parameters = null; + return generateConfigurationsWithResponseAsync(resourceGroupName, location, connectorName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Generate configurations for a Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, + String location, String connectorName, ConfigurationInfo parameters, Context context) { + return generateConfigurationsWithResponseAsync(resourceGroupName, location, connectorName, parameters, context) + .block(); + } + + /** + * Generate configurations for a Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, + String connectorName) { + final ConfigurationInfo parameters = null; + return generateConfigurationsWithResponse(resourceGroupName, location, connectorName, parameters, Context.NONE) + .getValue(); + } + + /** + * Validate a Connector. + * + * @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 the LinkerResource. + * @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 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 (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, connectorName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Validate a Connector. + * + * @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 the LinkerResource. + * @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 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 (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, location, connectorName, accept, context); + } + + /** + * Validate a Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName) { + Mono>> mono = validateWithResponseAsync(resourceGroupName, location, connectorName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ValidateOperationResultInner.class, ValidateOperationResultInner.class, + this.client.getContext()); + } + + /** + * Validate a Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = validateWithResponseAsync(resourceGroupName, location, connectorName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ValidateOperationResultInner.class, ValidateOperationResultInner.class, + context); + } + + /** + * Validate a Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName) { + return this.beginValidateAsync(resourceGroupName, location, connectorName).getSyncPoller(); + } + + /** + * Validate a Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName, Context context) { + return this.beginValidateAsync(resourceGroupName, location, connectorName, context).getSyncPoller(); + } + + /** + * Validate a Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, + String connectorName) { + return beginValidateAsync(resourceGroupName, location, connectorName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Validate a Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, + String connectorName, Context context) { + return beginValidateAsync(resourceGroupName, location, connectorName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Validate a Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName) { + return validateAsync(resourceGroupName, location, connectorName).block(); + } + + /** + * Validate a Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName, + Context context) { + return validateAsync(resourceGroupName, location, connectorName, context).block(); + } + + /** + * list dryrun jobs. + * + * @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 resourceGroupName, + String location) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, 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 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 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 (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, location, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * list dryrun jobs. + * + * @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 resourceGroupName, String location) { + return new PagedFlux<>(() -> listDryrunSinglePageAsync(resourceGroupName, location), + nextLink -> listDryrunNextSinglePageAsync(nextLink)); + } + + /** + * list dryrun jobs. + * + * @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 resourceGroupName, String location, Context context) { + return new PagedFlux<>(() -> listDryrunSinglePageAsync(resourceGroupName, location, context), + nextLink -> listDryrunNextSinglePageAsync(nextLink, context)); + } + + /** + * list dryrun jobs. + * + * @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 resourceGroupName, String location) { + return new PagedIterable<>(listDryrunAsync(resourceGroupName, location)); + } + + /** + * list dryrun jobs. + * + * @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 resourceGroupName, String location, Context context) { + return new PagedIterable<>(listDryrunAsync(resourceGroupName, location, context)); + } + + /** + * get a dryrun job. + * + * @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 the DryrunResource. + * @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 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 (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, dryrunName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * get a dryrun job. + * + * @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 the DryrunResource. + * @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 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 (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, dryrunName, accept, context); + } + + /** + * get a dryrun job. + * + * @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 the DryrunResource. + * @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 resourceGroupName, String location, String dryrunName) { + return getDryrunWithResponseAsync(resourceGroupName, location, dryrunName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * get a dryrun job. + * + * @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 the DryrunResource. + * @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 resourceGroupName, String location, + String dryrunName, Context context) { + return getDryrunWithResponseAsync(resourceGroupName, location, dryrunName, context).block(); + } + + /** + * get a dryrun job. + * + * @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 the DryrunResource. + * @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 resourceGroupName, String location, String dryrunName) { + return getDryrunWithResponse(resourceGroupName, location, dryrunName, Context.NONE).getValue(); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @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 the DryrunResource. + * @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 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 (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, 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 resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of the DryrunResource. + * @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 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 (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, dryrunName, parameters, accept, context); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @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 the DryrunResource. + * @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 resourceGroupName, String location, String dryrunName, DryrunResourceInner parameters) { + Mono>> mono + = createDryrunWithResponseAsync(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 resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of the DryrunResource. + * @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 resourceGroupName, String location, String dryrunName, DryrunResourceInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createDryrunWithResponseAsync(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 resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of the DryrunResource. + * @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 resourceGroupName, + String location, String dryrunName, DryrunResourceInner parameters) { + return this.beginCreateDryrunAsync(resourceGroupName, location, dryrunName, parameters).getSyncPoller(); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @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 the DryrunResource. + * @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 resourceGroupName, + String location, String dryrunName, DryrunResourceInner parameters, Context context) { + return this.beginCreateDryrunAsync(resourceGroupName, location, dryrunName, parameters, context) + .getSyncPoller(); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @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 the DryrunResource. + * @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 resourceGroupName, String location, String dryrunName, + DryrunResourceInner parameters) { + return beginCreateDryrunAsync(resourceGroupName, location, dryrunName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @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 the DryrunResource. + * @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 resourceGroupName, String location, String dryrunName, + DryrunResourceInner parameters, Context context) { + return beginCreateDryrunAsync(resourceGroupName, location, dryrunName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @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 the DryrunResource. + * @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 resourceGroupName, String location, String dryrunName, + DryrunResourceInner parameters) { + return createDryrunAsync(resourceGroupName, location, dryrunName, parameters).block(); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @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 the DryrunResource. + * @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 resourceGroupName, String location, String dryrunName, + DryrunResourceInner parameters, Context context) { + return createDryrunAsync(resourceGroupName, location, dryrunName, parameters, context).block(); + } + + /** + * update a dryrun job to do necessary check before actual creation. + * + * @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 the DryrunResource. + * @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 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 (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, 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 resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of the DryrunResource. + * @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 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 (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, dryrunName, parameters, accept, context); + } + + /** + * update a dryrun job to do necessary check before actual creation. + * + * @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 the DryrunResource. + * @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 resourceGroupName, String location, String dryrunName, DryrunPatch parameters) { + Mono>> mono + = updateDryrunWithResponseAsync(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 resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of the DryrunResource. + * @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 resourceGroupName, String location, String dryrunName, DryrunPatch parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateDryrunWithResponseAsync(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 resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of Azure region. + * @param dryrunName The name of the DryrunResource. + * @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 resourceGroupName, + String location, String dryrunName, DryrunPatch parameters) { + return this.beginUpdateDryrunAsync(resourceGroupName, location, dryrunName, parameters).getSyncPoller(); + } + + /** + * update a dryrun job to do necessary check before actual creation. + * + * @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 the DryrunResource. + * @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 resourceGroupName, + String location, String dryrunName, DryrunPatch parameters, Context context) { + return this.beginUpdateDryrunAsync(resourceGroupName, location, dryrunName, parameters, context) + .getSyncPoller(); + } + + /** + * update a dryrun job to do necessary check before actual creation. + * + * @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 the DryrunResource. + * @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 resourceGroupName, String location, String dryrunName, + DryrunPatch parameters) { + return beginUpdateDryrunAsync(resourceGroupName, location, dryrunName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * update a dryrun job to do necessary check before actual creation. + * + * @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 the DryrunResource. + * @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 resourceGroupName, String location, String dryrunName, + DryrunPatch parameters, Context context) { + return beginUpdateDryrunAsync(resourceGroupName, location, dryrunName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * update a dryrun job to do necessary check before actual creation. + * + * @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 the DryrunResource. + * @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 resourceGroupName, String location, String dryrunName, + DryrunPatch parameters) { + return updateDryrunAsync(resourceGroupName, location, dryrunName, parameters).block(); + } + + /** + * update a dryrun job to do necessary check before actual creation. + * + * @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 the DryrunResource. + * @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 resourceGroupName, String location, String dryrunName, + DryrunPatch parameters, Context context) { + return updateDryrunAsync(resourceGroupName, location, dryrunName, parameters, context).block(); + } + + /** + * delete a dryrun job. + * + * @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 the DryrunResource. + * @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 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 (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, dryrunName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * delete a dryrun job. + * + * @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 the DryrunResource. + * @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 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 (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, dryrunName, accept, context); + } + + /** + * delete a dryrun job. + * + * @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 the DryrunResource. + * @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 resourceGroupName, String location, String dryrunName) { + return deleteDryrunWithResponseAsync(resourceGroupName, location, dryrunName).flatMap(ignored -> Mono.empty()); + } + + /** + * delete a dryrun job. + * + * @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 the DryrunResource. + * @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 resourceGroupName, String location, String dryrunName, + Context context) { + return deleteDryrunWithResponseAsync(resourceGroupName, location, dryrunName, context).block(); + } + + /** + * delete a dryrun job. + * + * @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 the DryrunResource. + * @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 resourceGroupName, String location, String dryrunName) { + deleteDryrunWithResponse(resourceGroupName, location, dryrunName, Context.NONE); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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. + * @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)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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. + * @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/ConnectorsImpl.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ConnectorsImpl.java new file mode 100644 index 000000000000..3b4f6dc525a3 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ConnectorsImpl.java @@ -0,0 +1,326 @@ +// 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 list(String resourceGroupName, String location) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, location); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LinkerResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String location, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, location, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LinkerResourceImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String location, String connectorName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(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 resourceGroupName, String location, String connectorName) { + LinkerResourceInner inner = this.serviceClient().get(resourceGroupName, location, connectorName); + if (inner != null) { + return new LinkerResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String location, String connectorName) { + this.serviceClient().delete(resourceGroupName, location, connectorName); + } + + public void delete(String resourceGroupName, String location, String connectorName, Context context) { + this.serviceClient().delete(resourceGroupName, location, connectorName, context); + } + + public Response generateConfigurationsWithResponse(String resourceGroupName, String location, + String connectorName, ConfigurationInfo parameters, Context context) { + Response inner = this.serviceClient() + .generateConfigurationsWithResponse(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 resourceGroupName, String location, String connectorName) { + ConfigurationResultInner inner + = this.serviceClient().generateConfigurations(resourceGroupName, location, connectorName); + if (inner != null) { + return new ConfigurationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ValidateOperationResult validate(String resourceGroupName, String location, String connectorName) { + ValidateOperationResultInner inner = this.serviceClient().validate(resourceGroupName, location, connectorName); + if (inner != null) { + return new ValidateOperationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ValidateOperationResult validate(String resourceGroupName, String location, String connectorName, + Context context) { + ValidateOperationResultInner inner + = this.serviceClient().validate(resourceGroupName, location, connectorName, context); + if (inner != null) { + return new ValidateOperationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listDryrun(String resourceGroupName, String location) { + PagedIterable inner = this.serviceClient().listDryrun(resourceGroupName, location); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DryrunResourceImpl(inner1, this.manager())); + } + + public PagedIterable listDryrun(String resourceGroupName, String location, Context context) { + PagedIterable inner + = this.serviceClient().listDryrun(resourceGroupName, location, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DryrunResourceImpl(inner1, this.manager())); + } + + public Response getDryrunWithResponse(String resourceGroupName, String location, String dryrunName, + Context context) { + Response inner + = this.serviceClient().getDryrunWithResponse(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 resourceGroupName, String location, String dryrunName) { + DryrunResourceInner inner = this.serviceClient().getDryrun(resourceGroupName, location, dryrunName); + if (inner != null) { + return new DryrunResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteDryrunWithResponse(String resourceGroupName, String location, String dryrunName, + Context context) { + return this.serviceClient().deleteDryrunWithResponse(resourceGroupName, location, dryrunName, context); + } + + public void deleteDryrun(String resourceGroupName, String location, String dryrunName) { + this.serviceClient().deleteDryrun(resourceGroupName, location, dryrunName); + } + + public LinkerResource getById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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(resourceGroupName, location, connectorName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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(resourceGroupName, location, connectorName, context); + } + + public DryrunResource getDryrunById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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(resourceGroupName, location, dryrunName, Context.NONE).getValue(); + } + + public Response getDryrunByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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(resourceGroupName, location, dryrunName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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(resourceGroupName, location, connectorName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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(resourceGroupName, location, connectorName, context); + } + + public void deleteDryrunById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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(resourceGroupName, location, dryrunName, Context.NONE); + } + + public Response deleteDryrunByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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(resourceGroupName, location, dryrunName, context); + } + + private ConnectorsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager() { + return this.serviceManager; + } + + public LinkerResourceImpl define(String name) { + return new LinkerResourceImpl(name, this.manager()); + } + + public DryrunResourceImpl defineDryrun(String name) { + return new DryrunResourceImpl(name, this.manager()); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/DaprConfigurationResourceImpl.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/DaprConfigurationResourceImpl.java new file mode 100644 index 000000000000..4e005ba6d260 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/DaprConfigurationResourceImpl.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.implementation; + +import com.azure.resourcemanager.servicelinker.fluent.models.DaprConfigurationResourceInner; +import com.azure.resourcemanager.servicelinker.models.AuthType; +import com.azure.resourcemanager.servicelinker.models.DaprConfigurationResource; +import com.azure.resourcemanager.servicelinker.models.DaprProperties; + +public final class DaprConfigurationResourceImpl implements DaprConfigurationResource { + private DaprConfigurationResourceInner innerObject; + + private final com.azure.resourcemanager.servicelinker.ServiceLinkerManager serviceManager; + + DaprConfigurationResourceImpl(DaprConfigurationResourceInner innerObject, + com.azure.resourcemanager.servicelinker.ServiceLinkerManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String targetType() { + return this.innerModel().targetType(); + } + + public AuthType authType() { + return this.innerModel().authType(); + } + + public DaprProperties daprProperties() { + return this.innerModel().daprProperties(); + } + + public DaprConfigurationResourceInner 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/DryrunResourceImpl.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/DryrunResourceImpl.java new file mode 100644 index 000000000000..6c380119a2b3 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/DryrunResourceImpl.java @@ -0,0 +1,168 @@ +// 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 resourceGroupName; + + private String location; + + private String dryrunName; + + private DryrunPatch updateParameters; + + public DryrunResourceImpl withExistingLocation(String resourceGroupName, String location) { + this.resourceGroupName = resourceGroupName; + this.location = location; + return this; + } + + public DryrunResource create() { + this.innerObject = serviceManager.serviceClient() + .getConnectors() + .createDryrun(resourceGroupName, location, dryrunName, this.innerModel(), Context.NONE); + return this; + } + + public DryrunResource create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getConnectors() + .createDryrun(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(resourceGroupName, location, dryrunName, updateParameters, Context.NONE); + return this; + } + + public DryrunResource apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getConnectors() + .updateDryrun(resourceGroupName, location, dryrunName, updateParameters, context); + return this; + } + + DryrunResourceImpl(DryrunResourceInner innerObject, + com.azure.resourcemanager.servicelinker.ServiceLinkerManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.location = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "locations"); + this.dryrunName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "dryruns"); + } + + public DryrunResource refresh() { + this.innerObject = serviceManager.serviceClient() + .getConnectors() + .getDryrunWithResponse(resourceGroupName, location, dryrunName, Context.NONE) + .getValue(); + return this; + } + + public DryrunResource refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getConnectors() + .getDryrunWithResponse(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 bc441c1a1fff..da8323d450d6 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,35 +89,38 @@ private com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager() { return this.serviceManager; } - private String resourceUri; + 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 resourceGroupName, String location) { + this.resourceGroupName = resourceGroupName; + this.location = location; return this; } public LinkerResource create() { this.innerObject = serviceManager.serviceClient() - .getLinkers() - .createOrUpdate(resourceUri, linkerName, this.innerModel(), Context.NONE); + .getConnectors() + .createOrUpdate(resourceGroupName, location, connectorName, this.innerModel(), Context.NONE); return this; } public LinkerResource create(Context context) { this.innerObject = serviceManager.serviceClient() - .getLinkers() - .createOrUpdate(resourceUri, linkerName, this.innerModel(), context); + .getConnectors() + .createOrUpdate(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() { @@ -113,14 +130,15 @@ public LinkerResourceImpl update() { public LinkerResource apply() { this.innerObject = serviceManager.serviceClient() - .getLinkers() - .update(resourceUri, linkerName, updateParameters, Context.NONE); + .getConnectors() + .update(resourceGroupName, location, connectorName, updateParameters, Context.NONE); return this; } public LinkerResource apply(Context context) { - this.innerObject - = serviceManager.serviceClient().getLinkers().update(resourceUri, linkerName, updateParameters, context); + this.innerObject = serviceManager.serviceClient() + .getConnectors() + .update(resourceGroupName, location, connectorName, updateParameters, context); return this; } @@ -128,40 +146,43 @@ public LinkerResource apply(Context context) { com.azure.resourcemanager.servicelinker.ServiceLinkerManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceUri = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), - "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", "resourceUri"); - this.linkerName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), - "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", "linkerName"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.location = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "locations"); + this.connectorName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "connectors"); } public LinkerResource refresh() { this.innerObject = serviceManager.serviceClient() - .getLinkers() - .getWithResponse(resourceUri, linkerName, Context.NONE) + .getConnectors() + .getWithResponse(resourceGroupName, location, connectorName, Context.NONE) .getValue(); return this; } public LinkerResource refresh(Context context) { - this.innerObject - = serviceManager.serviceClient().getLinkers().getWithResponse(resourceUri, linkerName, context).getValue(); + this.innerObject = serviceManager.serviceClient() + .getConnectors() + .getWithResponse(resourceGroupName, location, connectorName, context) + .getValue(); return this; } - public ValidateOperationResult validate() { - return serviceManager.linkers().validate(resourceUri, linkerName); + public Response generateConfigurationsWithResponse(ConfigurationInfo parameters, + Context context) { + return serviceManager.connectors() + .generateConfigurationsWithResponse(resourceGroupName, location, connectorName, parameters, context); } - public ValidateOperationResult validate(Context context) { - return serviceManager.linkers().validate(resourceUri, linkerName, context); + public ConfigurationResult generateConfigurations() { + return serviceManager.connectors().generateConfigurations(resourceGroupName, location, connectorName); } - public Response listConfigurationsWithResponse(Context context) { - return serviceManager.linkers().listConfigurationsWithResponse(resourceUri, linkerName, context); + public ValidateOperationResult validate() { + return serviceManager.connectors().validate(resourceGroupName, location, connectorName); } - public SourceConfigurationResult listConfigurations() { - return serviceManager.linkers().listConfigurations(resourceUri, linkerName); + public ValidateOperationResult validate(Context context) { + return serviceManager.connectors().validate(resourceGroupName, location, connectorName, context); } public LinkerResourceImpl withTargetService(TargetServiceBase targetService) { @@ -224,6 +245,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 b4f54a2015f5..d97466751fe1 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,12 @@ 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.LinkersUpdateResponse; +import com.azure.resourcemanager.servicelinker.models.ResourceList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -75,80 +76,82 @@ public final class LinkersClientImpl implements LinkersClient { @ServiceInterface(name = "ServiceLinkerManagem") public interface LinkersService { @Headers({ "Content-Type: application/json" }) - @Get("/{resourceUri}/providers/Microsoft.ServiceLinker/linkers") + @Get("/{resourceUri}/{providers}/{resourceUri}/connectors") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("providers") String providers, + @PathParam("resourceUri") String resourceUri, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}") + @Get("/{resourceUri}/{providers}/Microsoft.ServiceLinker/{linkers}/{resourceUri}/{linkerName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get(@HostParam("$host") String endpoint, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, @PathParam("linkerName") String linkerName, - @HeaderParam("Accept") String accept, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("providers") String providers, + @PathParam("linkers") String linkers, @PathParam("resourceUri") String resourceUri, + @PathParam("linkerName") String linkerName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}") + @Put("/{resourceUri}/{providers}/Microsoft.ServiceLinker/{linkers}/{resourceUri}/{linkerName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, @PathParam("linkerName") String linkerName, - @BodyParam("application/json") LinkerResourceInner parameters, @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @PathParam("providers") String providers, + @PathParam("linkers") String linkers, @PathParam("resourceUri") String resourceUri, + @PathParam("linkerName") String linkerName, @BodyParam("application/json") LinkerResourceInner parameters, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}") - @ExpectedResponses({ 200, 202, 204 }) + @Patch("/{resourceUri}/{providers}/Microsoft.ServiceLinker/{linkers}/{resourceUri}/{linkerName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, @PathParam("linkerName") String linkerName, + Mono update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("providers") String providers, + @PathParam("linkers") String linkers, @PathParam("resourceUri") String resourceUri, + @PathParam("linkerName") String linkerName, @BodyParam("application/json") LinkerPatch parameters, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}") - @ExpectedResponses({ 200, 201 }) + @Delete("/{resourceUri}/{providers}/Microsoft.ServiceLinker/{linkers}/{resourceUri}/{linkerName}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, @PathParam("linkerName") String linkerName, - @BodyParam("application/json") LinkerPatch parameters, @HeaderParam("Accept") String accept, - Context context); + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("providers") String providers, + @PathParam("linkers") String linkers, @PathParam("resourceUri") String resourceUri, + @PathParam("linkerName") String linkerName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/validateLinker") - @ExpectedResponses({ 200, 202 }) + @Post("/{resourceUri}/{providers}/Microsoft.ServiceLinker/{linkers}/{resourceUri}/{linkerName}/listConfigurations") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> validate(@HostParam("$host") String endpoint, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, @PathParam("linkerName") String linkerName, - @HeaderParam("Accept") String accept, Context context); + Mono> listConfigurations(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("providers") String providers, + @PathParam("linkers") String linkers, @PathParam("resourceUri") String resourceUri, + @PathParam("linkerName") String linkerName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/listConfigurations") - @ExpectedResponses({ 200 }) + @Post("/{resourceUri}/{providers}/Microsoft.ServiceLinker/{linkers}/{resourceUri}/{linkerName}/validateLinker") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listConfigurations(@HostParam("$host") String endpoint, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, @PathParam("linkerName") String linkerName, - @HeaderParam("Accept") String accept, Context context); + Mono>> validate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("providers") String providers, + @PathParam("linkers") String linkers, @PathParam("resourceUri") String resourceUri, + @PathParam("linkerName") String linkerName, @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, + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * 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 providers {resourceUri}. * @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. @@ -156,26 +159,31 @@ Mono> listNext(@PathParam(value = "nextLink", encoded = tru * @return the list of Linker along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceUri) { + private Mono> listSinglePageAsync(String providers, String resourceUri) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (providers == null) { + return Mono.error(new IllegalArgumentException("Parameter providers 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.list(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), - accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), providers, + resourceUri, 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 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 providers {resourceUri}. * @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. @@ -184,24 +192,31 @@ private Mono> listSinglePageAsync(String reso * @return the list of Linker along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceUri, Context context) { + private Mono> listSinglePageAsync(String providers, 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 (providers == null) { + return Mono.error(new IllegalArgumentException("Parameter providers 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.list(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context) + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), providers, resourceUri, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } /** - * 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 providers {resourceUri}. * @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. @@ -209,13 +224,16 @@ private Mono> listSinglePageAsync(String reso * @return the list of Linker as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceUri) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceUri), nextLink -> listNextSinglePageAsync(nextLink)); + private PagedFlux listAsync(String providers, String resourceUri) { + return new PagedFlux<>(() -> listSinglePageAsync(providers, resourceUri), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * 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 providers {resourceUri}. * @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. @@ -224,14 +242,16 @@ private PagedFlux listAsync(String resourceUri) { * @return the list of Linker as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceUri, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, context), + private PagedFlux listAsync(String providers, String resourceUri, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(providers, resourceUri, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * 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 providers {resourceUri}. * @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. @@ -239,13 +259,15 @@ private PagedFlux listAsync(String resourceUri, Context con * @return the list of Linker as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceUri) { - return new PagedIterable<>(listAsync(resourceUri)); + public PagedIterable list(String providers, String resourceUri) { + return new PagedIterable<>(listAsync(providers, 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 providers {resourceUri}. * @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. @@ -254,13 +276,15 @@ public PagedIterable list(String resourceUri) { * @return the list of Linker as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceUri, Context context) { - return new PagedIterable<>(listAsync(resourceUri, context)); + public PagedIterable list(String providers, String resourceUri, Context context) { + return new PagedIterable<>(listAsync(providers, resourceUri, context)); } /** * Returns Linker resource for a given name. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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. @@ -270,11 +294,18 @@ public PagedIterable list(String resourceUri, Context conte * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceUri, String linkerName) { + private Mono> getWithResponseAsync(String providers, String linkers, + String resourceUri, String linkerName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (providers == null) { + return Mono.error(new IllegalArgumentException("Parameter providers is required and cannot be null.")); + } + if (linkers == null) { + return Mono.error(new IllegalArgumentException("Parameter linkers is required and cannot be null.")); + } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -283,14 +314,16 @@ private Mono> getWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), - linkerName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), providers, + linkers, resourceUri, linkerName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Returns Linker resource for a given name. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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. @@ -301,12 +334,18 @@ private Mono> getWithResponseAsync(String resource * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceUri, String linkerName, - Context context) { + private Mono> getWithResponseAsync(String providers, String linkers, + String resourceUri, String linkerName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (providers == null) { + return Mono.error(new IllegalArgumentException("Parameter providers is required and cannot be null.")); + } + if (linkers == null) { + return Mono.error(new IllegalArgumentException("Parameter linkers is required and cannot be null.")); + } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -315,13 +354,15 @@ private Mono> getWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), linkerName, accept, - context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), providers, linkers, resourceUri, + linkerName, accept, context); } /** * Returns Linker resource for a given name. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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. @@ -330,13 +371,17 @@ private Mono> getWithResponseAsync(String resource * @return linker of source and target resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceUri, String linkerName) { - return getWithResponseAsync(resourceUri, linkerName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono getAsync(String providers, String linkers, String resourceUri, + String linkerName) { + return getWithResponseAsync(providers, linkers, resourceUri, linkerName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Returns Linker resource for a given name. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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. @@ -346,13 +391,16 @@ private Mono getAsync(String resourceUri, String linkerName * @return linker of source and target resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceUri, String linkerName, Context context) { - return getWithResponseAsync(resourceUri, linkerName, context).block(); + public Response getWithResponse(String providers, String linkers, String resourceUri, + String linkerName, Context context) { + return getWithResponseAsync(providers, linkers, resourceUri, linkerName, context).block(); } /** * Returns Linker resource for a given name. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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. @@ -361,13 +409,15 @@ public Response getWithResponse(String resourceUri, String * @return linker of source and target resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public LinkerResourceInner get(String resourceUri, String linkerName) { - return getWithResponse(resourceUri, linkerName, Context.NONE).getValue(); + public LinkerResourceInner get(String providers, String linkers, String resourceUri, String linkerName) { + return getWithResponse(providers, linkers, resourceUri, linkerName, Context.NONE).getValue(); } /** - * Create or update linker resource. + * Create or update Linker resource. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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. @@ -378,12 +428,18 @@ public LinkerResourceInner get(String resourceUri, String linkerName) { * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceUri, String linkerName, - LinkerResourceInner parameters) { + private Mono>> createOrUpdateWithResponseAsync(String providers, String linkers, + String resourceUri, String linkerName, LinkerResourceInner parameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (providers == null) { + return Mono.error(new IllegalArgumentException("Parameter providers is required and cannot be null.")); + } + if (linkers == null) { + return Mono.error(new IllegalArgumentException("Parameter linkers is required and cannot be null.")); + } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -397,14 +453,16 @@ private Mono>> createOrUpdateWithResponseAsync(String } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceUri, - this.client.getApiVersion(), linkerName, parameters, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + providers, linkers, resourceUri, linkerName, parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or update linker resource. + * Create or update Linker resource. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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. @@ -416,12 +474,18 @@ private Mono>> createOrUpdateWithResponseAsync(String * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceUri, String linkerName, - LinkerResourceInner parameters, Context context) { + private Mono>> createOrUpdateWithResponseAsync(String providers, String linkers, + String resourceUri, String linkerName, 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 (providers == null) { + return Mono.error(new IllegalArgumentException("Parameter providers is required and cannot be null.")); + } + if (linkers == null) { + return Mono.error(new IllegalArgumentException("Parameter linkers is required and cannot be null.")); + } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -435,13 +499,15 @@ private Mono>> createOrUpdateWithResponseAsync(String } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), linkerName, - parameters, accept, context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), providers, linkers, + resourceUri, linkerName, parameters, accept, context); } /** - * Create or update linker resource. + * Create or update Linker resource. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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. @@ -451,16 +517,19 @@ private Mono>> createOrUpdateWithResponseAsync(String * @return the {@link PollerFlux} for polling of linker of source and target resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, LinkerResourceInner> - beginCreateOrUpdateAsync(String resourceUri, String linkerName, LinkerResourceInner parameters) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceUri, linkerName, parameters); + private PollerFlux, LinkerResourceInner> beginCreateOrUpdateAsync(String providers, + String linkers, String resourceUri, String linkerName, LinkerResourceInner parameters) { + Mono>> mono + = createOrUpdateWithResponseAsync(providers, linkers, resourceUri, linkerName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), LinkerResourceInner.class, LinkerResourceInner.class, this.client.getContext()); } /** - * Create or update linker resource. + * Create or update Linker resource. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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. @@ -471,18 +540,20 @@ private Mono>> createOrUpdateWithResponseAsync(String * @return the {@link PollerFlux} for polling of linker of source and target resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, LinkerResourceInner> beginCreateOrUpdateAsync( - String resourceUri, String linkerName, LinkerResourceInner parameters, Context context) { + private PollerFlux, LinkerResourceInner> beginCreateOrUpdateAsync(String providers, + String linkers, String resourceUri, String linkerName, LinkerResourceInner parameters, Context context) { context = this.client.mergeContext(context); Mono>> mono - = createOrUpdateWithResponseAsync(resourceUri, linkerName, parameters, context); + = createOrUpdateWithResponseAsync(providers, linkers, resourceUri, linkerName, parameters, context); return this.client.getLroResult(mono, this.client.getHttpPipeline(), LinkerResourceInner.class, LinkerResourceInner.class, context); } /** - * Create or update linker resource. + * Create or update Linker resource. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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. @@ -492,14 +563,16 @@ private PollerFlux, LinkerResourceInner> beginCr * @return the {@link SyncPoller} for polling of linker of source and target resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, LinkerResourceInner> beginCreateOrUpdate(String resourceUri, - String linkerName, LinkerResourceInner parameters) { - return this.beginCreateOrUpdateAsync(resourceUri, linkerName, parameters).getSyncPoller(); + public SyncPoller, LinkerResourceInner> beginCreateOrUpdate(String providers, + String linkers, String resourceUri, String linkerName, LinkerResourceInner parameters) { + return this.beginCreateOrUpdateAsync(providers, linkers, resourceUri, linkerName, parameters).getSyncPoller(); } /** - * Create or update linker resource. + * Create or update Linker resource. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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. @@ -510,14 +583,17 @@ public SyncPoller, LinkerResourceInner> beginCre * @return the {@link SyncPoller} for polling of linker of source and target resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, LinkerResourceInner> beginCreateOrUpdate(String resourceUri, - String linkerName, LinkerResourceInner parameters, Context context) { - return this.beginCreateOrUpdateAsync(resourceUri, linkerName, parameters, context).getSyncPoller(); + public SyncPoller, LinkerResourceInner> beginCreateOrUpdate(String providers, + String linkers, String resourceUri, String linkerName, LinkerResourceInner parameters, Context context) { + return this.beginCreateOrUpdateAsync(providers, linkers, resourceUri, linkerName, parameters, context) + .getSyncPoller(); } /** - * Create or update linker resource. + * Create or update Linker resource. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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. @@ -527,15 +603,17 @@ public SyncPoller, LinkerResourceInner> beginCre * @return linker of source and target resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceUri, String linkerName, - LinkerResourceInner parameters) { - return beginCreateOrUpdateAsync(resourceUri, linkerName, parameters).last() + private Mono createOrUpdateAsync(String providers, String linkers, String resourceUri, + String linkerName, LinkerResourceInner parameters) { + return beginCreateOrUpdateAsync(providers, linkers, resourceUri, linkerName, parameters).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Create or update linker resource. + * Create or update Linker resource. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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. @@ -546,15 +624,17 @@ private Mono createOrUpdateAsync(String resourceUri, String * @return linker of source and target resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceUri, String linkerName, - LinkerResourceInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceUri, linkerName, parameters, context).last() + private Mono createOrUpdateAsync(String providers, String linkers, String resourceUri, + String linkerName, LinkerResourceInner parameters, Context context) { + return beginCreateOrUpdateAsync(providers, linkers, resourceUri, linkerName, parameters, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Create or update linker resource. + * Create or update Linker resource. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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. @@ -564,13 +644,16 @@ private Mono createOrUpdateAsync(String resourceUri, String * @return linker of source and target resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public LinkerResourceInner createOrUpdate(String resourceUri, String linkerName, LinkerResourceInner parameters) { - return createOrUpdateAsync(resourceUri, linkerName, parameters).block(); + public LinkerResourceInner createOrUpdate(String providers, String linkers, String resourceUri, String linkerName, + LinkerResourceInner parameters) { + return createOrUpdateAsync(providers, linkers, resourceUri, linkerName, parameters).block(); } /** - * Create or update linker resource. + * Create or update Linker resource. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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. @@ -581,433 +664,411 @@ public LinkerResourceInner createOrUpdate(String resourceUri, String linkerName, * @return linker of source and target resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public LinkerResourceInner createOrUpdate(String resourceUri, String linkerName, LinkerResourceInner parameters, - Context context) { - return createOrUpdateAsync(resourceUri, linkerName, parameters, context).block(); + public LinkerResourceInner createOrUpdate(String providers, String linkers, String resourceUri, String linkerName, + LinkerResourceInner parameters, Context context) { + return createOrUpdateAsync(providers, linkers, resourceUri, linkerName, parameters, context).block(); } /** - * Delete a link. + * Operation to update an existing Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 ManagementException 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}. + * @return linker of source and target resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceUri, String linkerName) { + private Mono updateWithResponseAsync(String providers, String linkers, String resourceUri, + String linkerName, LinkerPatch parameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (providers == null) { + return Mono.error(new IllegalArgumentException("Parameter providers is required and cannot be null.")); + } + if (linkers == null) { + return Mono.error(new IllegalArgumentException("Parameter linkers 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) { + 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.delete(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), - linkerName, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), providers, + linkers, resourceUri, linkerName, parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete a link. + * Operation to update an existing Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 ManagementException 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}. + * @return linker of source and target resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceUri, String linkerName, - Context context) { + private Mono updateWithResponseAsync(String providers, String linkers, String resourceUri, + String linkerName, 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 (providers == null) { + return Mono.error(new IllegalArgumentException("Parameter providers is required and cannot be null.")); + } + if (linkers == null) { + return Mono.error(new IllegalArgumentException("Parameter linkers 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) { + 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.delete(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), linkerName, accept, - context); - } - - /** - * Delete a link. - * - * @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 long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceUri, String linkerName) { - Mono>> mono = deleteWithResponseAsync(resourceUri, linkerName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), providers, linkers, resourceUri, + linkerName, parameters, accept, context); } /** - * Delete a link. - * - * @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 the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceUri, String linkerName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceUri, linkerName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Delete a link. - * - * @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 long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceUri, String linkerName) { - return this.beginDeleteAsync(resourceUri, linkerName).getSyncPoller(); - } - - /** - * Delete a link. - * - * @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 the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceUri, String linkerName, Context context) { - return this.beginDeleteAsync(resourceUri, linkerName, context).getSyncPoller(); - } - - /** - * Delete a link. + * Operation to update an existing Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 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. + * @return linker of source and target resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceUri, String linkerName) { - return beginDeleteAsync(resourceUri, linkerName).last().flatMap(this.client::getLroFinalResultOrError); + private Mono updateAsync(String providers, String linkers, String resourceUri, + String linkerName, LinkerPatch parameters) { + return updateWithResponseAsync(providers, linkers, resourceUri, linkerName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Delete a link. + * Operation to update an existing Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 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 resourceUri, String linkerName, Context context) { - return beginDeleteAsync(resourceUri, linkerName, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete a link. - * - * @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 linker of source and target resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceUri, String linkerName) { - deleteAsync(resourceUri, linkerName).block(); + public LinkersUpdateResponse updateWithResponse(String providers, String linkers, String resourceUri, + String linkerName, LinkerPatch parameters, Context context) { + return updateWithResponseAsync(providers, linkers, resourceUri, linkerName, parameters, context).block(); } /** - * Delete a link. + * Operation to update an existing Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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. + * @param parameters Linker 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 void delete(String resourceUri, String linkerName, Context context) { - deleteAsync(resourceUri, linkerName, context).block(); + public LinkerResourceInner update(String providers, String linkers, String resourceUri, String linkerName, + LinkerPatch parameters) { + return updateWithResponse(providers, linkers, resourceUri, linkerName, parameters, Context.NONE).getValue(); } /** - * Operation to update an existing link. + * Delete a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 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}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceUri, String linkerName, - LinkerPatch parameters) { + private Mono>> deleteWithResponseAsync(String providers, String linkers, + String resourceUri, String linkerName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (providers == null) { + return Mono.error(new IllegalArgumentException("Parameter providers is required and cannot be null.")); + } + if (linkers == null) { + return Mono.error(new IllegalArgumentException("Parameter linkers 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) { - 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(), resourceUri, this.client.getApiVersion(), - linkerName, parameters, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), providers, + linkers, resourceUri, linkerName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Operation to update an existing link. + * Delete a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 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}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceUri, String linkerName, - LinkerPatch parameters, Context context) { + private Mono>> deleteWithResponseAsync(String providers, String linkers, + String resourceUri, String linkerName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (providers == null) { + return Mono.error(new IllegalArgumentException("Parameter providers is required and cannot be null.")); + } + if (linkers == null) { + return Mono.error(new IllegalArgumentException("Parameter linkers 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) { - 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(), resourceUri, this.client.getApiVersion(), linkerName, - parameters, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), providers, linkers, resourceUri, + linkerName, accept, context); } /** - * Operation to update an existing link. + * Delete a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 ManagementException 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. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, LinkerResourceInner> beginUpdateAsync(String resourceUri, - String linkerName, LinkerPatch parameters) { - Mono>> mono = updateWithResponseAsync(resourceUri, linkerName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - LinkerResourceInner.class, LinkerResourceInner.class, this.client.getContext()); + private PollerFlux, Void> beginDeleteAsync(String providers, String linkers, String resourceUri, + String linkerName) { + Mono>> mono = deleteWithResponseAsync(providers, linkers, resourceUri, linkerName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * Operation to update an existing link. + * Delete a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 ManagementException 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. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, LinkerResourceInner> beginUpdateAsync(String resourceUri, - String linkerName, LinkerPatch parameters, Context context) { + private PollerFlux, Void> beginDeleteAsync(String providers, String linkers, String resourceUri, + String linkerName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = updateWithResponseAsync(resourceUri, linkerName, parameters, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - LinkerResourceInner.class, LinkerResourceInner.class, context); + Mono>> mono + = deleteWithResponseAsync(providers, linkers, resourceUri, linkerName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** - * Operation to update an existing link. + * Delete a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 ManagementException 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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, LinkerResourceInner> beginUpdate(String resourceUri, - String linkerName, LinkerPatch parameters) { - return this.beginUpdateAsync(resourceUri, linkerName, parameters).getSyncPoller(); + public SyncPoller, Void> beginDelete(String providers, String linkers, String resourceUri, + String linkerName) { + return this.beginDeleteAsync(providers, linkers, resourceUri, linkerName).getSyncPoller(); } /** - * Operation to update an existing link. + * Delete a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 ManagementException 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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, LinkerResourceInner> beginUpdate(String resourceUri, - String linkerName, LinkerPatch parameters, Context context) { - return this.beginUpdateAsync(resourceUri, linkerName, parameters, context).getSyncPoller(); + public SyncPoller, Void> beginDelete(String providers, String linkers, String resourceUri, + String linkerName, Context context) { + return this.beginDeleteAsync(providers, linkers, resourceUri, linkerName, context).getSyncPoller(); } /** - * Operation to update an existing link. + * Delete a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 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}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceUri, String linkerName, LinkerPatch parameters) { - return beginUpdateAsync(resourceUri, linkerName, parameters).last() + private Mono deleteAsync(String providers, String linkers, String resourceUri, String linkerName) { + return beginDeleteAsync(providers, linkers, resourceUri, linkerName).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Operation to update an existing link. + * Delete a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 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}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceUri, String linkerName, LinkerPatch parameters, + private Mono deleteAsync(String providers, String linkers, String resourceUri, String linkerName, Context context) { - return beginUpdateAsync(resourceUri, linkerName, parameters, context).last() + return beginDeleteAsync(providers, linkers, resourceUri, linkerName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Operation to update an existing link. + * Delete a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 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 resourceUri, String linkerName, LinkerPatch parameters) { - return updateAsync(resourceUri, linkerName, parameters).block(); + public void delete(String providers, String linkers, String resourceUri, String linkerName) { + deleteAsync(providers, linkers, resourceUri, linkerName).block(); } /** - * Operation to update an existing link. + * Delete a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 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 resourceUri, String linkerName, LinkerPatch parameters, Context context) { - return updateAsync(resourceUri, linkerName, parameters, context).block(); + public void delete(String providers, String linkers, String resourceUri, String linkerName, Context context) { + deleteAsync(providers, linkers, resourceUri, linkerName, context).block(); } /** - * Validate a link. + * list source configurations for a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 - * {@link Mono}. + * @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>> validateWithResponseAsync(String resourceUri, String linkerName) { + private Mono> listConfigurationsWithResponseAsync(String providers, + String linkers, String resourceUri, String linkerName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (providers == null) { + return Mono.error(new IllegalArgumentException("Parameter providers is required and cannot be null.")); + } + if (linkers == null) { + return Mono.error(new IllegalArgumentException("Parameter linkers is required and cannot be null.")); + } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -1016,30 +1077,38 @@ private Mono>> validateWithResponseAsync(String resour } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.validate(this.client.getEndpoint(), resourceUri, - this.client.getApiVersion(), linkerName, accept, context)) + .withContext(context -> service.listConfigurations(this.client.getEndpoint(), this.client.getApiVersion(), + providers, linkers, resourceUri, linkerName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Validate a link. + * list source configurations for a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 the validation operation result for a linker along with {@link Response} on successful completion of - * {@link Mono}. + * @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>> validateWithResponseAsync(String resourceUri, String linkerName, - Context context) { + private Mono> listConfigurationsWithResponseAsync(String providers, + String linkers, String resourceUri, String linkerName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (providers == null) { + return Mono.error(new IllegalArgumentException("Parameter providers is required and cannot be null.")); + } + if (linkers == null) { + return Mono.error(new IllegalArgumentException("Parameter linkers is required and cannot be null.")); + } if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } @@ -1048,256 +1117,302 @@ private Mono>> validateWithResponseAsync(String resour } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.validate(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), linkerName, accept, - context); + return service.listConfigurations(this.client.getEndpoint(), this.client.getApiVersion(), providers, linkers, + resourceUri, linkerName, accept, context); } /** - * Validate a link. + * list source configurations for a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 configurations for source resource, include appSettings, connectionString and serviceBindings on + * successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ValidateOperationResultInner> - beginValidateAsync(String resourceUri, String linkerName) { - Mono>> mono = validateWithResponseAsync(resourceUri, linkerName); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ValidateOperationResultInner.class, ValidateOperationResultInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listConfigurationsAsync(String providers, String linkers, String resourceUri, + String linkerName) { + return listConfigurationsWithResponseAsync(providers, linkers, resourceUri, linkerName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Validate a link. + * list source configurations for a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 the {@link PollerFlux} for polling of the validation operation result for a linker. + * @return configurations for source resource, include appSettings, connectionString and serviceBindings along with + * {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ValidateOperationResultInner> - beginValidateAsync(String resourceUri, String linkerName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = validateWithResponseAsync(resourceUri, linkerName, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ValidateOperationResultInner.class, ValidateOperationResultInner.class, - context); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listConfigurationsWithResponse(String providers, String linkers, + String resourceUri, String linkerName, Context context) { + return listConfigurationsWithResponseAsync(providers, linkers, resourceUri, linkerName, context).block(); } /** - * Validate a link. + * list source configurations for a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 configurations for source resource, include appSettings, connectionString and serviceBindings. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ValidateOperationResultInner> - beginValidate(String resourceUri, String linkerName) { - return this.beginValidateAsync(resourceUri, linkerName).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationResultInner listConfigurations(String providers, String linkers, String resourceUri, + String linkerName) { + return listConfigurationsWithResponse(providers, linkers, resourceUri, linkerName, Context.NONE).getValue(); } /** - * Validate a link. + * Validate a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 the {@link SyncPoller} for polling of the validation operation result for a linker. + * @return the validation operation result for a Linker along with {@link Response} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ValidateOperationResultInner> - beginValidate(String resourceUri, String linkerName, Context context) { - return this.beginValidateAsync(resourceUri, linkerName, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateWithResponseAsync(String providers, String linkers, + String resourceUri, String linkerName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (providers == null) { + return Mono.error(new IllegalArgumentException("Parameter providers is required and cannot be null.")); + } + if (linkers == null) { + return Mono.error(new IllegalArgumentException("Parameter linkers 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.validate(this.client.getEndpoint(), this.client.getApiVersion(), providers, + linkers, resourceUri, linkerName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Validate a link. + * Validate a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 the validation operation result for a linker on successful completion of {@link Mono}. + * @return the validation operation result for a Linker along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateAsync(String resourceUri, String linkerName) { - return beginValidateAsync(resourceUri, linkerName).last().flatMap(this.client::getLroFinalResultOrError); + private Mono>> validateWithResponseAsync(String providers, String linkers, + String resourceUri, String linkerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (providers == null) { + return Mono.error(new IllegalArgumentException("Parameter providers is required and cannot be null.")); + } + if (linkers == null) { + return Mono.error(new IllegalArgumentException("Parameter linkers 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.validate(this.client.getEndpoint(), this.client.getApiVersion(), providers, linkers, resourceUri, + linkerName, accept, context); } /** - * Validate a link. + * Validate a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 the validation operation result for a linker on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of the validation operation result for a Linker. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateAsync(String resourceUri, String linkerName, Context context) { - return beginValidateAsync(resourceUri, linkerName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ValidateOperationResultInner> + beginValidateAsync(String providers, String linkers, String resourceUri, String linkerName) { + Mono>> mono = validateWithResponseAsync(providers, linkers, resourceUri, linkerName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ValidateOperationResultInner.class, ValidateOperationResultInner.class, + this.client.getContext()); } /** - * Validate a link. + * Validate a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 the validation operation result for a linker. + * @return the {@link PollerFlux} for polling of the validation operation result for a Linker. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ValidateOperationResultInner validate(String resourceUri, String linkerName) { - return validateAsync(resourceUri, linkerName).block(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ValidateOperationResultInner> + beginValidateAsync(String providers, String linkers, String resourceUri, String linkerName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = validateWithResponseAsync(providers, linkers, resourceUri, linkerName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ValidateOperationResultInner.class, ValidateOperationResultInner.class, + context); } /** - * Validate a link. + * Validate a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 the validation operation result for a linker. + * @return the {@link SyncPoller} for polling of the validation operation result for a Linker. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ValidateOperationResultInner validate(String resourceUri, String linkerName, Context context) { - return validateAsync(resourceUri, linkerName, context).block(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ValidateOperationResultInner> + beginValidate(String providers, String linkers, String resourceUri, String linkerName) { + return this.beginValidateAsync(providers, linkers, resourceUri, linkerName).getSyncPoller(); } /** - * list source configurations for a linker. + * Validate a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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} on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of the validation operation result for a Linker. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listConfigurationsWithResponseAsync(String resourceUri, - String linkerName) { - 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.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listConfigurations(this.client.getEndpoint(), resourceUri, - this.client.getApiVersion(), linkerName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ValidateOperationResultInner> + beginValidate(String providers, String linkers, String resourceUri, String linkerName, Context context) { + return this.beginValidateAsync(providers, linkers, resourceUri, linkerName, context).getSyncPoller(); } /** - * list source configurations for a linker. + * Validate a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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} 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> listConfigurationsWithResponseAsync(String resourceUri, - String linkerName, 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listConfigurations(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), - linkerName, accept, context); + private Mono validateAsync(String providers, String linkers, String resourceUri, + String linkerName) { + return beginValidateAsync(providers, linkers, resourceUri, linkerName).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * list source configurations for a linker. + * Validate a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 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 listConfigurationsAsync(String resourceUri, String linkerName) { - return listConfigurationsWithResponseAsync(resourceUri, linkerName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono validateAsync(String providers, String linkers, String resourceUri, + String linkerName, Context context) { + return beginValidateAsync(providers, linkers, resourceUri, linkerName, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * list source configurations for a linker. + * Validate a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 the validation operation result for a Linker. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listConfigurationsWithResponse(String resourceUri, - String linkerName, Context context) { - return listConfigurationsWithResponseAsync(resourceUri, linkerName, context).block(); + public ValidateOperationResultInner validate(String providers, String linkers, String resourceUri, + String linkerName) { + return validateAsync(providers, linkers, resourceUri, linkerName).block(); } /** - * list source configurations for a linker. + * Validate a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 the validation operation result for a Linker. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SourceConfigurationResultInner listConfigurations(String resourceUri, String linkerName) { - return listConfigurationsWithResponse(resourceUri, linkerName, Context.NONE).getValue(); + public ValidateOperationResultInner validate(String providers, String linkers, String resourceUri, + String linkerName, Context context) { + return validateAsync(providers, linkers, resourceUri, linkerName, context).block(); } /** 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 4f25dfa837cb..87ee23bdc1cb 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,14 @@ 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.LinkersUpdateResponse; import com.azure.resourcemanager.servicelinker.models.ValidateOperationResult; public final class LinkersImpl implements Linkers { @@ -31,18 +33,20 @@ public LinkersImpl(LinkersClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceUri) { - PagedIterable inner = this.serviceClient().list(resourceUri); + public PagedIterable list(String providers, String resourceUri) { + PagedIterable inner = this.serviceClient().list(providers, resourceUri); return ResourceManagerUtils.mapPage(inner, inner1 -> new LinkerResourceImpl(inner1, this.manager())); } - public PagedIterable list(String resourceUri, Context context) { - PagedIterable inner = this.serviceClient().list(resourceUri, context); + public PagedIterable list(String providers, String resourceUri, Context context) { + PagedIterable inner = this.serviceClient().list(providers, resourceUri, context); return ResourceManagerUtils.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); + public Response getWithResponse(String providers, String linkers, String resourceUri, + String linkerName, Context context) { + Response inner + = this.serviceClient().getWithResponse(providers, linkers, resourceUri, linkerName, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new LinkerResourceImpl(inner.getValue(), this.manager())); @@ -51,8 +55,8 @@ public Response getWithResponse(String resourceUri, String linke } } - public LinkerResource get(String resourceUri, String linkerName) { - LinkerResourceInner inner = this.serviceClient().get(resourceUri, linkerName); + public LinkerResource get(String providers, String linkers, String resourceUri, String linkerName) { + LinkerResourceInner inner = this.serviceClient().get(providers, linkers, resourceUri, linkerName); if (inner != null) { return new LinkerResourceImpl(inner, this.manager()); } else { @@ -60,115 +64,100 @@ public LinkerResource get(String resourceUri, String linkerName) { } } - public void deleteByResourceGroup(String resourceUri, String linkerName) { - this.serviceClient().delete(resourceUri, linkerName); - } - - 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 createOrUpdate(String providers, String linkers, String resourceUri, String linkerName, + LinkerResourceInner parameters) { + LinkerResourceInner inner + = this.serviceClient().createOrUpdate(providers, linkers, 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 createOrUpdate(String providers, String linkers, String resourceUri, String linkerName, + LinkerResourceInner parameters, Context context) { + LinkerResourceInner inner + = this.serviceClient().createOrUpdate(providers, linkers, resourceUri, linkerName, parameters, context); if (inner != null) { - return new ValidateOperationResultImpl(inner, this.manager()); + return new LinkerResourceImpl(inner, this.manager()); } else { return null; } } - public Response listConfigurationsWithResponse(String resourceUri, String linkerName, - Context context) { - Response inner - = this.serviceClient().listConfigurationsWithResponse(resourceUri, linkerName, context); + public Response updateWithResponse(String providers, String linkers, String resourceUri, + String linkerName, LinkerPatch parameters, Context context) { + LinkersUpdateResponse inner + = this.serviceClient().updateWithResponse(providers, linkers, resourceUri, linkerName, parameters, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SourceConfigurationResultImpl(inner.getValue(), this.manager())); + new LinkerResourceImpl(inner.getValue(), this.manager())); } else { return null; } } - public SourceConfigurationResult listConfigurations(String resourceUri, String linkerName) { - SourceConfigurationResultInner inner = this.serviceClient().listConfigurations(resourceUri, linkerName); + public LinkerResource update(String providers, String linkers, String resourceUri, String linkerName, + LinkerPatch parameters) { + LinkerResourceInner inner + = this.serviceClient().update(providers, linkers, resourceUri, linkerName, parameters); if (inner != null) { - return new SourceConfigurationResultImpl(inner, this.manager()); + return new LinkerResourceImpl(inner, this.manager()); } else { return null; } } - public LinkerResource getById(String id) { - String resourceUri = ResourceManagerUtils.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 = ResourceManagerUtils.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 void delete(String providers, String linkers, String resourceUri, String linkerName) { + this.serviceClient().delete(providers, linkers, resourceUri, linkerName); } - public Response getByIdWithResponse(String id, Context context) { - String resourceUri = ResourceManagerUtils.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 = ResourceManagerUtils.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 delete(String providers, String linkers, String resourceUri, String linkerName, Context context) { + this.serviceClient().delete(providers, linkers, resourceUri, linkerName, context); } - public void deleteById(String id) { - String resourceUri = ResourceManagerUtils.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))); + public Response listConfigurationsWithResponse(String providers, String linkers, + String resourceUri, String linkerName, Context context) { + Response inner + = this.serviceClient().listConfigurationsWithResponse(providers, linkers, resourceUri, linkerName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ConfigurationResultImpl(inner.getValue(), this.manager())); + } else { + return null; } - String linkerName = ResourceManagerUtils.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 providers, String linkers, String resourceUri, + String linkerName) { + ConfigurationResultInner inner + = this.serviceClient().listConfigurations(providers, linkers, resourceUri, linkerName); + if (inner != null) { + return new ConfigurationResultImpl(inner, this.manager()); + } else { + return null; } - this.delete(resourceUri, linkerName, Context.NONE); } - public void deleteByIdWithResponse(String id, Context context) { - String resourceUri = ResourceManagerUtils.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))); + public ValidateOperationResult validate(String providers, String linkers, String resourceUri, String linkerName) { + ValidateOperationResultInner inner = this.serviceClient().validate(providers, linkers, resourceUri, linkerName); + if (inner != null) { + return new ValidateOperationResultImpl(inner, this.manager()); + } else { + return null; } - String linkerName = ResourceManagerUtils.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 ValidateOperationResult validate(String providers, String linkers, String resourceUri, String linkerName, + Context context) { + ValidateOperationResultInner inner + = this.serviceClient().validate(providers, linkers, resourceUri, linkerName, context); + if (inner != null) { + return new ValidateOperationResultImpl(inner, this.manager()); + } else { + return null; } - this.delete(resourceUri, linkerName, context); } private LinkersClient serviceClient() { @@ -178,8 +167,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..266833906ef8 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkersOperationsClientImpl.java @@ -0,0 +1,1431 @@ +// 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.DaprConfigurationResourceInner; +import com.azure.resourcemanager.servicelinker.fluent.models.DryrunResourceInner; +import com.azure.resourcemanager.servicelinker.models.ConfigurationInfo; +import com.azure.resourcemanager.servicelinker.models.DaprConfigurationList; +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}/{resourceUri}/dryruns") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listDryrun(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("providers") String providers, + @PathParam("resourceUri") String resourceUri, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/{resourceUri}/{providers}/Microsoft.ServiceLinker/{dryruns}/{resourceUri}/{dryrunName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getDryrun(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("providers") String providers, + @PathParam("dryruns") String dryruns, @PathParam("resourceUri") String resourceUri, + @PathParam("dryrunName") String dryrunName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/{resourceUri}/{providers}/Microsoft.ServiceLinker/{dryruns}/{resourceUri}/{dryrunName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createDryrun(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("providers") String providers, + @PathParam("dryruns") String dryruns, @PathParam("resourceUri") String resourceUri, + @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}/{resourceUri}/{dryrunName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateDryrun(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("providers") String providers, + @PathParam("dryruns") String dryruns, @PathParam("resourceUri") String resourceUri, + @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}/{resourceUri}/{dryrunName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deleteDryrun(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("providers") String providers, + @PathParam("dryruns") String dryruns, @PathParam("resourceUri") String resourceUri, + @PathParam("dryrunName") String dryrunName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/{resourceUri}/{providers}/Microsoft.ServiceLinker/{linkers}/{resourceUri}/{linkerName}/generateConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> generateConfigurations(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("providers") String providers, + @PathParam("linkers") String linkers, @PathParam("resourceUri") String resourceUri, + @PathParam("linkerName") String linkerName, @BodyParam("application/json") ConfigurationInfo parameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/{resourceUri}/providers/Microsoft.ServiceLinker/daprConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listDaprConfigurations(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("resourceUri") String resourceUri, + @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> listDaprConfigurationsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * list dryrun jobs. + * + * @param providers {resourceUri}. + * @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 providers, String resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (providers == null) { + return Mono.error(new IllegalArgumentException("Parameter providers 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(), this.client.getApiVersion(), + providers, resourceUri, 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 providers {resourceUri}. + * @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 providers, 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 (providers == null) { + return Mono.error(new IllegalArgumentException("Parameter providers 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(), this.client.getApiVersion(), providers, resourceUri, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * list dryrun jobs. + * + * @param providers {resourceUri}. + * @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 providers, String resourceUri) { + return new PagedFlux<>(() -> listDryrunSinglePageAsync(providers, resourceUri), + nextLink -> listDryrunNextSinglePageAsync(nextLink)); + } + + /** + * list dryrun jobs. + * + * @param providers {resourceUri}. + * @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 providers, String resourceUri, Context context) { + return new PagedFlux<>(() -> listDryrunSinglePageAsync(providers, resourceUri, context), + nextLink -> listDryrunNextSinglePageAsync(nextLink, context)); + } + + /** + * list dryrun jobs. + * + * @param providers {resourceUri}. + * @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 providers, String resourceUri) { + return new PagedIterable<>(listDryrunAsync(providers, resourceUri)); + } + + /** + * list dryrun jobs. + * + * @param providers {resourceUri}. + * @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 providers, String resourceUri, Context context) { + return new PagedIterable<>(listDryrunAsync(providers, resourceUri, context)); + } + + /** + * get a dryrun job. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, + 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 (providers == null) { + return Mono.error(new IllegalArgumentException("Parameter providers is required and cannot be null.")); + } + if (dryruns == null) { + return Mono.error(new IllegalArgumentException("Parameter dryruns 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(), this.client.getApiVersion(), providers, + dryruns, resourceUri, dryrunName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * get a dryrun job. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, + 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 (providers == null) { + return Mono.error(new IllegalArgumentException("Parameter providers is required and cannot be null.")); + } + if (dryruns == null) { + return Mono.error(new IllegalArgumentException("Parameter dryruns 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(), this.client.getApiVersion(), providers, dryruns, + resourceUri, dryrunName, accept, context); + } + + /** + * get a dryrun job. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, String resourceUri, + String dryrunName) { + return getDryrunWithResponseAsync(providers, dryruns, resourceUri, dryrunName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * get a dryrun job. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, String resourceUri, + String dryrunName, Context context) { + return getDryrunWithResponseAsync(providers, dryruns, resourceUri, dryrunName, context).block(); + } + + /** + * get a dryrun job. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, String resourceUri, String dryrunName) { + return getDryrunWithResponse(providers, dryruns, resourceUri, dryrunName, Context.NONE).getValue(); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, + 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 (providers == null) { + return Mono.error(new IllegalArgumentException("Parameter providers is required and cannot be null.")); + } + if (dryruns == null) { + return Mono.error(new IllegalArgumentException("Parameter dryruns 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(), this.client.getApiVersion(), + providers, dryruns, resourceUri, 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 providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, + 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 (providers == null) { + return Mono.error(new IllegalArgumentException("Parameter providers is required and cannot be null.")); + } + if (dryruns == null) { + return Mono.error(new IllegalArgumentException("Parameter dryruns 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(), this.client.getApiVersion(), providers, dryruns, + resourceUri, dryrunName, parameters, accept, context); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, + String dryruns, String resourceUri, String dryrunName, DryrunResourceInner parameters) { + Mono>> mono + = createDryrunWithResponseAsync(providers, dryruns, 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 providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, + String dryruns, String resourceUri, String dryrunName, DryrunResourceInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createDryrunWithResponseAsync(providers, dryruns, 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 providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, + String dryruns, String resourceUri, String dryrunName, DryrunResourceInner parameters) { + return this.beginCreateDryrunAsync(providers, dryruns, resourceUri, dryrunName, parameters).getSyncPoller(); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, + String dryruns, String resourceUri, String dryrunName, DryrunResourceInner parameters, Context context) { + return this.beginCreateDryrunAsync(providers, dryruns, resourceUri, dryrunName, parameters, context) + .getSyncPoller(); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, String resourceUri, + String dryrunName, DryrunResourceInner parameters) { + return beginCreateDryrunAsync(providers, dryruns, resourceUri, dryrunName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, String resourceUri, + String dryrunName, DryrunResourceInner parameters, Context context) { + return beginCreateDryrunAsync(providers, dryruns, resourceUri, dryrunName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, String resourceUri, String dryrunName, + DryrunResourceInner parameters) { + return createDryrunAsync(providers, dryruns, resourceUri, dryrunName, parameters).block(); + } + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, String resourceUri, String dryrunName, + DryrunResourceInner parameters, Context context) { + return createDryrunAsync(providers, dryruns, resourceUri, dryrunName, parameters, context).block(); + } + + /** + * add a dryrun job to do necessary check before actual creation. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, + 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 (providers == null) { + return Mono.error(new IllegalArgumentException("Parameter providers is required and cannot be null.")); + } + if (dryruns == null) { + return Mono.error(new IllegalArgumentException("Parameter dryruns 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(), this.client.getApiVersion(), + providers, dryruns, resourceUri, 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 providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, + 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 (providers == null) { + return Mono.error(new IllegalArgumentException("Parameter providers is required and cannot be null.")); + } + if (dryruns == null) { + return Mono.error(new IllegalArgumentException("Parameter dryruns 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(), this.client.getApiVersion(), providers, dryruns, + resourceUri, dryrunName, parameters, accept, context); + } + + /** + * add a dryrun job to do necessary check before actual creation. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, + String dryruns, String resourceUri, String dryrunName, DryrunPatch parameters) { + Mono>> mono + = updateDryrunWithResponseAsync(providers, dryruns, 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 providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, + String dryruns, String resourceUri, String dryrunName, DryrunPatch parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateDryrunWithResponseAsync(providers, dryruns, 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 providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, + String dryruns, String resourceUri, String dryrunName, DryrunPatch parameters) { + return this.beginUpdateDryrunAsync(providers, dryruns, resourceUri, dryrunName, parameters).getSyncPoller(); + } + + /** + * add a dryrun job to do necessary check before actual creation. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, + String dryruns, String resourceUri, String dryrunName, DryrunPatch parameters, Context context) { + return this.beginUpdateDryrunAsync(providers, dryruns, resourceUri, dryrunName, parameters, context) + .getSyncPoller(); + } + + /** + * add a dryrun job to do necessary check before actual creation. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, String resourceUri, + String dryrunName, DryrunPatch parameters) { + return beginUpdateDryrunAsync(providers, dryruns, resourceUri, dryrunName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * add a dryrun job to do necessary check before actual creation. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, String resourceUri, + String dryrunName, DryrunPatch parameters, Context context) { + return beginUpdateDryrunAsync(providers, dryruns, resourceUri, dryrunName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * add a dryrun job to do necessary check before actual creation. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, String resourceUri, String dryrunName, + DryrunPatch parameters) { + return updateDryrunAsync(providers, dryruns, resourceUri, dryrunName, parameters).block(); + } + + /** + * add a dryrun job to do necessary check before actual creation. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, String resourceUri, String dryrunName, + DryrunPatch parameters, Context context) { + return updateDryrunAsync(providers, dryruns, resourceUri, dryrunName, parameters, context).block(); + } + + /** + * delete a dryrun job. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, 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 (providers == null) { + return Mono.error(new IllegalArgumentException("Parameter providers is required and cannot be null.")); + } + if (dryruns == null) { + return Mono.error(new IllegalArgumentException("Parameter dryruns 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(), this.client.getApiVersion(), + providers, dryruns, resourceUri, dryrunName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * delete a dryrun job. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, 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 (providers == null) { + return Mono.error(new IllegalArgumentException("Parameter providers is required and cannot be null.")); + } + if (dryruns == null) { + return Mono.error(new IllegalArgumentException("Parameter dryruns 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(), this.client.getApiVersion(), providers, dryruns, + resourceUri, dryrunName, accept, context); + } + + /** + * delete a dryrun job. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, String resourceUri, String dryrunName) { + return deleteDryrunWithResponseAsync(providers, dryruns, resourceUri, dryrunName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * delete a dryrun job. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, String resourceUri, + String dryrunName, Context context) { + return deleteDryrunWithResponseAsync(providers, dryruns, resourceUri, dryrunName, context).block(); + } + + /** + * delete a dryrun job. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, String resourceUri, String dryrunName) { + deleteDryrunWithResponse(providers, dryruns, resourceUri, dryrunName, Context.NONE); + } + + /** + * Generate configurations for a Linker. + * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. + * @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 providers, + String linkers, 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 (providers == null) { + return Mono.error(new IllegalArgumentException("Parameter providers is required and cannot be null.")); + } + if (linkers == null) { + return Mono.error(new IllegalArgumentException("Parameter linkers 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(), + this.client.getApiVersion(), providers, linkers, resourceUri, linkerName, parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generate configurations for a Linker. + * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. + * @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 providers, + String linkers, 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 (providers == null) { + return Mono.error(new IllegalArgumentException("Parameter providers is required and cannot be null.")); + } + if (linkers == null) { + return Mono.error(new IllegalArgumentException("Parameter linkers 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(), this.client.getApiVersion(), providers, + linkers, resourceUri, linkerName, parameters, accept, context); + } + + /** + * Generate configurations for a Linker. + * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. + * @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 providers, String linkers, + String resourceUri, String linkerName) { + final ConfigurationInfo parameters = null; + return generateConfigurationsWithResponseAsync(providers, linkers, resourceUri, linkerName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Generate configurations for a Linker. + * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. + * @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 providers, String linkers, + String resourceUri, String linkerName, ConfigurationInfo parameters, Context context) { + return generateConfigurationsWithResponseAsync(providers, linkers, resourceUri, linkerName, parameters, context) + .block(); + } + + /** + * Generate configurations for a Linker. + * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. + * @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 providers, String linkers, String resourceUri, + String linkerName) { + final ConfigurationInfo parameters = null; + return generateConfigurationsWithResponse(providers, linkers, resourceUri, linkerName, parameters, Context.NONE) + .getValue(); + } + + /** + * List the dapr configuration supported by Service Connector. + * + * @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 dapr configuration list supported by Service Connector along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listDaprConfigurationsSinglePageAsync(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.listDaprConfigurations(this.client.getEndpoint(), + this.client.getApiVersion(), resourceUri, 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 the dapr configuration supported by Service Connector. + * + * @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 dapr configuration list supported by Service Connector along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listDaprConfigurationsSinglePageAsync(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 + .listDaprConfigurations(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List the dapr configuration supported by Service Connector. + * + * @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 dapr configuration list supported by Service Connector as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listDaprConfigurationsAsync(String resourceUri) { + return new PagedFlux<>(() -> listDaprConfigurationsSinglePageAsync(resourceUri), + nextLink -> listDaprConfigurationsNextSinglePageAsync(nextLink)); + } + + /** + * List the dapr configuration supported by Service Connector. + * + * @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 dapr configuration list supported by Service Connector as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listDaprConfigurationsAsync(String resourceUri, Context context) { + return new PagedFlux<>(() -> listDaprConfigurationsSinglePageAsync(resourceUri, context), + nextLink -> listDaprConfigurationsNextSinglePageAsync(nextLink, context)); + } + + /** + * List the dapr configuration supported by Service Connector. + * + * @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 dapr configuration list supported by Service Connector as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDaprConfigurations(String resourceUri) { + return new PagedIterable<>(listDaprConfigurationsAsync(resourceUri)); + } + + /** + * List the dapr configuration supported by Service Connector. + * + * @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 dapr configuration list supported by Service Connector as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDaprConfigurations(String resourceUri, Context context) { + return new PagedIterable<>(listDaprConfigurationsAsync(resourceUri, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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. + * @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. + * @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 dapr configuration list supported by Service Connector along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listDaprConfigurationsNextSinglePageAsync(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.listDaprConfigurationsNext(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. + * @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 dapr configuration list supported by Service Connector along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listDaprConfigurationsNextSinglePageAsync(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.listDaprConfigurationsNext(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..d8f66ff2ad94 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkersOperationsImpl.java @@ -0,0 +1,161 @@ +// 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.DaprConfigurationResourceInner; +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.DaprConfigurationResource; +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 providers, String resourceUri) { + PagedIterable inner = this.serviceClient().listDryrun(providers, resourceUri); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DryrunResourceImpl(inner1, this.manager())); + } + + public PagedIterable listDryrun(String providers, String resourceUri, Context context) { + PagedIterable inner = this.serviceClient().listDryrun(providers, resourceUri, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DryrunResourceImpl(inner1, this.manager())); + } + + public Response getDryrunWithResponse(String providers, String dryruns, String resourceUri, + String dryrunName, Context context) { + Response inner + = this.serviceClient().getDryrunWithResponse(providers, dryruns, 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 providers, String dryruns, String resourceUri, String dryrunName) { + DryrunResourceInner inner = this.serviceClient().getDryrun(providers, dryruns, resourceUri, dryrunName); + if (inner != null) { + return new DryrunResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public DryrunResource createDryrun(String providers, String dryruns, String resourceUri, String dryrunName, + DryrunResourceInner parameters) { + DryrunResourceInner inner + = this.serviceClient().createDryrun(providers, dryruns, resourceUri, dryrunName, parameters); + if (inner != null) { + return new DryrunResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public DryrunResource createDryrun(String providers, String dryruns, String resourceUri, String dryrunName, + DryrunResourceInner parameters, Context context) { + DryrunResourceInner inner + = this.serviceClient().createDryrun(providers, dryruns, resourceUri, dryrunName, parameters, context); + if (inner != null) { + return new DryrunResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public DryrunResource updateDryrun(String providers, String dryruns, String resourceUri, String dryrunName, + DryrunPatch parameters) { + DryrunResourceInner inner + = this.serviceClient().updateDryrun(providers, dryruns, resourceUri, dryrunName, parameters); + if (inner != null) { + return new DryrunResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public DryrunResource updateDryrun(String providers, String dryruns, String resourceUri, String dryrunName, + DryrunPatch parameters, Context context) { + DryrunResourceInner inner + = this.serviceClient().updateDryrun(providers, dryruns, resourceUri, dryrunName, parameters, context); + if (inner != null) { + return new DryrunResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteDryrunWithResponse(String providers, String dryruns, String resourceUri, + String dryrunName, Context context) { + return this.serviceClient().deleteDryrunWithResponse(providers, dryruns, resourceUri, dryrunName, context); + } + + public void deleteDryrun(String providers, String dryruns, String resourceUri, String dryrunName) { + this.serviceClient().deleteDryrun(providers, dryruns, resourceUri, dryrunName); + } + + public Response generateConfigurationsWithResponse(String providers, String linkers, + String resourceUri, String linkerName, ConfigurationInfo parameters, Context context) { + Response inner = this.serviceClient() + .generateConfigurationsWithResponse(providers, linkers, 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 providers, String linkers, String resourceUri, + String linkerName) { + ConfigurationResultInner inner + = this.serviceClient().generateConfigurations(providers, linkers, resourceUri, linkerName); + if (inner != null) { + return new ConfigurationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listDaprConfigurations(String resourceUri) { + PagedIterable inner = this.serviceClient().listDaprConfigurations(resourceUri); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DaprConfigurationResourceImpl(inner1, this.manager())); + } + + public PagedIterable listDaprConfigurations(String resourceUri, Context context) { + PagedIterable inner + = this.serviceClient().listDaprConfigurations(resourceUri, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DaprConfigurationResourceImpl(inner1, this.manager())); + } + + 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 d900b56d2e14..5e28c130583c 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 @@ -78,7 +78,7 @@ Mono> listNext(@PathParam(value = "nextLink", enco } /** - * Lists the available ServiceLinker REST API operations. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -101,7 +101,7 @@ private Mono> listSinglePageAsync() { } /** - * Lists the available ServiceLinker REST API operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -124,7 +124,7 @@ private Mono> listSinglePageAsync(Context context) } /** - * Lists the available ServiceLinker REST API operations. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -137,7 +137,7 @@ private PagedFlux listAsync() { } /** - * Lists the available ServiceLinker REST API operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -153,7 +153,7 @@ private PagedFlux listAsync(Context context) { } /** - * Lists the available ServiceLinker REST API operations. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -166,7 +166,7 @@ public PagedIterable list() { } /** - * Lists the available ServiceLinker REST API operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. 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 4d3cff13bc8d..37a9094960f1 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 @@ -19,6 +19,22 @@ */ @ServiceClientBuilder(serviceClients = { ServiceLinkerManagementClientImpl.class }) public final class ServiceLinkerManagementClientBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the ServiceLinkerManagementClientBuilder. + */ + public ServiceLinkerManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + /* * server parameter */ @@ -116,7 +132,7 @@ public ServiceLinkerManagementClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); ServiceLinkerManagementClientImpl client = new ServiceLinkerManagementClientImpl(localPipeline, - localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint); + localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId, 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 d552571d2346..9b54d08be0dc 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 @@ -23,7 +23,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; @@ -40,6 +43,20 @@ */ @ServiceClient(builder = ServiceLinkerManagementClientBuilder.class) public final class ServiceLinkerManagementClientImpl implements ServiceLinkerManagementClient { + /** + * The ID of the target subscription. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + /** * server parameter. */ @@ -124,6 +141,34 @@ 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 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; + } + /** * The OperationsClient object to access its operations. */ @@ -138,6 +183,20 @@ public OperationsClient getOperations() { return this.operations; } + /** + * 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; + } + /** * Initializes an instance of ServiceLinkerManagementClient client. * @@ -145,17 +204,22 @@ public OperationsClient getOperations() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. + * @param subscriptionId The ID of the target subscription. * @param endpoint server parameter. */ ServiceLinkerManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String endpoint) { + Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2022-05-01"; + this.apiVersion = "2024-07-01-preview"; this.linkers = new LinkersClientImpl(this); + this.linkersOperations = new LinkersOperationsClientImpl(this); + this.configurationNamesOperations = new ConfigurationNamesOperationsClientImpl(this); this.operations = new OperationsClientImpl(this); + this.connectors = new ConnectorsClientImpl(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..93b6873ef03d --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AccessKeyInfoBase.java @@ -0,0 +1,131 @@ +// 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The access key directly from target resource properties, which target service is Azure Resource, such as + * Microsoft.Storage. + */ +@Fluent +public final class AccessKeyInfoBase extends AuthInfoBase { + /* + * The authentication type. + */ + private AuthType authType = AuthType.ACCESS_KEY; + + /* + * 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. + */ + private List permissions; + + /** + * Creates an instance of AccessKeyInfoBase class. + */ + public AccessKeyInfoBase() { + } + + /** + * Get the authType property: The authentication type. + * + * @return the authType value. + */ + @Override + public AuthType authType() { + return this.authType; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public AccessKeyInfoBase withAuthMode(AuthMode authMode) { + super.withAuthMode(authMode); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("authMode", authMode() == null ? null : authMode().toString()); + jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeArrayField("permissions", this.permissions, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessKeyInfoBase from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessKeyInfoBase if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AccessKeyInfoBase. + */ + public static AccessKeyInfoBase fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessKeyInfoBase deserializedAccessKeyInfoBase = new AccessKeyInfoBase(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authMode".equals(fieldName)) { + deserializedAccessKeyInfoBase.withAuthMode(AuthMode.fromString(reader.getString())); + } else if ("authType".equals(fieldName)) { + deserializedAccessKeyInfoBase.authType = AuthType.fromString(reader.getString()); + } else if ("permissions".equals(fieldName)) { + List permissions + = reader.readArray(reader1 -> AccessKeyPermissions.fromString(reader1.getString())); + deserializedAccessKeyInfoBase.permissions = permissions; + } else { + reader.skipChildren(); + } + } + + return deserializedAccessKeyInfoBase; + }); + } +} 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..4154f53da022 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AccessKeyPermissions.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.models; + +import com.azure.core.util.ExpandableStringEnum; +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 a new instance of AccessKeyPermissions value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AccessKeyPermissions() { + } + + /** + * Creates or finds a AccessKeyPermissions from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessKeyPermissions. + */ + 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/AllowType.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AllowType.java new file mode 100644 index 000000000000..a0d0f08c5668 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AllowType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.models; + +import com.azure.core.util.ExpandableStringEnum; +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 a new instance of AllowType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AllowType() { + } + + /** + * Creates or finds a AllowType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AllowType. + */ + 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 9787dd7d6053..38cdfa1fe77c 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 @@ -4,7 +4,7 @@ package com.azure.resourcemanager.servicelinker.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,13 +14,20 @@ /** * The authentication info. */ -@Immutable +@Fluent public class AuthInfoBase implements JsonSerializable { /* * The authentication type. */ private AuthType authType = AuthType.fromString("AuthInfoBase"); + /* + * Optional. Indicates how to configure authentication. If optInAllAuth, service linker configures authentication + * such as enabling identity on source resource and granting RBAC roles. If optOutAllAuth, opt out authentication + * setup. Default is optInAllAuth. + */ + private AuthMode authMode; + /** * Creates an instance of AuthInfoBase class. */ @@ -36,6 +43,30 @@ public AuthType authType() { return this.authType; } + /** + * Get the authMode property: Optional. Indicates how to configure authentication. If optInAllAuth, service linker + * configures authentication such as enabling identity on source resource and granting RBAC roles. If optOutAllAuth, + * opt out authentication setup. Default is optInAllAuth. + * + * @return the authMode value. + */ + public AuthMode authMode() { + return this.authMode; + } + + /** + * Set the authMode property: Optional. Indicates how to configure authentication. If optInAllAuth, service linker + * configures authentication such as enabling identity on source resource and granting RBAC roles. If optOutAllAuth, + * opt out authentication setup. Default is optInAllAuth. + * + * @param authMode the authMode value to set. + * @return the AuthInfoBase object itself. + */ + public AuthInfoBase withAuthMode(AuthMode authMode) { + this.authMode = authMode; + return this; + } + /** * Validates the instance. * @@ -51,6 +82,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeStringField("authMode", this.authMode == null ? null : this.authMode.toString()); return jsonWriter.writeEndObject(); } @@ -78,16 +110,22 @@ public static AuthInfoBase fromJson(JsonReader jsonReader) throws IOException { } } // Use the discriminator value to determine which subtype should be deserialized. - if ("secret".equals(discriminatorValue)) { + if ("accessKey".equals(discriminatorValue)) { + return AccessKeyInfoBase.fromJson(readerToUse.reset()); + } else if ("easyAuthMicrosoftEntraID".equals(discriminatorValue)) { + return EasyAuthMicrosoftEntraIdAuthInfo.fromJson(readerToUse.reset()); + } else if ("secret".equals(discriminatorValue)) { return SecretAuthInfo.fromJson(readerToUse.reset()); - } else if ("userAssignedIdentity".equals(discriminatorValue)) { - return UserAssignedIdentityAuthInfo.fromJson(readerToUse.reset()); - } else if ("systemAssignedIdentity".equals(discriminatorValue)) { - return SystemAssignedIdentityAuthInfo.fromJson(readerToUse.reset()); - } else if ("servicePrincipalSecret".equals(discriminatorValue)) { - return ServicePrincipalSecretAuthInfo.fromJson(readerToUse.reset()); } else if ("servicePrincipalCertificate".equals(discriminatorValue)) { return ServicePrincipalCertificateAuthInfo.fromJson(readerToUse.reset()); + } else if ("servicePrincipalSecret".equals(discriminatorValue)) { + return ServicePrincipalSecretAuthInfo.fromJson(readerToUse.reset()); + } else if ("systemAssignedIdentity".equals(discriminatorValue)) { + return SystemAssignedIdentityAuthInfo.fromJson(readerToUse.reset()); + } else if ("userAccount".equals(discriminatorValue)) { + return UserAccountAuthInfo.fromJson(readerToUse.reset()); + } else if ("userAssignedIdentity".equals(discriminatorValue)) { + return UserAssignedIdentityAuthInfo.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } @@ -104,6 +142,8 @@ static AuthInfoBase fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOE if ("authType".equals(fieldName)) { deserializedAuthInfoBase.authType = AuthType.fromString(reader.getString()); + } else if ("authMode".equals(fieldName)) { + deserializedAuthInfoBase.authMode = AuthMode.fromString(reader.getString()); } else { reader.skipChildren(); } diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AuthMode.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AuthMode.java new file mode 100644 index 000000000000..6816500c38ad --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AuthMode.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Indicates how to apply the authentication configuration operations. + */ +public final class AuthMode extends ExpandableStringEnum { + /** + * Static value optInAllAuth for AuthMode. + */ + public static final AuthMode OPT_IN_ALL_AUTH = fromString("optInAllAuth"); + + /** + * Static value optOutAllAuth for AuthMode. + */ + public static final AuthMode OPT_OUT_ALL_AUTH = fromString("optOutAllAuth"); + + /** + * Creates a new instance of AuthMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AuthMode() { + } + + /** + * Creates or finds a AuthMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding AuthMode. + */ + public static AuthMode fromString(String name) { + return fromString(name, AuthMode.class); + } + + /** + * Gets known AuthMode values. + * + * @return known AuthMode values. + */ + public static Collection values() { + return values(AuthMode.class); + } +} 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 2f1334d4631d..1df2c3dca85d 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 @@ -36,6 +36,21 @@ public final class AuthType extends ExpandableStringEnum { */ 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"); + + /** + * Static value easyAuthMicrosoftEntraID for AuthType. + */ + public static final AuthType EASY_AUTH_MICROSOFT_ENTRA_ID = fromString("easyAuthMicrosoftEntraID"); + /** * Creates a new instance of AuthType value. * diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AzureAppConfigProperties.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AzureAppConfigProperties.java new file mode 100644 index 000000000000..09ee887215fc --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/AzureAppConfigProperties.java @@ -0,0 +1,114 @@ +// 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The resource properties when type is Azure App Configuration. + */ +@Fluent +public final class AzureAppConfigProperties extends AzureResourcePropertiesBase { + /* + * The azure resource type. + */ + private AzureResourceType type = AzureResourceType.APP_CONFIG; + + /* + * True if connection enables app configuration kubernetes extension. + */ + private Boolean connectWithKubernetesExtension; + + /** + * Creates an instance of AzureAppConfigProperties class. + */ + public AzureAppConfigProperties() { + } + + /** + * Get the type property: The azure resource type. + * + * @return the type value. + */ + @Override + public AzureResourceType type() { + return this.type; + } + + /** + * Get the connectWithKubernetesExtension property: True if connection enables app configuration kubernetes + * extension. + * + * @return the connectWithKubernetesExtension value. + */ + public Boolean connectWithKubernetesExtension() { + return this.connectWithKubernetesExtension; + } + + /** + * Set the connectWithKubernetesExtension property: True if connection enables app configuration kubernetes + * extension. + * + * @param connectWithKubernetesExtension the connectWithKubernetesExtension value to set. + * @return the AzureAppConfigProperties object itself. + */ + public AzureAppConfigProperties withConnectWithKubernetesExtension(Boolean connectWithKubernetesExtension) { + this.connectWithKubernetesExtension = connectWithKubernetesExtension; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeBooleanField("connectWithKubernetesExtension", this.connectWithKubernetesExtension); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureAppConfigProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureAppConfigProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureAppConfigProperties. + */ + public static AzureAppConfigProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureAppConfigProperties deserializedAzureAppConfigProperties = new AzureAppConfigProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedAzureAppConfigProperties.type = AzureResourceType.fromString(reader.getString()); + } else if ("connectWithKubernetesExtension".equals(fieldName)) { + deserializedAzureAppConfigProperties.connectWithKubernetesExtension + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureAppConfigProperties; + }); + } +} 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 c5377e4c3527..2beefad57bc8 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 @@ -78,7 +78,9 @@ public static AzureResourcePropertiesBase fromJson(JsonReader jsonReader) throws } } // Use the discriminator value to determine which subtype should be deserialized. - if ("KeyVault".equals(discriminatorValue)) { + if ("AppConfig".equals(discriminatorValue)) { + return AzureAppConfigProperties.fromJson(readerToUse.reset()); + } else if ("KeyVault".equals(discriminatorValue)) { return AzureKeyVaultProperties.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); 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 40d7cf87a2a3..dfe95bfc2e95 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 @@ -16,6 +16,11 @@ public final class AzureResourceType extends ExpandableStringEnum { + BasicErrorDryrunPrerequisiteResult deserializedBasicErrorDryrunPrerequisiteResult + = new BasicErrorDryrunPrerequisiteResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedBasicErrorDryrunPrerequisiteResult.type + = DryrunPrerequisiteResultType.fromString(reader.getString()); + } else if ("code".equals(fieldName)) { + deserializedBasicErrorDryrunPrerequisiteResult.code = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedBasicErrorDryrunPrerequisiteResult.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBasicErrorDryrunPrerequisiteResult; + }); + } +} 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 65274527d9e7..25fe2f195653 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 @@ -66,6 +66,16 @@ public final class ClientType extends ExpandableStringEnum { */ public static final ClientType KAFKA_SPRING_BOOT = fromString("kafka-springBoot"); + /** + * Static value jms-springBoot for ClientType. + */ + public static final ClientType JMS_SPRING_BOOT = fromString("jms-springBoot"); + + /** + * Static value dapr for ClientType. + */ + public static final ClientType DAPR = fromString("dapr"); + /** * Creates a new instance of ClientType value. * 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..d58e208cc20f --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfigurationInfo.java @@ -0,0 +1,294 @@ +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The configuration information, used to generate configurations or save to applications. + */ +@Fluent +public final class ConfigurationInfo implements JsonSerializable { + /* + * Indicates whether to clean up previous operation when Linker is updating or deleting + */ + 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. + */ + 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 + */ + private Map customizedKeys; + + /* + * Indicates some additional properties for dapr client type + */ + private DaprProperties daprProperties; + + /* + * 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 + */ + private Map additionalConfigurations; + + /* + * A dictionary of additional properties to be added in the end of connection string. + */ + private Map additionalConnectionStringProperties; + + /* + * An option to store configuration into different place + */ + private ConfigurationStore configurationStore; + + /** + * 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 daprProperties property: Indicates some additional properties for dapr client type. + * + * @return the daprProperties value. + */ + public DaprProperties daprProperties() { + return this.daprProperties; + } + + /** + * Set the daprProperties property: Indicates some additional properties for dapr client type. + * + * @param daprProperties the daprProperties value to set. + * @return the ConfigurationInfo object itself. + */ + public ConfigurationInfo withDaprProperties(DaprProperties daprProperties) { + this.daprProperties = daprProperties; + 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; + } + + /** + * Get the additionalConnectionStringProperties property: A dictionary of additional properties to be added in the + * end of connection string. + * + * @return the additionalConnectionStringProperties value. + */ + public Map additionalConnectionStringProperties() { + return this.additionalConnectionStringProperties; + } + + /** + * Set the additionalConnectionStringProperties property: A dictionary of additional properties to be added in the + * end of connection string. + * + * @param additionalConnectionStringProperties the additionalConnectionStringProperties value to set. + * @return the ConfigurationInfo object itself. + */ + public ConfigurationInfo + withAdditionalConnectionStringProperties(Map additionalConnectionStringProperties) { + this.additionalConnectionStringProperties = additionalConnectionStringProperties; + return this; + } + + /** + * Get the configurationStore property: An option to store configuration into different place. + * + * @return the configurationStore value. + */ + public ConfigurationStore configurationStore() { + return this.configurationStore; + } + + /** + * Set the configurationStore property: An option to store configuration into different place. + * + * @param configurationStore the configurationStore value to set. + * @return the ConfigurationInfo object itself. + */ + public ConfigurationInfo withConfigurationStore(ConfigurationStore configurationStore) { + this.configurationStore = configurationStore; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (daprProperties() != null) { + daprProperties().validate(); + } + if (configurationStore() != null) { + configurationStore().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("deleteOrUpdateBehavior", + this.deleteOrUpdateBehavior == null ? null : this.deleteOrUpdateBehavior.toString()); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + jsonWriter.writeMapField("customizedKeys", this.customizedKeys, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("daprProperties", this.daprProperties); + jsonWriter.writeMapField("additionalConfigurations", this.additionalConfigurations, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("additionalConnectionStringProperties", this.additionalConnectionStringProperties, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("configurationStore", this.configurationStore); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfigurationInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfigurationInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ConfigurationInfo. + */ + public static ConfigurationInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfigurationInfo deserializedConfigurationInfo = new ConfigurationInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deleteOrUpdateBehavior".equals(fieldName)) { + deserializedConfigurationInfo.deleteOrUpdateBehavior + = DeleteOrUpdateBehavior.fromString(reader.getString()); + } else if ("action".equals(fieldName)) { + deserializedConfigurationInfo.action = ActionType.fromString(reader.getString()); + } else if ("customizedKeys".equals(fieldName)) { + Map customizedKeys = reader.readMap(reader1 -> reader1.getString()); + deserializedConfigurationInfo.customizedKeys = customizedKeys; + } else if ("daprProperties".equals(fieldName)) { + deserializedConfigurationInfo.daprProperties = DaprProperties.fromJson(reader); + } else if ("additionalConfigurations".equals(fieldName)) { + Map additionalConfigurations = reader.readMap(reader1 -> reader1.getString()); + deserializedConfigurationInfo.additionalConfigurations = additionalConfigurations; + } else if ("additionalConnectionStringProperties".equals(fieldName)) { + Map additionalConnectionStringProperties + = reader.readMap(reader1 -> reader1.getString()); + deserializedConfigurationInfo.additionalConnectionStringProperties + = additionalConnectionStringProperties; + } else if ("configurationStore".equals(fieldName)) { + deserializedConfigurationInfo.configurationStore = ConfigurationStore.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedConfigurationInfo; + }); + } +} 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..f29ffe90c0c5 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfigurationName.java @@ -0,0 +1,149 @@ +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The configuration names. + */ +@Fluent +public final class ConfigurationName implements JsonSerializable { + /* + * The value property. + */ + private String value; + + /* + * Description for the configuration name. + */ + private String description; + + /* + * Represent the configuration is required or not + */ + private Boolean required; + + /** + * 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; + } + + /** + * Get the required property: Represent the configuration is required or not. + * + * @return the required value. + */ + public Boolean required() { + return this.required; + } + + /** + * Set the required property: Represent the configuration is required or not. + * + * @param required the required value to set. + * @return the ConfigurationName object itself. + */ + public ConfigurationName withRequired(Boolean required) { + this.required = required; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeBooleanField("required", this.required); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfigurationName from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfigurationName if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ConfigurationName. + */ + public static ConfigurationName fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfigurationName deserializedConfigurationName = new ConfigurationName(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedConfigurationName.value = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedConfigurationName.description = reader.getString(); + } else if ("required".equals(fieldName)) { + deserializedConfigurationName.required = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedConfigurationName; + }); + } +} 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..6267c4739464 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfigurationNameItem.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.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 secretType property: Indicates where the secrets in configuration from. Used when secrets are from + * Keyvault. + * + * @return the secretType value. + */ + SecretSourceType secretType(); + + /** + * Gets the daprProperties property: Deprecated, please use #/definitions/DaprConfigurationList instead. + * + * @return the daprProperties value. + */ + DaprProperties daprProperties(); + + /** + * 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..a0b7ee23d10c --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfigurationNameResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.servicelinker.fluent.models.ConfigurationNameItemInner; +import java.io.IOException; +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 implements JsonSerializable { + /* + * The ConfigurationNameItem items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ConfigurationNameResult class. + */ + public ConfigurationNameResult() { + } + + /** + * Get the value property: The ConfigurationNameItem items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The ConfigurationNameItem items on this page. + * + * @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: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the ConfigurationNameResult object itself. + */ + public ConfigurationNameResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model ConfigurationNameResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConfigurationNameResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfigurationNameResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfigurationNameResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConfigurationNameResult. + */ + public static ConfigurationNameResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfigurationNameResult deserializedConfigurationNameResult = new ConfigurationNameResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ConfigurationNameItemInner.fromJson(reader1)); + deserializedConfigurationNameResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedConfigurationNameResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConfigurationNameResult; + }); + } +} 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..2e524b4c0f89 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfigurationNamesOperations.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 959688742701..44ac433d9a44 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,13 +4,13 @@ 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. + * An immutable client-side representation of ConfigurationResult. */ -public interface SourceConfigurationResult { +public interface ConfigurationResult { /** * Gets the configurations property: The configuration properties for source resource. * @@ -19,9 +19,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/ConfigurationStore.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfigurationStore.java new file mode 100644 index 000000000000..d9dcd499aec6 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/ConfigurationStore.java @@ -0,0 +1,93 @@ +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An option to store configuration into different place. + */ +@Fluent +public final class ConfigurationStore implements JsonSerializable { + /* + * The app configuration id to store configuration + */ + private String appConfigurationId; + + /** + * Creates an instance of ConfigurationStore class. + */ + public ConfigurationStore() { + } + + /** + * Get the appConfigurationId property: The app configuration id to store configuration. + * + * @return the appConfigurationId value. + */ + public String appConfigurationId() { + return this.appConfigurationId; + } + + /** + * Set the appConfigurationId property: The app configuration id to store configuration. + * + * @param appConfigurationId the appConfigurationId value to set. + * @return the ConfigurationStore object itself. + */ + public ConfigurationStore withAppConfigurationId(String appConfigurationId) { + this.appConfigurationId = appConfigurationId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("appConfigurationId", this.appConfigurationId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfigurationStore from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfigurationStore if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ConfigurationStore. + */ + public static ConfigurationStore fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfigurationStore deserializedConfigurationStore = new ConfigurationStore(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("appConfigurationId".equals(fieldName)) { + deserializedConfigurationStore.appConfigurationId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConfigurationStore; + }); + } +} 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..6ab7fda1bd8b --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/Connectors.java @@ -0,0 +1,336 @@ +// 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 { + /** + * Returns list of connector which connects to the resource, which supports to config the target service during the + * resource provision. + * + * @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 resourceGroupName, String location); + + /** + * Returns list of connector which connects to the resource, which supports to config the target service during the + * resource provision. + * + * @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 resourceGroupName, String location, Context context); + + /** + * Returns Connector resource for a given name. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName, + Context context); + + /** + * Returns Connector resource for a given name. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName); + + /** + * Delete a Connector. + * + * @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 the LinkerResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String location, String connectorName); + + /** + * Delete a Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName, Context context); + + /** + * Generate configurations for a Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, + String connectorName, ConfigurationInfo parameters, Context context); + + /** + * Generate configurations for a Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName); + + /** + * Validate a Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName); + + /** + * Validate a Connector. + * + * @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 the LinkerResource. + * @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 resourceGroupName, String location, String connectorName, Context context); + + /** + * list dryrun jobs. + * + * @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 resourceGroupName, String location); + + /** + * list dryrun jobs. + * + * @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 resourceGroupName, String location, Context context); + + /** + * get a dryrun job. + * + * @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 the DryrunResource. + * @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 resourceGroupName, String location, String dryrunName, + Context context); + + /** + * get a dryrun job. + * + * @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 the DryrunResource. + * @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 resourceGroupName, String location, String dryrunName); + + /** + * delete a dryrun job. + * + * @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 the DryrunResource. + * @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 resourceGroupName, String location, String dryrunName, + Context context); + + /** + * delete a dryrun job. + * + * @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 the DryrunResource. + * @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 resourceGroupName, String location, String dryrunName); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); +} 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..ed4d320beed9 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/CreateOrUpdateDryrunParameters.java @@ -0,0 +1,346 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The dryrun parameters for creation or update a linker. + */ +@Fluent +public final class CreateOrUpdateDryrunParameters extends DryrunParameters { + /* + * The name of action for you dryrun job. + */ + private DryrunActionName actionName = DryrunActionName.CREATE_OR_UPDATE; + + /* + * The target service properties + */ + private TargetServiceBase targetService; + + /* + * The authentication type. + */ + private AuthInfoBase authInfo; + + /* + * The application client type + */ + private ClientType clientType; + + /* + * The provisioning state. + */ + private String provisioningState; + + /* + * The VNet solution. + */ + private VNetSolution vNetSolution; + + /* + * An option to store secret value in secure place + */ + private SecretStore secretStore; + + /* + * connection scope in source service. + */ + private String scope; + + /* + * The network solution. + */ + private PublicNetworkSolution publicNetworkSolution; + + /* + * The connection information consumed by applications, including secrets, connection strings. + */ + private ConfigurationInfo configurationInfo; + + /** + * Creates an instance of CreateOrUpdateDryrunParameters class. + */ + public CreateOrUpdateDryrunParameters() { + } + + /** + * Get the actionName property: The name of action for you dryrun job. + * + * @return the actionName value. + */ + @Override + public DryrunActionName actionName() { + return this.actionName; + } + + /** + * 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() { + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("actionName", this.actionName == null ? null : this.actionName.toString()); + jsonWriter.writeJsonField("targetService", this.targetService); + jsonWriter.writeJsonField("authInfo", this.authInfo); + jsonWriter.writeStringField("clientType", this.clientType == null ? null : this.clientType.toString()); + jsonWriter.writeJsonField("vNetSolution", this.vNetSolution); + jsonWriter.writeJsonField("secretStore", this.secretStore); + jsonWriter.writeStringField("scope", this.scope); + jsonWriter.writeJsonField("publicNetworkSolution", this.publicNetworkSolution); + jsonWriter.writeJsonField("configurationInfo", this.configurationInfo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CreateOrUpdateDryrunParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CreateOrUpdateDryrunParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CreateOrUpdateDryrunParameters. + */ + public static CreateOrUpdateDryrunParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CreateOrUpdateDryrunParameters deserializedCreateOrUpdateDryrunParameters + = new CreateOrUpdateDryrunParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("actionName".equals(fieldName)) { + deserializedCreateOrUpdateDryrunParameters.actionName + = DryrunActionName.fromString(reader.getString()); + } else if ("targetService".equals(fieldName)) { + deserializedCreateOrUpdateDryrunParameters.targetService = TargetServiceBase.fromJson(reader); + } else if ("authInfo".equals(fieldName)) { + deserializedCreateOrUpdateDryrunParameters.authInfo = AuthInfoBase.fromJson(reader); + } else if ("clientType".equals(fieldName)) { + deserializedCreateOrUpdateDryrunParameters.clientType = ClientType.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedCreateOrUpdateDryrunParameters.provisioningState = reader.getString(); + } else if ("vNetSolution".equals(fieldName)) { + deserializedCreateOrUpdateDryrunParameters.vNetSolution = VNetSolution.fromJson(reader); + } else if ("secretStore".equals(fieldName)) { + deserializedCreateOrUpdateDryrunParameters.secretStore = SecretStore.fromJson(reader); + } else if ("scope".equals(fieldName)) { + deserializedCreateOrUpdateDryrunParameters.scope = reader.getString(); + } else if ("publicNetworkSolution".equals(fieldName)) { + deserializedCreateOrUpdateDryrunParameters.publicNetworkSolution + = PublicNetworkSolution.fromJson(reader); + } else if ("configurationInfo".equals(fieldName)) { + deserializedCreateOrUpdateDryrunParameters.configurationInfo = ConfigurationInfo.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCreateOrUpdateDryrunParameters; + }); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DaprBindingComponentDirection.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DaprBindingComponentDirection.java new file mode 100644 index 000000000000..44a2405aa378 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DaprBindingComponentDirection.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The direction supported by the dapr binding component. + */ +public final class DaprBindingComponentDirection extends ExpandableStringEnum { + /** + * Static value input for DaprBindingComponentDirection. + */ + public static final DaprBindingComponentDirection INPUT = fromString("input"); + + /** + * Static value output for DaprBindingComponentDirection. + */ + public static final DaprBindingComponentDirection OUTPUT = fromString("output"); + + /** + * Creates a new instance of DaprBindingComponentDirection value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DaprBindingComponentDirection() { + } + + /** + * Creates or finds a DaprBindingComponentDirection from its string representation. + * + * @param name a name to look for. + * @return the corresponding DaprBindingComponentDirection. + */ + public static DaprBindingComponentDirection fromString(String name) { + return fromString(name, DaprBindingComponentDirection.class); + } + + /** + * Gets known DaprBindingComponentDirection values. + * + * @return known DaprBindingComponentDirection values. + */ + public static Collection values() { + return values(DaprBindingComponentDirection.class); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DaprConfigurationList.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DaprConfigurationList.java new file mode 100644 index 000000000000..7793928ded84 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DaprConfigurationList.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.servicelinker.fluent.models.DaprConfigurationResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * Dapr configuration list supported by Service Connector. + */ +@Fluent +public final class DaprConfigurationList implements JsonSerializable { + /* + * The DaprConfigurationResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of DaprConfigurationList class. + */ + public DaprConfigurationList() { + } + + /** + * Get the value property: The DaprConfigurationResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The DaprConfigurationResource items on this page. + * + * @param value the value value to set. + * @return the DaprConfigurationList object itself. + */ + public DaprConfigurationList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the DaprConfigurationList object itself. + */ + public DaprConfigurationList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model DaprConfigurationList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DaprConfigurationList.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprConfigurationList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprConfigurationList if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DaprConfigurationList. + */ + public static DaprConfigurationList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprConfigurationList deserializedDaprConfigurationList = new DaprConfigurationList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> DaprConfigurationResourceInner.fromJson(reader1)); + deserializedDaprConfigurationList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDaprConfigurationList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprConfigurationList; + }); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DaprConfigurationResource.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DaprConfigurationResource.java new file mode 100644 index 000000000000..aead83cbd740 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DaprConfigurationResource.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.models; + +import com.azure.resourcemanager.servicelinker.fluent.models.DaprConfigurationResourceInner; + +/** + * An immutable client-side representation of DaprConfigurationResource. + */ +public interface DaprConfigurationResource { + /** + * Gets the targetType property: Supported target resource type, extract from resource id, uppercase. + * + * @return the targetType value. + */ + String targetType(); + + /** + * Gets the authType property: The authentication type. + * + * @return the authType value. + */ + AuthType authType(); + + /** + * Gets the daprProperties property: Indicates some additional properties for dapr client type. + * + * @return the daprProperties value. + */ + DaprProperties daprProperties(); + + /** + * Gets the inner com.azure.resourcemanager.servicelinker.fluent.models.DaprConfigurationResourceInner object. + * + * @return the inner object. + */ + DaprConfigurationResourceInner innerModel(); +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DaprMetadata.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DaprMetadata.java new file mode 100644 index 000000000000..5bd6fe768f00 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DaprMetadata.java @@ -0,0 +1,205 @@ +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The dapr component metadata. + */ +@Fluent +public final class DaprMetadata implements JsonSerializable { + /* + * Metadata property name. + */ + private String name; + + /* + * Metadata property value. + */ + private String value; + + /* + * The secret name where dapr could get value + */ + private String secretRef; + + /* + * The description of the metadata, returned from configuration api + */ + private String description; + + /* + * The value indicating whether the metadata is required or not + */ + private DaprMetadataRequired required; + + /** + * Creates an instance of DaprMetadata class. + */ + public DaprMetadata() { + } + + /** + * Get the name property: Metadata property name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Metadata property name. + * + * @param name the name value to set. + * @return the DaprMetadata object itself. + */ + public DaprMetadata withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: Metadata property value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Metadata property value. + * + * @param value the value value to set. + * @return the DaprMetadata object itself. + */ + public DaprMetadata withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the secretRef property: The secret name where dapr could get value. + * + * @return the secretRef value. + */ + public String secretRef() { + return this.secretRef; + } + + /** + * Set the secretRef property: The secret name where dapr could get value. + * + * @param secretRef the secretRef value to set. + * @return the DaprMetadata object itself. + */ + public DaprMetadata withSecretRef(String secretRef) { + this.secretRef = secretRef; + return this; + } + + /** + * Get the description property: The description of the metadata, returned from configuration api. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the metadata, returned from configuration api. + * + * @param description the description value to set. + * @return the DaprMetadata object itself. + */ + public DaprMetadata withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the required property: The value indicating whether the metadata is required or not. + * + * @return the required value. + */ + public DaprMetadataRequired required() { + return this.required; + } + + /** + * Set the required property: The value indicating whether the metadata is required or not. + * + * @param required the required value to set. + * @return the DaprMetadata object itself. + */ + public DaprMetadata withRequired(DaprMetadataRequired required) { + this.required = required; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("value", this.value); + jsonWriter.writeStringField("secretRef", this.secretRef); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("required", this.required == null ? null : this.required.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprMetadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprMetadata if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DaprMetadata. + */ + public static DaprMetadata fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprMetadata deserializedDaprMetadata = new DaprMetadata(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDaprMetadata.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedDaprMetadata.value = reader.getString(); + } else if ("secretRef".equals(fieldName)) { + deserializedDaprMetadata.secretRef = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedDaprMetadata.description = reader.getString(); + } else if ("required".equals(fieldName)) { + deserializedDaprMetadata.required = DaprMetadataRequired.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprMetadata; + }); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DaprMetadataRequired.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DaprMetadataRequired.java new file mode 100644 index 000000000000..19c304f95e96 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DaprMetadataRequired.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The value indicating whether the metadata is required or not. + */ +public final class DaprMetadataRequired extends ExpandableStringEnum { + /** + * Static value true for DaprMetadataRequired. + */ + public static final DaprMetadataRequired TRUE = fromString("true"); + + /** + * Static value false for DaprMetadataRequired. + */ + public static final DaprMetadataRequired FALSE = fromString("false"); + + /** + * Creates a new instance of DaprMetadataRequired value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DaprMetadataRequired() { + } + + /** + * Creates or finds a DaprMetadataRequired from its string representation. + * + * @param name a name to look for. + * @return the corresponding DaprMetadataRequired. + */ + public static DaprMetadataRequired fromString(String name) { + return fromString(name, DaprMetadataRequired.class); + } + + /** + * Gets known DaprMetadataRequired values. + * + * @return known DaprMetadataRequired values. + */ + public static Collection values() { + return values(DaprMetadataRequired.class); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DaprProperties.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DaprProperties.java new file mode 100644 index 000000000000..11eec8155833 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DaprProperties.java @@ -0,0 +1,244 @@ +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Indicates some additional properties for dapr client type. + */ +@Fluent +public final class DaprProperties implements JsonSerializable { + /* + * The dapr component version + */ + private String version; + + /* + * The dapr component type + */ + private String componentType; + + /* + * The name of a secret store dapr to retrieve secret + */ + private String secretStoreComponent; + + /* + * Additional dapr metadata + */ + private List metadata; + + /* + * The dapr component scopes + */ + private List scopes; + + /* + * The runtime version supported by the properties + */ + private String runtimeVersion; + + /* + * The direction supported by the dapr binding component + */ + private DaprBindingComponentDirection bindingComponentDirection; + + /** + * Creates an instance of DaprProperties class. + */ + public DaprProperties() { + } + + /** + * Get the version property: The dapr component version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The dapr component version. + * + * @param version the version value to set. + * @return the DaprProperties object itself. + */ + public DaprProperties withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the componentType property: The dapr component type. + * + * @return the componentType value. + */ + public String componentType() { + return this.componentType; + } + + /** + * Set the componentType property: The dapr component type. + * + * @param componentType the componentType value to set. + * @return the DaprProperties object itself. + */ + public DaprProperties withComponentType(String componentType) { + this.componentType = componentType; + return this; + } + + /** + * Get the secretStoreComponent property: The name of a secret store dapr to retrieve secret. + * + * @return the secretStoreComponent value. + */ + public String secretStoreComponent() { + return this.secretStoreComponent; + } + + /** + * Set the secretStoreComponent property: The name of a secret store dapr to retrieve secret. + * + * @param secretStoreComponent the secretStoreComponent value to set. + * @return the DaprProperties object itself. + */ + public DaprProperties withSecretStoreComponent(String secretStoreComponent) { + this.secretStoreComponent = secretStoreComponent; + return this; + } + + /** + * Get the metadata property: Additional dapr metadata. + * + * @return the metadata value. + */ + public List metadata() { + return this.metadata; + } + + /** + * Set the metadata property: Additional dapr metadata. + * + * @param metadata the metadata value to set. + * @return the DaprProperties object itself. + */ + public DaprProperties withMetadata(List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the scopes property: The dapr component scopes. + * + * @return the scopes value. + */ + public List scopes() { + return this.scopes; + } + + /** + * Set the scopes property: The dapr component scopes. + * + * @param scopes the scopes value to set. + * @return the DaprProperties object itself. + */ + public DaprProperties withScopes(List scopes) { + this.scopes = scopes; + return this; + } + + /** + * Get the runtimeVersion property: The runtime version supported by the properties. + * + * @return the runtimeVersion value. + */ + public String runtimeVersion() { + return this.runtimeVersion; + } + + /** + * Get the bindingComponentDirection property: The direction supported by the dapr binding component. + * + * @return the bindingComponentDirection value. + */ + public DaprBindingComponentDirection bindingComponentDirection() { + return this.bindingComponentDirection; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metadata() != null) { + metadata().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("version", this.version); + jsonWriter.writeStringField("componentType", this.componentType); + jsonWriter.writeStringField("secretStoreComponent", this.secretStoreComponent); + jsonWriter.writeArrayField("metadata", this.metadata, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("scopes", this.scopes, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DaprProperties. + */ + public static DaprProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprProperties deserializedDaprProperties = new DaprProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("version".equals(fieldName)) { + deserializedDaprProperties.version = reader.getString(); + } else if ("componentType".equals(fieldName)) { + deserializedDaprProperties.componentType = reader.getString(); + } else if ("secretStoreComponent".equals(fieldName)) { + deserializedDaprProperties.secretStoreComponent = reader.getString(); + } else if ("metadata".equals(fieldName)) { + List metadata = reader.readArray(reader1 -> DaprMetadata.fromJson(reader1)); + deserializedDaprProperties.metadata = metadata; + } else if ("scopes".equals(fieldName)) { + List scopes = reader.readArray(reader1 -> reader1.getString()); + deserializedDaprProperties.scopes = scopes; + } else if ("runtimeVersion".equals(fieldName)) { + deserializedDaprProperties.runtimeVersion = reader.getString(); + } else if ("bindingComponentDirection".equals(fieldName)) { + deserializedDaprProperties.bindingComponentDirection + = DaprBindingComponentDirection.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprProperties; + }); + } +} 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..1e2b5935dfb5 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DeleteOrUpdateBehavior.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.models; + +import com.azure.core.util.ExpandableStringEnum; +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 a new instance of DeleteOrUpdateBehavior value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DeleteOrUpdateBehavior() { + } + + /** + * Creates or finds a DeleteOrUpdateBehavior from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeleteOrUpdateBehavior. + */ + 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..8d99144988b1 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunActionName.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.core.util.ExpandableStringEnum; +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 a new instance of DryrunActionName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DryrunActionName() { + } + + /** + * Creates or finds a DryrunActionName from its string representation. + * + * @param name a name to look for. + * @return the corresponding DryrunActionName. + */ + 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..53bfa9a0386d --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunList.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.servicelinker.fluent.models.DryrunResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The list of dryrun. + */ +@Fluent +public final class DryrunList implements JsonSerializable { + /* + * The DryrunResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of DryrunList class. + */ + public DryrunList() { + } + + /** + * Get the value property: The DryrunResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The DryrunResource items on this page. + * + * @param value the value value to set. + * @return the DryrunList object itself. + */ + public DryrunList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the DryrunList object itself. + */ + public DryrunList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model DryrunList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DryrunList.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DryrunList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DryrunList if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DryrunList. + */ + public static DryrunList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DryrunList deserializedDryrunList = new DryrunList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> DryrunResourceInner.fromJson(reader1)); + deserializedDryrunList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDryrunList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDryrunList; + }); + } +} 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..ae22fd8e0402 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunOperationPreview.java @@ -0,0 +1,211 @@ +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The preview of the operations for creation. + */ +@Fluent +public final class DryrunOperationPreview implements JsonSerializable { + /* + * The operation name + */ + private String name; + + /* + * The operation type + */ + private DryrunPreviewOperationType operationType; + + /* + * The description of the operation + */ + private String description; + + /* + * The action defined by RBAC, refer + * https://docs.microsoft.com/azure/role-based-access-control/role-definitions#actions-format + */ + private String action; + + /* + * The scope of the operation, refer https://docs.microsoft.com/azure/role-based-access-control/scope-overview + */ + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("operationType", this.operationType == null ? null : this.operationType.toString()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("action", this.action); + jsonWriter.writeStringField("scope", this.scope); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DryrunOperationPreview from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DryrunOperationPreview if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DryrunOperationPreview. + */ + public static DryrunOperationPreview fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DryrunOperationPreview deserializedDryrunOperationPreview = new DryrunOperationPreview(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDryrunOperationPreview.name = reader.getString(); + } else if ("operationType".equals(fieldName)) { + deserializedDryrunOperationPreview.operationType + = DryrunPreviewOperationType.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedDryrunOperationPreview.description = reader.getString(); + } else if ("action".equals(fieldName)) { + deserializedDryrunOperationPreview.action = reader.getString(); + } else if ("scope".equals(fieldName)) { + deserializedDryrunOperationPreview.scope = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDryrunOperationPreview; + }); + } +} 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..a34ec858d575 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunParameters.java @@ -0,0 +1,107 @@ +// 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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The parameters of the dryrun. + */ +@Immutable +public class DryrunParameters implements JsonSerializable { + /* + * The name of action for you dryrun job. + */ + private DryrunActionName actionName = DryrunActionName.fromString("DryrunParameters"); + + /** + * Creates an instance of DryrunParameters class. + */ + public DryrunParameters() { + } + + /** + * Get the actionName property: The name of action for you dryrun job. + * + * @return the actionName value. + */ + public DryrunActionName actionName() { + return this.actionName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("actionName", this.actionName == null ? null : this.actionName.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DryrunParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DryrunParameters if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DryrunParameters. + */ + public static DryrunParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("actionName".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("createOrUpdate".equals(discriminatorValue)) { + return CreateOrUpdateDryrunParameters.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static DryrunParameters fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DryrunParameters deserializedDryrunParameters = new DryrunParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("actionName".equals(fieldName)) { + deserializedDryrunParameters.actionName = DryrunActionName.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDryrunParameters; + }); + } +} 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..4522ace0bb8f --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunPatch.java @@ -0,0 +1,137 @@ +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.servicelinker.fluent.models.DryrunProperties; +import java.io.IOException; +import java.util.List; + +/** + * a dryrun job to be updated. + */ +@Fluent +public final class DryrunPatch implements JsonSerializable { + /* + * The properties of the dryrun job. + */ + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DryrunPatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DryrunPatch if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DryrunPatch. + */ + public static DryrunPatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DryrunPatch deserializedDryrunPatch = new DryrunPatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedDryrunPatch.innerProperties = DryrunProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDryrunPatch; + }); + } +} 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..8974d65d13de --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunPrerequisiteResult.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A result of dryrun. + */ +@Immutable +public class DryrunPrerequisiteResult implements JsonSerializable { + /* + * The type of dryrun result. + */ + private DryrunPrerequisiteResultType type = DryrunPrerequisiteResultType.fromString("DryrunPrerequisiteResult"); + + /** + * Creates an instance of DryrunPrerequisiteResult class. + */ + public DryrunPrerequisiteResult() { + } + + /** + * Get the type property: The type of dryrun result. + * + * @return the type value. + */ + public DryrunPrerequisiteResultType type() { + return this.type; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DryrunPrerequisiteResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DryrunPrerequisiteResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DryrunPrerequisiteResult. + */ + public static DryrunPrerequisiteResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("type".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("basicError".equals(discriminatorValue)) { + return BasicErrorDryrunPrerequisiteResult.fromJson(readerToUse.reset()); + } else if ("permissionsMissing".equals(discriminatorValue)) { + return PermissionsMissingDryrunPrerequisiteResult.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static DryrunPrerequisiteResult fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DryrunPrerequisiteResult deserializedDryrunPrerequisiteResult = new DryrunPrerequisiteResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedDryrunPrerequisiteResult.type + = DryrunPrerequisiteResultType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDryrunPrerequisiteResult; + }); + } +} 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..1446010d6527 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunPrerequisiteResultType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.models; + +import com.azure.core.util.ExpandableStringEnum; +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 a new instance of DryrunPrerequisiteResultType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DryrunPrerequisiteResultType() { + } + + /** + * Creates or finds a DryrunPrerequisiteResultType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DryrunPrerequisiteResultType. + */ + 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..42ba8a25920e --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunPreviewOperationType.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.util.ExpandableStringEnum; +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 a new instance of DryrunPreviewOperationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DryrunPreviewOperationType() { + } + + /** + * Creates or finds a DryrunPreviewOperationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DryrunPreviewOperationType. + */ + 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..4b0e982f6427 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/DryrunResource.java @@ -0,0 +1,211 @@ +// 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 resourceGroupName, location. + * + * @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 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/EasyAuthMicrosoftEntraIdAuthInfo.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/EasyAuthMicrosoftEntraIdAuthInfo.java new file mode 100644 index 000000000000..e1f44ce84926 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/EasyAuthMicrosoftEntraIdAuthInfo.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The authentication info when authType is EasyAuth Microsoft Entra ID. + */ +@Fluent +public final class EasyAuthMicrosoftEntraIdAuthInfo extends AuthInfoBase { + /* + * The authentication type. + */ + private AuthType authType = AuthType.EASY_AUTH_MICROSOFT_ENTRA_ID; + + /* + * Application clientId for EasyAuth Microsoft Entra ID. + */ + private String clientId; + + /* + * Application Secret for EasyAuth Microsoft Entra ID. + */ + private String secret; + + /* + * Indicates whether to clean up previous operation when Linker is updating or deleting + */ + private DeleteOrUpdateBehavior deleteOrUpdateBehavior; + + /** + * Creates an instance of EasyAuthMicrosoftEntraIdAuthInfo class. + */ + public EasyAuthMicrosoftEntraIdAuthInfo() { + } + + /** + * Get the authType property: The authentication type. + * + * @return the authType value. + */ + @Override + public AuthType authType() { + return this.authType; + } + + /** + * Get the clientId property: Application clientId for EasyAuth Microsoft Entra ID. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: Application clientId for EasyAuth Microsoft Entra ID. + * + * @param clientId the clientId value to set. + * @return the EasyAuthMicrosoftEntraIdAuthInfo object itself. + */ + public EasyAuthMicrosoftEntraIdAuthInfo withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the secret property: Application Secret for EasyAuth Microsoft Entra ID. + * + * @return the secret value. + */ + public String secret() { + return this.secret; + } + + /** + * Set the secret property: Application Secret for EasyAuth Microsoft Entra ID. + * + * @param secret the secret value to set. + * @return the EasyAuthMicrosoftEntraIdAuthInfo object itself. + */ + public EasyAuthMicrosoftEntraIdAuthInfo withSecret(String secret) { + this.secret = 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 EasyAuthMicrosoftEntraIdAuthInfo object itself. + */ + public EasyAuthMicrosoftEntraIdAuthInfo withDeleteOrUpdateBehavior(DeleteOrUpdateBehavior deleteOrUpdateBehavior) { + this.deleteOrUpdateBehavior = deleteOrUpdateBehavior; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EasyAuthMicrosoftEntraIdAuthInfo withAuthMode(AuthMode authMode) { + super.withAuthMode(authMode); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("authMode", authMode() == null ? null : authMode().toString()); + jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeStringField("clientId", this.clientId); + jsonWriter.writeStringField("secret", this.secret); + jsonWriter.writeStringField("deleteOrUpdateBehavior", + this.deleteOrUpdateBehavior == null ? null : this.deleteOrUpdateBehavior.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EasyAuthMicrosoftEntraIdAuthInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EasyAuthMicrosoftEntraIdAuthInfo if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EasyAuthMicrosoftEntraIdAuthInfo. + */ + public static EasyAuthMicrosoftEntraIdAuthInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EasyAuthMicrosoftEntraIdAuthInfo deserializedEasyAuthMicrosoftEntraIdAuthInfo + = new EasyAuthMicrosoftEntraIdAuthInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authMode".equals(fieldName)) { + deserializedEasyAuthMicrosoftEntraIdAuthInfo.withAuthMode(AuthMode.fromString(reader.getString())); + } else if ("authType".equals(fieldName)) { + deserializedEasyAuthMicrosoftEntraIdAuthInfo.authType = AuthType.fromString(reader.getString()); + } else if ("clientId".equals(fieldName)) { + deserializedEasyAuthMicrosoftEntraIdAuthInfo.clientId = reader.getString(); + } else if ("secret".equals(fieldName)) { + deserializedEasyAuthMicrosoftEntraIdAuthInfo.secret = reader.getString(); + } else if ("deleteOrUpdateBehavior".equals(fieldName)) { + deserializedEasyAuthMicrosoftEntraIdAuthInfo.deleteOrUpdateBehavior + = DeleteOrUpdateBehavior.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEasyAuthMicrosoftEntraIdAuthInfo; + }); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/FabricPlatform.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/FabricPlatform.java new file mode 100644 index 000000000000..a1a4acfe7eff --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/FabricPlatform.java @@ -0,0 +1,111 @@ +// 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The service properties when target service type is FabricPlatform. + */ +@Fluent +public final class FabricPlatform extends TargetServiceBase { + /* + * The target service type. + */ + private TargetServiceType type = TargetServiceType.FABRIC_PLATFORM; + + /* + * The endpoint of service. + */ + private String endpoint; + + /** + * Creates an instance of FabricPlatform class. + */ + public FabricPlatform() { + } + + /** + * Get the type property: The target service type. + * + * @return the type value. + */ + @Override + public TargetServiceType type() { + return this.type; + } + + /** + * 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 FabricPlatform object itself. + */ + public FabricPlatform withEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("endpoint", this.endpoint); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FabricPlatform from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FabricPlatform if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FabricPlatform. + */ + public static FabricPlatform fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FabricPlatform deserializedFabricPlatform = new FabricPlatform(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedFabricPlatform.type = TargetServiceType.fromString(reader.getString()); + } else if ("endpoint".equals(fieldName)) { + deserializedFabricPlatform.endpoint = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFabricPlatform; + }); + } +} 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..a2742f2469e3 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/FirewallRules.java @@ -0,0 +1,158 @@ +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Target service's firewall rules. to allow connections from source service. + */ +@Fluent +public final class FirewallRules implements JsonSerializable { + /* + * 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. + */ + private List ipRanges; + + /* + * Allow Azure services to access the target service if true. + */ + 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. + */ + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("ipRanges", this.ipRanges, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("azureServices", this.azureServices == null ? null : this.azureServices.toString()); + jsonWriter.writeStringField("callerClientIP", + this.callerClientIp == null ? null : this.callerClientIp.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallRules from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallRules if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallRules. + */ + public static FirewallRules fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallRules deserializedFirewallRules = new FirewallRules(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipRanges".equals(fieldName)) { + List ipRanges = reader.readArray(reader1 -> reader1.getString()); + deserializedFirewallRules.ipRanges = ipRanges; + } else if ("azureServices".equals(fieldName)) { + deserializedFirewallRules.azureServices = AllowType.fromString(reader.getString()); + } else if ("callerClientIP".equals(fieldName)) { + deserializedFirewallRules.callerClientIp = AllowType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallRules; + }); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/LinkerConfigurationType.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/LinkerConfigurationType.java new file mode 100644 index 000000000000..6a5523f06868 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/LinkerConfigurationType.java @@ -0,0 +1,53 @@ +// 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 java.util.Collection; + +/** + * Type of configuration to determine whether the configuration can be modified after creation. KeyvaultSecret means the + * configuration references a key vault secret, such as App Service/ACA key vault reference. Default means the + * configuration is real value, such as user name, raw secret, etc. + */ +public final class LinkerConfigurationType extends ExpandableStringEnum { + /** + * Static value Default for LinkerConfigurationType. + */ + public static final LinkerConfigurationType DEFAULT = fromString("Default"); + + /** + * Static value KeyVaultSecret for LinkerConfigurationType. + */ + public static final LinkerConfigurationType KEY_VAULT_SECRET = fromString("KeyVaultSecret"); + + /** + * Creates a new instance of LinkerConfigurationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LinkerConfigurationType() { + } + + /** + * Creates or finds a LinkerConfigurationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding LinkerConfigurationType. + */ + public static LinkerConfigurationType fromString(String name) { + return fromString(name, LinkerConfigurationType.class); + } + + /** + * Gets known LinkerConfigurationType values. + * + * @return known LinkerConfigurationType values. + */ + public static Collection values() { + return values(LinkerConfigurationType.class); + } +} 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 1d197ad5b89b..e75995eec676 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 @@ -13,7 +13,7 @@ import java.io.IOException; /** - * A linker to be updated. + * A Linker to be updated. */ @Fluent public final class LinkerPatch implements JsonSerializable { @@ -184,6 +184,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 80d55f943caa..b150fc435006 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 @@ -35,7 +35,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. */ @@ -90,6 +90,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. * @@ -100,7 +122,8 @@ public interface LinkerResource { /** * The entirety of the LinkerResource definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScopeStage, DefinitionStages.WithCreate { + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } /** @@ -110,20 +133,21 @@ 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 resourceGroupName, location. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @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 resourceGroupName, String location); } /** @@ -132,7 +156,8 @@ interface WithScopeStage { */ interface WithCreate extends DefinitionStages.WithTargetService, DefinitionStages.WithAuthInfo, DefinitionStages.WithClientType, - DefinitionStages.WithVNetSolution, DefinitionStages.WithSecretStore, DefinitionStages.WithScope { + DefinitionStages.WithVNetSolution, DefinitionStages.WithSecretStore, DefinitionStages.WithScope, + DefinitionStages.WithPublicNetworkSolution, DefinitionStages.WithConfigurationInfo { /** * Executes the create request. * @@ -226,6 +251,34 @@ 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); + } } /** @@ -239,7 +292,8 @@ interface WithScope { * The template for LinkerResource update. */ interface Update extends UpdateStages.WithTargetService, UpdateStages.WithAuthInfo, UpdateStages.WithClientType, - UpdateStages.WithVNetSolution, UpdateStages.WithSecretStore, UpdateStages.WithScope { + UpdateStages.WithVNetSolution, UpdateStages.WithSecretStore, UpdateStages.WithScope, + UpdateStages.WithPublicNetworkSolution, UpdateStages.WithConfigurationInfo { /** * Executes the update request. * @@ -337,6 +391,34 @@ 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); + } } /** @@ -355,43 +437,44 @@ interface WithScope { LinkerResource refresh(Context context); /** - * Validate a link. + * 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 the validation operation result for a linker. + * @return configurations for source resource, include appSettings, connectionString and serviceBindings along with + * {@link Response}. */ - ValidateOperationResult validate(); + Response generateConfigurationsWithResponse(ConfigurationInfo parameters, Context context); /** - * Validate a link. + * 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 the validation operation result for a linker. + * @return configurations for source resource, include appSettings, connectionString and serviceBindings. */ - ValidateOperationResult validate(Context context); + ConfigurationResult generateConfigurations(); /** - * list source configurations for a linker. + * 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 configurations for source resource, include appSettings, connectionString and serviceBindings along with - * {@link Response}. + * @return the validation operation result for a Linker. */ - Response listConfigurationsWithResponse(Context context); + ValidateOperationResult validate(); /** - * list source configurations for a linker. + * 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 configurations for source resource, include appSettings, connectionString and serviceBindings. + * @return the validation operation result for a Linker. */ - SourceConfigurationResult listConfigurations(); + ValidateOperationResult validate(Context context); } 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 6f6b4b7e1781..beec1ad9aea9 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,25 +7,30 @@ 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 providers {resourceUri}. * @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 Linker as paginated response with {@link PagedIterable}. */ - PagedIterable list(String resourceUri); + PagedIterable list(String providers, 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 providers {resourceUri}. * @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. @@ -33,11 +38,13 @@ public interface Linkers { * @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 resourceUri, Context context); + PagedIterable list(String providers, String resourceUri, Context context); /** * Returns Linker resource for a given name. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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. @@ -46,11 +53,14 @@ public interface Linkers { * @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 resourceUri, String linkerName, Context context); + Response getWithResponse(String providers, String linkers, String resourceUri, String linkerName, + Context context); /** * Returns Linker resource for a given name. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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. @@ -58,132 +68,159 @@ public interface Linkers { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return linker of source and target resource. */ - LinkerResource get(String resourceUri, String linkerName); + LinkerResource get(String providers, String linkers, String resourceUri, String linkerName); /** - * Delete a link. + * Create or update Linker resource. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 providers, String linkers, String resourceUri, String linkerName, + LinkerResourceInner parameters); /** - * Delete a link. + * Create or update Linker resource. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 providers, String linkers, String resourceUri, String linkerName, + LinkerResourceInner parameters, Context context); /** - * Validate a link. + * Operation to update an existing Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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 the validation operation result for a linker. + * @return linker of source and target resource. */ - ValidateOperationResult validate(String resourceUri, String linkerName); + Response updateWithResponse(String providers, String linkers, String resourceUri, String linkerName, + LinkerPatch parameters, Context context); /** - * Validate a link. + * Operation to update an existing Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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. + * @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 the validation operation result for a linker. + * @return linker of source and target resource. */ - ValidateOperationResult validate(String resourceUri, String linkerName, Context context); + LinkerResource update(String providers, String linkers, String resourceUri, String linkerName, + LinkerPatch parameters); /** - * list source configurations for a linker. + * Delete a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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}. */ - Response listConfigurationsWithResponse(String resourceUri, String linkerName, - Context context); + void delete(String providers, String linkers, String resourceUri, String linkerName); /** - * list source configurations for a linker. + * Delete a Linker. * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. * @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. */ - SourceConfigurationResult listConfigurations(String resourceUri, String linkerName); + void delete(String providers, String linkers, String resourceUri, String linkerName, Context context); /** - * Returns Linker resource for a given name. + * list source configurations for a Linker. * - * @param id the resource ID. + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. + * @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 configurations for source resource, include appSettings, connectionString and serviceBindings along with + * {@link Response}. */ - LinkerResource getById(String id); + Response listConfigurationsWithResponse(String providers, String linkers, String resourceUri, + String linkerName, Context context); /** - * Returns Linker resource for a given name. + * list source configurations for a Linker. * - * @param id the resource ID. - * @param context The context to associate with this operation. + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. + * @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 configurations for source resource, include appSettings, connectionString and serviceBindings. */ - Response getByIdWithResponse(String id, Context context); + ConfigurationResult listConfigurations(String providers, String linkers, String resourceUri, String linkerName); /** - * Delete a link. + * Validate a Linker. * - * @param id the resource ID. + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. + * @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. */ - void deleteById(String id); + ValidateOperationResult validate(String providers, String linkers, String resourceUri, String linkerName); /** - * Delete a link. + * Validate a Linker. * - * @param id the resource ID. + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. + * @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 the validation operation result for a Linker. */ - 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); + ValidateOperationResult validate(String providers, String linkers, String resourceUri, String linkerName, + Context context); } 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..65986e5a97b9 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/LinkersOperations.java @@ -0,0 +1,220 @@ +// 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 providers {resourceUri}. + * @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 providers, String resourceUri); + + /** + * list dryrun jobs. + * + * @param providers {resourceUri}. + * @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 providers, String resourceUri, Context context); + + /** + * get a dryrun job. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, String resourceUri, + String dryrunName, Context context); + + /** + * get a dryrun job. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, String resourceUri, String dryrunName); + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, String resourceUri, String dryrunName, + DryrunResourceInner parameters); + + /** + * create a dryrun job to do necessary check before actual creation. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, String resourceUri, String dryrunName, + DryrunResourceInner parameters, Context context); + + /** + * add a dryrun job to do necessary check before actual creation. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, String resourceUri, String dryrunName, + DryrunPatch parameters); + + /** + * add a dryrun job to do necessary check before actual creation. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, String resourceUri, String dryrunName, + DryrunPatch parameters, Context context); + + /** + * delete a dryrun job. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, String resourceUri, String dryrunName, + Context context); + + /** + * delete a dryrun job. + * + * @param providers {resourceUri}. + * @param dryruns The name of the DryrunResource. + * @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 providers, String dryruns, String resourceUri, String dryrunName); + + /** + * Generate configurations for a Linker. + * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. + * @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 providers, String linkers, + String resourceUri, String linkerName, ConfigurationInfo parameters, Context context); + + /** + * Generate configurations for a Linker. + * + * @param providers {resourceUri}. + * @param linkers The name of the LinkerResource. + * @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 providers, String linkers, String resourceUri, String linkerName); + + /** + * List the dapr configuration supported by Service Connector. + * + * @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 dapr configuration list supported by Service Connector as paginated response with {@link PagedIterable}. + */ + PagedIterable listDaprConfigurations(String resourceUri); + + /** + * List the dapr configuration supported by Service Connector. + * + * @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 dapr configuration list supported by Service Connector as paginated response with {@link PagedIterable}. + */ + PagedIterable listDaprConfigurations(String resourceUri, Context context); +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/LinkersUpdateHeaders.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/LinkersUpdateHeaders.java new file mode 100644 index 000000000000..5ae2de5c8d0f --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/LinkersUpdateHeaders.java @@ -0,0 +1,61 @@ +// 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.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; + +/** + * The LinkersUpdateHeaders model. + */ +@Fluent +public final class LinkersUpdateHeaders { + /* + * The Retry-After property. + */ + private Integer retryAfter; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of LinkersUpdateHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public LinkersUpdateHeaders(HttpHeaders rawHeaders) { + String retryAfter = rawHeaders.getValue(HttpHeaderName.RETRY_AFTER); + if (retryAfter != null) { + this.retryAfter = Integer.parseInt(retryAfter); + } + } + + /** + * Get the retryAfter property: The Retry-After property. + * + * @return the retryAfter value. + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter property: The Retry-After property. + * + * @param retryAfter the retryAfter value to set. + * @return the LinkersUpdateHeaders object itself. + */ + public LinkersUpdateHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + 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/LinkersUpdateResponse.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/LinkersUpdateResponse.java new file mode 100644 index 000000000000..257603fb2c2a --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/LinkersUpdateResponse.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.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.servicelinker.fluent.models.LinkerResourceInner; + +/** + * Contains all response data for the update operation. + */ +public final class LinkersUpdateResponse extends ResponseBase { + /** + * Creates an instance of LinkersUpdateResponse. + * + * @param request the request which resulted in this LinkersUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public LinkersUpdateResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, LinkerResourceInner value, + LinkersUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ + @Override + public LinkerResourceInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/Operations.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/Operations.java index 957030b39b73..fa3d0b668634 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/Operations.java +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/Operations.java @@ -12,7 +12,7 @@ */ public interface Operations { /** - * Lists the available ServiceLinker REST API operations. + * List the operations for the provider. * * @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. @@ -22,7 +22,7 @@ public interface Operations { PagedIterable list(); /** - * Lists the available ServiceLinker REST API operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. 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..2ac4eddd0da3 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/PermissionsMissingDryrunPrerequisiteResult.java @@ -0,0 +1,171 @@ +// 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The represent of missing permissions. + */ +@Fluent +public final class PermissionsMissingDryrunPrerequisiteResult extends DryrunPrerequisiteResult { + /* + * The type of dryrun result. + */ + private DryrunPrerequisiteResultType type = DryrunPrerequisiteResultType.PERMISSIONS_MISSING; + + /* + * The permission scope + */ + private String scope; + + /* + * The permission list + */ + private List permissions; + + /* + * The recommended role to resolve permissions missing + */ + private String recommendedRole; + + /** + * Creates an instance of PermissionsMissingDryrunPrerequisiteResult class. + */ + public PermissionsMissingDryrunPrerequisiteResult() { + } + + /** + * Get the type property: The type of dryrun result. + * + * @return the type value. + */ + @Override + public DryrunPrerequisiteResultType type() { + return this.type; + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("scope", this.scope); + jsonWriter.writeArrayField("permissions", this.permissions, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("recommendedRole", this.recommendedRole); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PermissionsMissingDryrunPrerequisiteResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PermissionsMissingDryrunPrerequisiteResult if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PermissionsMissingDryrunPrerequisiteResult. + */ + public static PermissionsMissingDryrunPrerequisiteResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PermissionsMissingDryrunPrerequisiteResult deserializedPermissionsMissingDryrunPrerequisiteResult + = new PermissionsMissingDryrunPrerequisiteResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedPermissionsMissingDryrunPrerequisiteResult.type + = DryrunPrerequisiteResultType.fromString(reader.getString()); + } else if ("scope".equals(fieldName)) { + deserializedPermissionsMissingDryrunPrerequisiteResult.scope = reader.getString(); + } else if ("permissions".equals(fieldName)) { + List permissions = reader.readArray(reader1 -> reader1.getString()); + deserializedPermissionsMissingDryrunPrerequisiteResult.permissions = permissions; + } else if ("recommendedRole".equals(fieldName)) { + deserializedPermissionsMissingDryrunPrerequisiteResult.recommendedRole = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPermissionsMissingDryrunPrerequisiteResult; + }); + } +} 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..89c999a86864 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/PublicNetworkSolution.java @@ -0,0 +1,161 @@ +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Indicates public network solution, include firewall rules. + */ +@Fluent +public final class PublicNetworkSolution implements JsonSerializable { + /* + * Indicates whether to clean up previous operation(such as firewall rules) when Linker is updating or deleting + */ + 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. + */ + private ActionType action; + + /* + * Describe firewall rules of target service to make sure source application could connect to the target. + */ + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("deleteOrUpdateBehavior", + this.deleteOrUpdateBehavior == null ? null : this.deleteOrUpdateBehavior.toString()); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + jsonWriter.writeJsonField("firewallRules", this.firewallRules); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PublicNetworkSolution from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PublicNetworkSolution if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the PublicNetworkSolution. + */ + public static PublicNetworkSolution fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PublicNetworkSolution deserializedPublicNetworkSolution = new PublicNetworkSolution(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deleteOrUpdateBehavior".equals(fieldName)) { + deserializedPublicNetworkSolution.deleteOrUpdateBehavior + = DeleteOrUpdateBehavior.fromString(reader.getString()); + } else if ("action".equals(fieldName)) { + deserializedPublicNetworkSolution.action = ActionType.fromString(reader.getString()); + } else if ("firewallRules".equals(fieldName)) { + deserializedPublicNetworkSolution.firewallRules = FirewallRules.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPublicNetworkSolution; + }); + } +} 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 57% 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 eafd38a44fdb..024abc2a6d8d 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 @@ -5,6 +5,7 @@ package com.azure.resourcemanager.servicelinker.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,60 +18,60 @@ * The list of Linker. */ @Fluent -public final class LinkerList implements JsonSerializable { +public final class ResourceList implements JsonSerializable { /* - * The link used to get the next page of Linker list. + * The LinkerResource items on this page */ - private String nextLink; + private List value; /* - * The list of Linkers. + * The link to the next page of items */ - private List value; + private String nextLink; /** - * Creates an instance of LinkerList class. + * Creates an instance of ResourceList class. */ - public LinkerList() { + public ResourceList() { } /** - * Get the nextLink property: The link used to get the next page of Linker list. + * Get the value property: The LinkerResource items on this page. * - * @return the nextLink value. + * @return the value value. */ - public String nextLink() { - return this.nextLink; + public List value() { + return this.value; } /** - * Set the nextLink property: The link used to get the next page of Linker list. + * Set the value property: The LinkerResource items on this page. * - * @param nextLink the nextLink value to set. - * @return the LinkerList object itself. + * @param value the value value to set. + * @return the ResourceList object itself. */ - public LinkerList withNextLink(String nextLink) { - this.nextLink = nextLink; + public ResourceList withValue(List value) { + this.value = value; return this; } /** - * Get the value property: The list of Linkers. + * Get the nextLink property: The link to the next page of items. * - * @return the value value. + * @return the nextLink value. */ - public List value() { - return this.value; + public String nextLink() { + return this.nextLink; } /** - * Set the value property: The list of Linkers. + * Set the nextLink property: The link to the next page of items. * - * @param value the value value to set. - * @return the LinkerList object itself. + * @param nextLink the nextLink value to set. + * @return the ResourceList object itself. */ - public LinkerList withValue(List value) { - this.value = value; + public ResourceList withNextLink(String nextLink) { + this.nextLink = nextLink; return this; } @@ -80,49 +81,55 @@ public LinkerList withValue(List value) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model ResourceList")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(ResourceList.class); + /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nextLink", this.nextLink); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } /** - * Reads an instance of LinkerList from the JsonReader. + * Reads an instance of ResourceList from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of LinkerList if the JsonReader was pointing to an instance of it, or null if it was pointing - * to JSON null. - * @throws IOException If an error occurs while reading the LinkerList. + * @return An instance of ResourceList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ResourceList. */ - public static LinkerList fromJson(JsonReader jsonReader) throws IOException { + public static ResourceList fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - LinkerList deserializedLinkerList = new LinkerList(); + ResourceList deserializedResourceList = new ResourceList(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("nextLink".equals(fieldName)) { - deserializedLinkerList.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { + if ("value".equals(fieldName)) { List value = reader.readArray(reader1 -> LinkerResourceInner.fromJson(reader1)); - deserializedLinkerList.value = value; + deserializedResourceList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedResourceList.nextLink = reader.getString(); } else { reader.skipChildren(); } } - return deserializedLinkerList; + return deserializedResourceList; }); } } 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 84bee1c42fda..492f3042c169 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 @@ -86,6 +86,15 @@ public SecretAuthInfo withSecretInfo(SecretInfoBase secretInfo) { return this; } + /** + * {@inheritDoc} + */ + @Override + public SecretAuthInfo withAuthMode(AuthMode authMode) { + super.withAuthMode(authMode); + return this; + } + /** * Validates the instance. * @@ -104,6 +113,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("authMode", authMode() == null ? null : authMode().toString()); jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); jsonWriter.writeStringField("name", this.name); jsonWriter.writeJsonField("secretInfo", this.secretInfo); @@ -125,7 +135,9 @@ public static SecretAuthInfo fromJson(JsonReader jsonReader) throws IOException String fieldName = reader.getFieldName(); reader.nextToken(); - if ("authType".equals(fieldName)) { + if ("authMode".equals(fieldName)) { + deserializedSecretAuthInfo.withAuthMode(AuthMode.fromString(reader.getString())); + } else if ("authType".equals(fieldName)) { deserializedSecretAuthInfo.authType = AuthType.fromString(reader.getString()); } else if ("name".equals(fieldName)) { deserializedSecretAuthInfo.name = reader.getString(); 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 8ff0039aefa4..bc06499e9a9d 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 @@ -78,12 +78,12 @@ public static SecretInfoBase fromJson(JsonReader jsonReader) throws IOException } } // Use the discriminator value to determine which subtype should be deserialized. - if ("rawValue".equals(discriminatorValue)) { - return ValueSecretInfo.fromJson(readerToUse.reset()); - } else if ("keyVaultSecretReference".equals(discriminatorValue)) { + if ("keyVaultSecretReference".equals(discriminatorValue)) { return KeyVaultSecretReferenceSecretInfo.fromJson(readerToUse.reset()); } else if ("keyVaultSecretUri".equals(discriminatorValue)) { return KeyVaultSecretUriSecretInfo.fromJson(readerToUse.reset()); + } else if ("rawValue".equals(discriminatorValue)) { + return ValueSecretInfo.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SecretSourceType.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SecretSourceType.java new file mode 100644 index 000000000000..285b1169082c --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SecretSourceType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of secret source. + */ +public final class SecretSourceType extends ExpandableStringEnum { + /** + * Static value rawValue for SecretSourceType. + */ + public static final SecretSourceType RAW_VALUE = fromString("rawValue"); + + /** + * Static value keyVaultSecret for SecretSourceType. + */ + public static final SecretSourceType KEY_VAULT_SECRET = fromString("keyVaultSecret"); + + /** + * Creates a new instance of SecretSourceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SecretSourceType() { + } + + /** + * Creates or finds a SecretSourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecretSourceType. + */ + public static SecretSourceType fromString(String name) { + return fromString(name, SecretSourceType.class); + } + + /** + * Gets known SecretSourceType values. + * + * @return known SecretSourceType values. + */ + public static Collection values() { + return values(SecretSourceType.class); + } +} 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 199572b80166..b6cdc8246c06 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 @@ -21,6 +21,11 @@ public final class SecretStore implements JsonSerializable { */ private String keyVaultId; + /* + * The key vault secret name to store secret, only valid when storing one secret + */ + private String keyVaultSecretName; + /** * Creates an instance of SecretStore class. */ @@ -47,6 +52,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. * @@ -62,6 +89,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("keyVaultId", this.keyVaultId); + jsonWriter.writeStringField("keyVaultSecretName", this.keyVaultSecretName); return jsonWriter.writeEndObject(); } @@ -82,6 +110,8 @@ public static SecretStore fromJson(JsonReader jsonReader) throws IOException { if ("keyVaultId".equals(fieldName)) { deserializedSecretStore.keyVaultId = reader.getString(); + } else if ("keyVaultSecretName".equals(fieldName)) { + deserializedSecretStore.keyVaultSecretName = reader.getString(); } else { reader.skipChildren(); } 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..685691954b94 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/models/SelfHostedServer.java @@ -0,0 +1,111 @@ +// 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The service properties when target service type is SelfHostedServer. + */ +@Fluent +public final class SelfHostedServer extends TargetServiceBase { + /* + * The target service type. + */ + private TargetServiceType type = TargetServiceType.SELF_HOSTED_SERVER; + + /* + * The endpoint of service. + */ + private String endpoint; + + /** + * Creates an instance of SelfHostedServer class. + */ + public SelfHostedServer() { + } + + /** + * Get the type property: The target service type. + * + * @return the type value. + */ + @Override + public TargetServiceType type() { + return this.type; + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("endpoint", this.endpoint); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SelfHostedServer from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SelfHostedServer if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SelfHostedServer. + */ + public static SelfHostedServer fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SelfHostedServer deserializedSelfHostedServer = new SelfHostedServer(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedSelfHostedServer.type = TargetServiceType.fromString(reader.getString()); + } else if ("endpoint".equals(fieldName)) { + deserializedSelfHostedServer.endpoint = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSelfHostedServer; + }); + } +} 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 3992048b7367..f96ec8ffb446 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 @@ -10,6 +10,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.List; /** * The authentication info when authType is servicePrincipal certificate. @@ -36,6 +37,16 @@ public final class ServicePrincipalCertificateAuthInfo extends AuthInfoBase { */ private String certificate; + /* + * Indicates whether to clean up previous operation when Linker is updating or deleting + */ + private DeleteOrUpdateBehavior deleteOrUpdateBehavior; + + /* + * Optional, this value specifies the Azure roles to be assigned. Automatically + */ + private List roles; + /** * Creates an instance of ServicePrincipalCertificateAuthInfo class. */ @@ -112,6 +123,58 @@ 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ServicePrincipalCertificateAuthInfo withAuthMode(AuthMode authMode) { + super.withAuthMode(authMode); + return this; + } + /** * Validates the instance. * @@ -144,10 +207,14 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("authMode", authMode() == null ? null : authMode().toString()); jsonWriter.writeStringField("clientId", this.clientId); jsonWriter.writeStringField("principalId", this.principalId); jsonWriter.writeStringField("certificate", this.certificate); jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeStringField("deleteOrUpdateBehavior", + this.deleteOrUpdateBehavior == null ? null : this.deleteOrUpdateBehavior.toString()); + jsonWriter.writeArrayField("roles", this.roles, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -168,7 +235,10 @@ public static ServicePrincipalCertificateAuthInfo fromJson(JsonReader jsonReader String fieldName = reader.getFieldName(); reader.nextToken(); - if ("clientId".equals(fieldName)) { + if ("authMode".equals(fieldName)) { + deserializedServicePrincipalCertificateAuthInfo + .withAuthMode(AuthMode.fromString(reader.getString())); + } else if ("clientId".equals(fieldName)) { deserializedServicePrincipalCertificateAuthInfo.clientId = reader.getString(); } else if ("principalId".equals(fieldName)) { deserializedServicePrincipalCertificateAuthInfo.principalId = reader.getString(); @@ -176,6 +246,12 @@ public static ServicePrincipalCertificateAuthInfo fromJson(JsonReader jsonReader deserializedServicePrincipalCertificateAuthInfo.certificate = reader.getString(); } else if ("authType".equals(fieldName)) { deserializedServicePrincipalCertificateAuthInfo.authType = AuthType.fromString(reader.getString()); + } else if ("deleteOrUpdateBehavior".equals(fieldName)) { + deserializedServicePrincipalCertificateAuthInfo.deleteOrUpdateBehavior + = DeleteOrUpdateBehavior.fromString(reader.getString()); + } else if ("roles".equals(fieldName)) { + List roles = reader.readArray(reader1 -> reader1.getString()); + deserializedServicePrincipalCertificateAuthInfo.roles = roles; } else { reader.skipChildren(); } 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 a6da5b5df9c1..160f999f10d2 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 @@ -10,6 +10,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.List; /** * The authentication info when authType is servicePrincipal secret. @@ -21,6 +22,11 @@ public final class ServicePrincipalSecretAuthInfo extends AuthInfoBase { */ private AuthType authType = AuthType.SERVICE_PRINCIPAL_SECRET; + /* + * Username created in the database which is mapped to a user in AAD. + */ + private String username; + /* * ServicePrincipal application clientId for servicePrincipal auth. */ @@ -36,6 +42,16 @@ public final class ServicePrincipalSecretAuthInfo extends AuthInfoBase { */ private String secret; + /* + * Indicates whether to clean up previous operation when Linker is updating or deleting + */ + private DeleteOrUpdateBehavior deleteOrUpdateBehavior; + + /* + * Optional, this value specifies the Azure roles to be assigned. Automatically + */ + private List roles; + /** * Creates an instance of ServicePrincipalSecretAuthInfo class. */ @@ -52,6 +68,26 @@ public AuthType authType() { return this.authType; } + /** + * 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; + } + /** * Get the clientId property: ServicePrincipal application clientId for servicePrincipal auth. * @@ -112,6 +148,57 @@ 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ServicePrincipalSecretAuthInfo withAuthMode(AuthMode authMode) { + super.withAuthMode(authMode); + return this; + } + /** * Validates the instance. * @@ -144,10 +231,15 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("authMode", authMode() == null ? null : authMode().toString()); jsonWriter.writeStringField("clientId", this.clientId); jsonWriter.writeStringField("principalId", this.principalId); jsonWriter.writeStringField("secret", this.secret); jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeStringField("userName", this.username); + jsonWriter.writeStringField("deleteOrUpdateBehavior", + this.deleteOrUpdateBehavior == null ? null : this.deleteOrUpdateBehavior.toString()); + jsonWriter.writeArrayField("roles", this.roles, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -168,7 +260,9 @@ public static ServicePrincipalSecretAuthInfo fromJson(JsonReader jsonReader) thr String fieldName = reader.getFieldName(); reader.nextToken(); - if ("clientId".equals(fieldName)) { + if ("authMode".equals(fieldName)) { + deserializedServicePrincipalSecretAuthInfo.withAuthMode(AuthMode.fromString(reader.getString())); + } else if ("clientId".equals(fieldName)) { deserializedServicePrincipalSecretAuthInfo.clientId = reader.getString(); } else if ("principalId".equals(fieldName)) { deserializedServicePrincipalSecretAuthInfo.principalId = reader.getString(); @@ -176,6 +270,14 @@ public static ServicePrincipalSecretAuthInfo fromJson(JsonReader jsonReader) thr deserializedServicePrincipalSecretAuthInfo.secret = reader.getString(); } else if ("authType".equals(fieldName)) { deserializedServicePrincipalSecretAuthInfo.authType = AuthType.fromString(reader.getString()); + } else if ("userName".equals(fieldName)) { + deserializedServicePrincipalSecretAuthInfo.username = reader.getString(); + } else if ("deleteOrUpdateBehavior".equals(fieldName)) { + deserializedServicePrincipalSecretAuthInfo.deleteOrUpdateBehavior + = DeleteOrUpdateBehavior.fromString(reader.getString()); + } else if ("roles".equals(fieldName)) { + List roles = reader.readArray(reader1 -> reader1.getString()); + deserializedServicePrincipalSecretAuthInfo.roles = roles; } else { reader.skipChildren(); } 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 be4897f999dd..dc8c34d4ccf5 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 @@ -26,6 +26,21 @@ public final class SourceConfiguration implements JsonSerializable roles; + /** * Creates an instance of SystemAssignedIdentityAuthInfo class. */ @@ -36,6 +52,77 @@ public AuthType authType() { return this.authType; } + /** + * 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; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public SystemAssignedIdentityAuthInfo withAuthMode(AuthMode authMode) { + super.withAuthMode(authMode); + return this; + } + /** * Validates the instance. * @@ -51,7 +138,12 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("authMode", authMode() == null ? null : authMode().toString()); jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeStringField("userName", this.username); + jsonWriter.writeStringField("deleteOrUpdateBehavior", + this.deleteOrUpdateBehavior == null ? null : this.deleteOrUpdateBehavior.toString()); + jsonWriter.writeArrayField("roles", this.roles, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -71,8 +163,18 @@ public static SystemAssignedIdentityAuthInfo fromJson(JsonReader jsonReader) thr String fieldName = reader.getFieldName(); reader.nextToken(); - if ("authType".equals(fieldName)) { + if ("authMode".equals(fieldName)) { + deserializedSystemAssignedIdentityAuthInfo.withAuthMode(AuthMode.fromString(reader.getString())); + } else if ("authType".equals(fieldName)) { deserializedSystemAssignedIdentityAuthInfo.authType = AuthType.fromString(reader.getString()); + } else if ("userName".equals(fieldName)) { + deserializedSystemAssignedIdentityAuthInfo.username = reader.getString(); + } else if ("deleteOrUpdateBehavior".equals(fieldName)) { + deserializedSystemAssignedIdentityAuthInfo.deleteOrUpdateBehavior + = DeleteOrUpdateBehavior.fromString(reader.getString()); + } else if ("roles".equals(fieldName)) { + List roles = reader.readArray(reader1 -> reader1.getString()); + deserializedSystemAssignedIdentityAuthInfo.roles = roles; } else { reader.skipChildren(); } 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 f8bb4abed6fd..ad2ddf3a643e 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 @@ -84,6 +84,10 @@ public static TargetServiceBase fromJson(JsonReader jsonReader) throws IOExcepti return ConfluentBootstrapServer.fromJson(readerToUse.reset()); } else if ("ConfluentSchemaRegistry".equals(discriminatorValue)) { return ConfluentSchemaRegistry.fromJson(readerToUse.reset()); + } else if ("FabricPlatform".equals(discriminatorValue)) { + return FabricPlatform.fromJson(readerToUse.reset()); + } else if ("SelfHostedServer".equals(discriminatorValue)) { + return SelfHostedServer.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } 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 39f692761edc..5e7228295c06 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 @@ -26,6 +26,16 @@ public final class TargetServiceType extends ExpandableStringEnum roles; + + /** + * Creates an instance of UserAccountAuthInfo class. + */ + public UserAccountAuthInfo() { + } + + /** + * Get the authType property: The authentication type. + * + * @return the authType value. + */ + @Override + public AuthType authType() { + return this.authType; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public UserAccountAuthInfo withAuthMode(AuthMode authMode) { + super.withAuthMode(authMode); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("authMode", authMode() == null ? null : authMode().toString()); + jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeStringField("userName", this.username); + jsonWriter.writeStringField("principalId", this.principalId); + jsonWriter.writeStringField("deleteOrUpdateBehavior", + this.deleteOrUpdateBehavior == null ? null : this.deleteOrUpdateBehavior.toString()); + jsonWriter.writeArrayField("roles", this.roles, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserAccountAuthInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserAccountAuthInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the UserAccountAuthInfo. + */ + public static UserAccountAuthInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserAccountAuthInfo deserializedUserAccountAuthInfo = new UserAccountAuthInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authMode".equals(fieldName)) { + deserializedUserAccountAuthInfo.withAuthMode(AuthMode.fromString(reader.getString())); + } else if ("authType".equals(fieldName)) { + deserializedUserAccountAuthInfo.authType = AuthType.fromString(reader.getString()); + } else if ("userName".equals(fieldName)) { + deserializedUserAccountAuthInfo.username = reader.getString(); + } else if ("principalId".equals(fieldName)) { + deserializedUserAccountAuthInfo.principalId = reader.getString(); + } else if ("deleteOrUpdateBehavior".equals(fieldName)) { + deserializedUserAccountAuthInfo.deleteOrUpdateBehavior + = DeleteOrUpdateBehavior.fromString(reader.getString()); + } else if ("roles".equals(fieldName)) { + List roles = reader.readArray(reader1 -> reader1.getString()); + deserializedUserAccountAuthInfo.roles = roles; + } else { + reader.skipChildren(); + } + } + + return deserializedUserAccountAuthInfo; + }); + } +} 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 a19a2454085f..759fbda4d57e 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 @@ -9,6 +9,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.List; /** * The authentication info when authType is userAssignedIdentity. @@ -20,6 +21,11 @@ public final class UserAssignedIdentityAuthInfo extends AuthInfoBase { */ private AuthType authType = AuthType.USER_ASSIGNED_IDENTITY; + /* + * Username created in the database which is mapped to a user in AAD. + */ + private String username; + /* * Client Id for userAssignedIdentity. */ @@ -30,6 +36,16 @@ public final class UserAssignedIdentityAuthInfo extends AuthInfoBase { */ private String subscriptionId; + /* + * Indicates whether to clean up previous operation when Linker is updating or deleting + */ + private DeleteOrUpdateBehavior deleteOrUpdateBehavior; + + /* + * Optional, this value specifies the Azure role to be assigned + */ + private List roles; + /** * Creates an instance of UserAssignedIdentityAuthInfo class. */ @@ -46,6 +62,26 @@ public AuthType authType() { return this.authType; } + /** + * 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; + } + /** * Get the clientId property: Client Id for userAssignedIdentity. * @@ -86,6 +122,57 @@ 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; + } + + /** + * {@inheritDoc} + */ + @Override + public UserAssignedIdentityAuthInfo withAuthMode(AuthMode authMode) { + super.withAuthMode(authMode); + return this; + } + /** * Validates the instance. * @@ -101,9 +188,14 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("authMode", authMode() == null ? null : authMode().toString()); jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeStringField("userName", this.username); jsonWriter.writeStringField("clientId", this.clientId); jsonWriter.writeStringField("subscriptionId", this.subscriptionId); + jsonWriter.writeStringField("deleteOrUpdateBehavior", + this.deleteOrUpdateBehavior == null ? null : this.deleteOrUpdateBehavior.toString()); + jsonWriter.writeArrayField("roles", this.roles, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -122,12 +214,22 @@ public static UserAssignedIdentityAuthInfo fromJson(JsonReader jsonReader) throw String fieldName = reader.getFieldName(); reader.nextToken(); - if ("authType".equals(fieldName)) { + if ("authMode".equals(fieldName)) { + deserializedUserAssignedIdentityAuthInfo.withAuthMode(AuthMode.fromString(reader.getString())); + } else if ("authType".equals(fieldName)) { deserializedUserAssignedIdentityAuthInfo.authType = AuthType.fromString(reader.getString()); + } else if ("userName".equals(fieldName)) { + deserializedUserAssignedIdentityAuthInfo.username = reader.getString(); } else if ("clientId".equals(fieldName)) { deserializedUserAssignedIdentityAuthInfo.clientId = reader.getString(); } else if ("subscriptionId".equals(fieldName)) { deserializedUserAssignedIdentityAuthInfo.subscriptionId = reader.getString(); + } else if ("deleteOrUpdateBehavior".equals(fieldName)) { + deserializedUserAssignedIdentityAuthInfo.deleteOrUpdateBehavior + = DeleteOrUpdateBehavior.fromString(reader.getString()); + } else if ("roles".equals(fieldName)) { + List roles = reader.readArray(reader1 -> reader1.getString()); + deserializedUserAssignedIdentityAuthInfo.roles = roles; } else { reader.skipChildren(); } 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 221ded1d55ac..5dd2941c617e 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 @@ -21,6 +21,11 @@ public final class VNetSolution implements JsonSerializable { */ private VNetSolutionType type; + /* + * Indicates whether to clean up previous operation when Linker is updating or deleting + */ + private DeleteOrUpdateBehavior deleteOrUpdateBehavior; + /** * Creates an instance of VNetSolution class. */ @@ -47,6 +52,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. * @@ -62,6 +89,8 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("deleteOrUpdateBehavior", + this.deleteOrUpdateBehavior == null ? null : this.deleteOrUpdateBehavior.toString()); return jsonWriter.writeEndObject(); } @@ -82,6 +111,9 @@ public static VNetSolution fromJson(JsonReader jsonReader) throws IOException { if ("type".equals(fieldName)) { deserializedVNetSolution.type = VNetSolutionType.fromString(reader.getString()); + } else if ("deleteOrUpdateBehavior".equals(fieldName)) { + deserializedVNetSolution.deleteOrUpdateBehavior + = DeleteOrUpdateBehavior.fromString(reader.getString()); } else { reader.skipChildren(); } 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 1e38814da8f5..e4635706f4e9 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 @@ -13,7 +13,7 @@ */ public interface ValidateOperationResult { /** - * Gets the resourceId property: Validated linker id. + * Gets the resourceId property: Validated Linker id. * * @return the resourceId value. */ @@ -55,7 +55,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 3698b0f5682f..5221aa1208b4 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 @@ -12,7 +12,7 @@ import java.io.IOException; /** - * The validation item for a linker. + * The validation item for a Linker. */ @Fluent public final class ValidationResultItem implements JsonSerializable { diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-servicelinker/proxy-config.json b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-servicelinker/proxy-config.json index aad764b06179..7a35b20cd66b 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-servicelinker/proxy-config.json +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-servicelinker/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.servicelinker.implementation.LinkersClientImpl$LinkersService"],["com.azure.resourcemanager.servicelinker.implementation.OperationsClientImpl$OperationsService"]] \ No newline at end of file +[["com.azure.resourcemanager.servicelinker.implementation.ConfigurationNamesOperationsClientImpl$ConfigurationNamesOperationsService"],["com.azure.resourcemanager.servicelinker.implementation.ConnectorsClientImpl$ConnectorsService"],["com.azure.resourcemanager.servicelinker.implementation.LinkersClientImpl$LinkersService"],["com.azure.resourcemanager.servicelinker.implementation.LinkersOperationsClientImpl$LinkersOperationsService"],["com.azure.resourcemanager.servicelinker.implementation.OperationsClientImpl$OperationsService"]] \ No newline at end of file diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/resources/azure-resourcemanager-servicelinker.properties b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/resources/azure-resourcemanager-servicelinker.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/resources/azure-resourcemanager-servicelinker.properties @@ -0,0 +1 @@ +version=${project.version} 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..6e8b69dd2c9f --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConfigurationNamesOperationListSamples.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; + +/** + * Samples for ConfigurationNamesOperation List. + */ +public final class ConfigurationNamesOperationListSamples { + /* + * x-ms-original-file: + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-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, com.azure.core.util.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..a79c2ea15fc9 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorCreateDryrunSamples.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.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/2024-07-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("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..ee43ec10d1c5 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorCreateOrUpdateSamples.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.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/2024-07-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("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..5b19095db3a2 --- /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; + +/** + * Samples for Connector DeleteDryrun. + */ +public final class ConnectorDeleteDryrunSamples { + /* + * x-ms-original-file: + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-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("test-rg", "westus", "dryrunName", com.azure.core.util.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..d70bd59882c3 --- /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; + +/** + * Samples for Connector Delete. + */ +public final class ConnectorDeleteSamples { + /* + * x-ms-original-file: + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-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("test-rg", "westus", "connectorName", com.azure.core.util.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..a61c66b870c7 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorGenerateConfigurationsSamples.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.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/2024-07-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("test-rg", "westus", "connectorName", new ConfigurationInfo() + .withCustomizedKeys(mapOf("ASL_DocumentDb_ConnectionString", "MyConnectionstring")), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @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..961c7240d592 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorGetDryrunSamples.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; + +/** + * Samples for Connector GetDryrun. + */ +public final class ConnectorGetDryrunSamples { + /* + * x-ms-original-file: + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-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("test-rg", "westus", "dryrunName", com.azure.core.util.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..a02ba83cc704 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorGetSamples.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; + +/** + * Samples for Connector Get. + */ +public final class ConnectorGetSamples { + /* + * x-ms-original-file: + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-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("test-rg", "westus", "connectorName", com.azure.core.util.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..25153901b0a1 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorListDryrunSamples.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; + +/** + * Samples for Connector ListDryrun. + */ +public final class ConnectorListDryrunSamples { + /* + * x-ms-original-file: + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-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("test-rg", "westus", com.azure.core.util.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..081d00c3768d --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorListSamples.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; + +/** + * Samples for Connector List. + */ +public final class ConnectorListSamples { + /* + * x-ms-original-file: + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-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("test-rg", "westus", com.azure.core.util.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..3a7348f3f6b2 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorUpdateDryrunSamples.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.generated; + +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/2024-07-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("test-rg", "westus", "dryrunName", com.azure.core.util.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..9c16561276e6 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/ConnectorUpdateSamples.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicelinker.generated; + +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/2024-07-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("test-rg", "westus", "connectorName", com.azure.core.util.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..07c16335c5c9 --- /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; + +/** + * Samples for Connector Validate. + */ +public final class ConnectorValidateSamples { + /* + * x-ms-original-file: + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-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("test-rg", "westus", "connectorName", com.azure.core.util.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 cc99dea175e9..52ab567ae468 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,9 @@ package com.azure.resourcemanager.servicelinker.generated; +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; @@ -18,69 +17,24 @@ public final class LinkerCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/ - * PutLinkWithSecretStore.json + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-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("fakeTokenPlaceholder")) - .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(null, null, + "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)), + com.azure.core.util.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 1f523e4ca51b..dc00faea2cba 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 @@ -10,16 +10,17 @@ public final class LinkerDeleteSamples { /* * x-ms-original-file: - * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/DeleteLink.json + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-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( + .delete(null, null, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", "linkName", com.azure.core.util.Context.NONE); } 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 1c4e2d6a9855..a0b2c2939af2 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 @@ -10,16 +10,17 @@ public final class LinkerGetSamples { /* * x-ms-original-file: - * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/Link.json + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-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( + .getWithResponse(null, null, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", "linkName", com.azure.core.util.Context.NONE); } 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 bb5d2311c925..736194935781 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 @@ -10,8 +10,8 @@ public final class LinkerListConfigurationsSamples { /* * x-ms-original-file: - * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/GetConfigurations - * .json + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/ + * GetConfigurations.json */ /** * Sample code: GetConfiguration. @@ -20,8 +20,8 @@ public final class LinkerListConfigurationsSamples { */ public static void getConfiguration(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { manager.linkers() - .listConfigurationsWithResponse( - "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", + .listConfigurationsWithResponse(null, null, + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.App/containerApps/test-app", "linkName", com.azure.core.util.Context.NONE); } } 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 fd200733894c..7739280c383a 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 @@ -10,16 +10,17 @@ public final class LinkerListSamples { /* * x-ms-original-file: - * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/LinkList.json + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-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( + .list(null, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", com.azure.core.util.Context.NONE); } 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 506b1f6b21ff..82d0b6ee2687 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 @@ -5,7 +5,7 @@ package com.azure.resourcemanager.servicelinker.generated; 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; /** @@ -14,25 +14,24 @@ public final class LinkerUpdateSamples { /* * x-ms-original-file: - * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/PatchLink.json + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-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( + public static void patchLinker(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager.linkers() + .updateWithResponse(null, null, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", - "linkName", com.azure.core.util.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(); + "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")), + com.azure.core.util.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 4616198a331e..edc1ad0fc57e 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 @@ -10,17 +10,17 @@ public final class LinkerValidateSamples { /* * x-ms-original-file: - * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/ - * ValidateLinkSuccess.json + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-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( + .validate(null, null, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", "linkName", com.azure.core.util.Context.NONE); } 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..0debc9ff38c2 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkersOperationCreateDryrunSamples.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.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/2024-07-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(null, null, + "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")))), + com.azure.core.util.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..74ba7c21e277 --- /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; + +/** + * Samples for LinkersOperation DeleteDryrun. + */ +public final class LinkersOperationDeleteDryrunSamples { + /* + * x-ms-original-file: + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-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(null, null, + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", + "dryrunName", com.azure.core.util.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..f3aca3a187ac --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkersOperationGenerateConfigurationsSamples.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.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/2024-07-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(null, null, + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", + "linkName", new ConfigurationInfo().withCustomizedKeys( + mapOf("ASL_DocumentDb_ConnectionString", "MyConnectionstring")), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @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..e59a8f17e442 --- /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; + +/** + * Samples for LinkersOperation GetDryrun. + */ +public final class LinkersOperationGetDryrunSamples { + /* + * x-ms-original-file: + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-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(null, null, + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", + "dryrunName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkersOperationListDaprConfigurationsSamples.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkersOperationListDaprConfigurationsSamples.java new file mode 100644 index 000000000000..8ed6658729b3 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkersOperationListDaprConfigurationsSamples.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; + +/** + * Samples for LinkersOperation ListDaprConfigurations. + */ +public final class LinkersOperationListDaprConfigurationsSamples { + /* + * x-ms-original-file: + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/ + * GetDaprConfigurations.json + */ + /** + * Sample code: GetDaprConfigurations. + * + * @param manager Entry point to ServiceLinkerManager. + */ + public static void getDaprConfigurations(com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager) { + manager.linkersOperations() + .listDaprConfigurations( + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", + com.azure.core.util.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..e5636e47b627 --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkersOperationListDryrunSamples.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; + +/** + * Samples for LinkersOperation ListDryrun. + */ +public final class LinkersOperationListDryrunSamples { + /* + * x-ms-original-file: + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-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(null, + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", + com.azure.core.util.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..8ac7ee721b7f --- /dev/null +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/samples/java/com/azure/resourcemanager/servicelinker/generated/LinkersOperationUpdateDryrunSamples.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.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/2024-07-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(null, null, + "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")))), + com.azure.core.util.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 8091c066e932..7b6704a2e7d0 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 @@ -10,8 +10,8 @@ public final class OperationsListSamples { /* * x-ms-original-file: - * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/OperationsList. - * json + * specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2024-07-01-preview/examples/ + * OperationsList.json */ /** * Sample code: GetConfiguration. diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/AuthInfoBaseTests.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/AuthInfoBaseTests.java deleted file mode 100644 index affcd3c37bbe..000000000000 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/AuthInfoBaseTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.servicelinker.models.AuthInfoBase; - -public final class AuthInfoBaseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AuthInfoBase model = BinaryData.fromString("{\"authType\":\"AuthInfoBase\"}").toObject(AuthInfoBase.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AuthInfoBase model = new AuthInfoBase(); - model = BinaryData.fromObject(model).toObject(AuthInfoBase.class); - } -} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/AzureKeyVaultPropertiesTests.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/AzureKeyVaultPropertiesTests.java deleted file mode 100644 index d2a6ce116642..000000000000 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/AzureKeyVaultPropertiesTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.servicelinker.models.AzureKeyVaultProperties; -import org.junit.jupiter.api.Assertions; - -public final class AzureKeyVaultPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureKeyVaultProperties model - = BinaryData.fromString("{\"type\":\"KeyVault\",\"connectAsKubernetesCsiDriver\":true}") - .toObject(AzureKeyVaultProperties.class); - Assertions.assertEquals(true, model.connectAsKubernetesCsiDriver()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureKeyVaultProperties model = new AzureKeyVaultProperties().withConnectAsKubernetesCsiDriver(true); - model = BinaryData.fromObject(model).toObject(AzureKeyVaultProperties.class); - Assertions.assertEquals(true, model.connectAsKubernetesCsiDriver()); - } -} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/AzureResourcePropertiesBaseTests.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/AzureResourcePropertiesBaseTests.java deleted file mode 100644 index c000c89dd2f8..000000000000 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/AzureResourcePropertiesBaseTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.servicelinker.models.AzureResourcePropertiesBase; - -public final class AzureResourcePropertiesBaseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureResourcePropertiesBase model = BinaryData.fromString("{\"type\":\"AzureResourcePropertiesBase\"}") - .toObject(AzureResourcePropertiesBase.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureResourcePropertiesBase model = new AzureResourcePropertiesBase(); - model = BinaryData.fromObject(model).toObject(AzureResourcePropertiesBase.class); - } -} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/AzureResourceTests.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/AzureResourceTests.java deleted file mode 100644 index c28e7b780ab2..000000000000 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/AzureResourceTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.servicelinker.models.AzureResource; -import com.azure.resourcemanager.servicelinker.models.AzureResourcePropertiesBase; -import org.junit.jupiter.api.Assertions; - -public final class AzureResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureResource model = BinaryData.fromString( - "{\"type\":\"AzureResource\",\"id\":\"lngsntnbybkzgcwr\",\"resourceProperties\":{\"type\":\"AzureResourcePropertiesBase\"}}") - .toObject(AzureResource.class); - Assertions.assertEquals("lngsntnbybkzgcwr", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureResource model - = new AzureResource().withId("lngsntnbybkzgcwr").withResourceProperties(new AzureResourcePropertiesBase()); - model = BinaryData.fromObject(model).toObject(AzureResource.class); - Assertions.assertEquals("lngsntnbybkzgcwr", model.id()); - } -} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/ConfluentBootstrapServerTests.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/ConfluentBootstrapServerTests.java deleted file mode 100644 index a7083ada426d..000000000000 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/ConfluentBootstrapServerTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.servicelinker.models.ConfluentBootstrapServer; -import org.junit.jupiter.api.Assertions; - -public final class ConfluentBootstrapServerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfluentBootstrapServer model - = BinaryData.fromString("{\"type\":\"ConfluentBootstrapServer\",\"endpoint\":\"ayhuy\"}") - .toObject(ConfluentBootstrapServer.class); - Assertions.assertEquals("ayhuy", model.endpoint()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfluentBootstrapServer model = new ConfluentBootstrapServer().withEndpoint("ayhuy"); - model = BinaryData.fromObject(model).toObject(ConfluentBootstrapServer.class); - Assertions.assertEquals("ayhuy", model.endpoint()); - } -} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/ConfluentSchemaRegistryTests.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/ConfluentSchemaRegistryTests.java deleted file mode 100644 index 711b19e350f0..000000000000 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/ConfluentSchemaRegistryTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.servicelinker.models.ConfluentSchemaRegistry; -import org.junit.jupiter.api.Assertions; - -public final class ConfluentSchemaRegistryTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfluentSchemaRegistry model - = BinaryData.fromString("{\"type\":\"ConfluentSchemaRegistry\",\"endpoint\":\"kpode\"}") - .toObject(ConfluentSchemaRegistry.class); - Assertions.assertEquals("kpode", model.endpoint()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfluentSchemaRegistry model = new ConfluentSchemaRegistry().withEndpoint("kpode"); - model = BinaryData.fromObject(model).toObject(ConfluentSchemaRegistry.class); - Assertions.assertEquals("kpode", model.endpoint()); - } -} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/LinkersDeleteMockTests.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/LinkersDeleteMockTests.java deleted file mode 100644 index 0387d1528cf7..000000000000 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/LinkersDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// 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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.servicelinker.ServiceLinkerManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class LinkersDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ServiceLinkerManager manager = ServiceLinkerManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.linkers().delete("mrldhu", "jzzd", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/LinkersListConfigurationsWithResponseMockTests.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/LinkersListConfigurationsWithResponseMockTests.java deleted file mode 100644 index 25f8419b4942..000000000000 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/LinkersListConfigurationsWithResponseMockTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// 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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.servicelinker.ServiceLinkerManager; -import com.azure.resourcemanager.servicelinker.models.SourceConfigurationResult; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class LinkersListConfigurationsWithResponseMockTests { - @Test - public void testListConfigurationsWithResponse() throws Exception { - String responseStr - = "{\"configurations\":[{\"name\":\"dqytbciqfouflmm\",\"value\":\"zsm\"},{\"name\":\"mglougpbkw\",\"value\":\"utduqktapspwgcu\"},{\"name\":\"tumkdosvqwhbm\",\"value\":\"bbjfddgmbmbexp\"},{\"name\":\"htqqrolfp\",\"value\":\"s\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ServiceLinkerManager manager = ServiceLinkerManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SourceConfigurationResult response = manager.linkers() - .listConfigurationsWithResponse("gakeqsr", "yb", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("dqytbciqfouflmm", response.configurations().get(0).name()); - Assertions.assertEquals("zsm", response.configurations().get(0).value()); - } -} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/OperationDisplayTests.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/OperationDisplayTests.java deleted file mode 100644 index 1960f6e7b601..000000000000 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/OperationDisplayTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.servicelinker.models.OperationDisplay; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"gvfcj\",\"resource\":\"zoxxjtf\",\"operation\":\"luwfzitonpeqfpjk\",\"description\":\"xofpdvhpfxxypi\"}") - .toObject(OperationDisplay.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } -} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/OperationInnerTests.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/OperationInnerTests.java deleted file mode 100644 index 2d169bc03e0c..000000000000 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/OperationInnerTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.servicelinker.fluent.models.OperationInner; -import com.azure.resourcemanager.servicelinker.models.OperationDisplay; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = BinaryData.fromString( - "{\"name\":\"ffdfdosygexpa\",\"isDataAction\":true,\"display\":{\"provider\":\"msbzjhcrz\",\"resource\":\"dphlxaolt\",\"operation\":\"trg\",\"description\":\"bpf\"},\"origin\":\"user\",\"actionType\":\"Internal\"}") - .toObject(OperationInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } -} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/OperationListResultTests.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/OperationListResultTests.java deleted file mode 100644 index a62052eae14c..000000000000 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/OperationListResultTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.servicelinker.models.OperationListResult; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"hkryhtn\",\"isDataAction\":true,\"display\":{\"provider\":\"lokjyemkk\",\"resource\":\"ipjoxzjnchgejs\",\"operation\":\"dmailzydehojw\",\"description\":\"huxinpmqnj\"},\"origin\":\"user\",\"actionType\":\"Internal\"},{\"name\":\"sprozvcput\",\"isDataAction\":false,\"display\":{\"provider\":\"mfdatscmdvpj\",\"resource\":\"lsuuvmkjozkrwfnd\",\"operation\":\"djpslw\",\"description\":\"dpvwryoqpsoaccta\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"ahbc\"}") - .toObject(OperationListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - } -} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/OperationsListMockTests.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/OperationsListMockTests.java deleted file mode 100644 index f7c1a15c0fb2..000000000000 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/OperationsListMockTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// 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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.servicelinker.ServiceLinkerManager; -import com.azure.resourcemanager.servicelinker.models.Operation; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"name\":\"cpr\",\"isDataAction\":false,\"display\":{\"provider\":\"gjvtbv\",\"resource\":\"sszdnru\",\"operation\":\"guhmuouqfpr\",\"description\":\"wbnguitnwui\"},\"origin\":\"user\",\"actionType\":\"Internal\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ServiceLinkerManager manager = ServiceLinkerManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/ServicePrincipalCertificateAuthInfoTests.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/ServicePrincipalCertificateAuthInfoTests.java deleted file mode 100644 index 3860a107c556..000000000000 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/ServicePrincipalCertificateAuthInfoTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.servicelinker.models.ServicePrincipalCertificateAuthInfo; -import org.junit.jupiter.api.Assertions; - -public final class ServicePrincipalCertificateAuthInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServicePrincipalCertificateAuthInfo model = BinaryData.fromString( - "{\"authType\":\"servicePrincipalCertificate\",\"clientId\":\"jofxqe\",\"principalId\":\"fjaeq\",\"certificate\":\"hqjbasvmsmj\"}") - .toObject(ServicePrincipalCertificateAuthInfo.class); - Assertions.assertEquals("jofxqe", model.clientId()); - Assertions.assertEquals("fjaeq", model.principalId()); - Assertions.assertEquals("hqjbasvmsmj", model.certificate()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServicePrincipalCertificateAuthInfo model = new ServicePrincipalCertificateAuthInfo().withClientId("jofxqe") - .withPrincipalId("fjaeq") - .withCertificate("hqjbasvmsmj"); - model = BinaryData.fromObject(model).toObject(ServicePrincipalCertificateAuthInfo.class); - Assertions.assertEquals("jofxqe", model.clientId()); - Assertions.assertEquals("fjaeq", model.principalId()); - Assertions.assertEquals("hqjbasvmsmj", model.certificate()); - } -} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/SourceConfigurationResultInnerTests.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/SourceConfigurationResultInnerTests.java deleted file mode 100644 index eaf4de0539df..000000000000 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/SourceConfigurationResultInnerTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.servicelinker.fluent.models.SourceConfigurationResultInner; -import com.azure.resourcemanager.servicelinker.models.SourceConfiguration; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SourceConfigurationResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SourceConfigurationResultInner model - = BinaryData.fromString("{\"configurations\":[{\"name\":\"x\",\"value\":\"ivyqniwbybrkxvd\"}]}") - .toObject(SourceConfigurationResultInner.class); - Assertions.assertEquals("x", model.configurations().get(0).name()); - Assertions.assertEquals("ivyqniwbybrkxvd", model.configurations().get(0).value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SourceConfigurationResultInner model = new SourceConfigurationResultInner() - .withConfigurations(Arrays.asList(new SourceConfiguration().withName("x").withValue("ivyqniwbybrkxvd"))); - model = BinaryData.fromObject(model).toObject(SourceConfigurationResultInner.class); - Assertions.assertEquals("x", model.configurations().get(0).name()); - Assertions.assertEquals("ivyqniwbybrkxvd", model.configurations().get(0).value()); - } -} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/SourceConfigurationTests.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/SourceConfigurationTests.java deleted file mode 100644 index ebab563212d7..000000000000 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/SourceConfigurationTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.servicelinker.models.SourceConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class SourceConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SourceConfiguration model = BinaryData.fromString("{\"name\":\"jgrtfwvukxga\",\"value\":\"ccsnhsjc\"}") - .toObject(SourceConfiguration.class); - Assertions.assertEquals("jgrtfwvukxga", model.name()); - Assertions.assertEquals("ccsnhsjc", model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SourceConfiguration model = new SourceConfiguration().withName("jgrtfwvukxga").withValue("ccsnhsjc"); - model = BinaryData.fromObject(model).toObject(SourceConfiguration.class); - Assertions.assertEquals("jgrtfwvukxga", model.name()); - Assertions.assertEquals("ccsnhsjc", model.value()); - } -} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/SystemAssignedIdentityAuthInfoTests.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/SystemAssignedIdentityAuthInfoTests.java deleted file mode 100644 index e530b1b590bf..000000000000 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/SystemAssignedIdentityAuthInfoTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.servicelinker.models.SystemAssignedIdentityAuthInfo; - -public final class SystemAssignedIdentityAuthInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SystemAssignedIdentityAuthInfo model = BinaryData.fromString("{\"authType\":\"systemAssignedIdentity\"}") - .toObject(SystemAssignedIdentityAuthInfo.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SystemAssignedIdentityAuthInfo model = new SystemAssignedIdentityAuthInfo(); - model = BinaryData.fromObject(model).toObject(SystemAssignedIdentityAuthInfo.class); - } -} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/TargetServiceBaseTests.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/TargetServiceBaseTests.java deleted file mode 100644 index c1ce7310bf72..000000000000 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/TargetServiceBaseTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.servicelinker.models.TargetServiceBase; - -public final class TargetServiceBaseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TargetServiceBase model - = BinaryData.fromString("{\"type\":\"TargetServiceBase\"}").toObject(TargetServiceBase.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TargetServiceBase model = new TargetServiceBase(); - model = BinaryData.fromObject(model).toObject(TargetServiceBase.class); - } -} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/UserAssignedIdentityAuthInfoTests.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/UserAssignedIdentityAuthInfoTests.java deleted file mode 100644 index 3074a0990444..000000000000 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/UserAssignedIdentityAuthInfoTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.servicelinker.models.UserAssignedIdentityAuthInfo; -import org.junit.jupiter.api.Assertions; - -public final class UserAssignedIdentityAuthInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserAssignedIdentityAuthInfo model = BinaryData - .fromString("{\"authType\":\"userAssignedIdentity\",\"clientId\":\"theotusiv\",\"subscriptionId\":\"v\"}") - .toObject(UserAssignedIdentityAuthInfo.class); - Assertions.assertEquals("theotusiv", model.clientId()); - Assertions.assertEquals("v", model.subscriptionId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserAssignedIdentityAuthInfo model - = new UserAssignedIdentityAuthInfo().withClientId("theotusiv").withSubscriptionId("v"); - model = BinaryData.fromObject(model).toObject(UserAssignedIdentityAuthInfo.class); - Assertions.assertEquals("theotusiv", model.clientId()); - Assertions.assertEquals("v", model.subscriptionId()); - } -} diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/VNetSolutionTests.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/VNetSolutionTests.java deleted file mode 100644 index bd3e78fc7d76..000000000000 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/test/java/com/azure/resourcemanager/servicelinker/generated/VNetSolutionTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.servicelinker.models.VNetSolution; -import com.azure.resourcemanager.servicelinker.models.VNetSolutionType; -import org.junit.jupiter.api.Assertions; - -public final class VNetSolutionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VNetSolution model = BinaryData.fromString("{\"type\":\"privateLink\"}").toObject(VNetSolution.class); - Assertions.assertEquals(VNetSolutionType.PRIVATE_LINK, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VNetSolution model = new VNetSolution().withType(VNetSolutionType.PRIVATE_LINK); - model = BinaryData.fromObject(model).toObject(VNetSolution.class); - Assertions.assertEquals(VNetSolutionType.PRIVATE_LINK, model.type()); - } -}