diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/pom.xml b/sdk/cosmos/mgmt-v2020_06_01_preview/pom.xml index 15cf60e245bf9..fe8e8b2e577fa 100644 --- a/sdk/cosmos/mgmt-v2020_06_01_preview/pom.xml +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/pom.xml @@ -11,8 +11,8 @@ com.microsoft.azure azure-arm-parent - 1.3.2 - ../../parents/azure-arm-parent/pom.xml + 1.1.0 + ../../../pom.management.xml azure-mgmt-cosmosdb 1.0.0-beta diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/AzureEntityResource.java b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/AzureEntityResource.java index e0776a9c91325..e8d2b56223920 100644 --- a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/AzureEntityResource.java +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/AzureEntityResource.java @@ -12,7 +12,8 @@ import com.microsoft.azure.ProxyResource; /** - * The resource model definition for a Azure Resource Manager resource with an + * Entity Resource. + * The resource model definition for an Azure Resource Manager resource with an * etag. */ public class AzureEntityResource extends ProxyResource { diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/CorsPolicy.java b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/CorsPolicy.java new file mode 100644 index 0000000000000..950b4e519deb4 --- /dev/null +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/CorsPolicy.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2020_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The CORS policy for the Cosmos DB database account. + */ +public class CorsPolicy { + /** + * The origin domains that are permitted to make a request against the + * service via CORS. + */ + @JsonProperty(value = "allowedOrigins", required = true) + private String allowedOrigins; + + /** + * The methods (HTTP request verbs) that the origin domain may use for a + * CORS request. + */ + @JsonProperty(value = "allowedMethods") + private String allowedMethods; + + /** + * The request headers that the origin domain may specify on the CORS + * request. + */ + @JsonProperty(value = "allowedHeaders") + private String allowedHeaders; + + /** + * The response headers that may be sent in the response to the CORS + * request and exposed by the browser to the request issuer. + */ + @JsonProperty(value = "exposedHeaders") + private String exposedHeaders; + + /** + * The maximum amount time that a browser should cache the preflight + * OPTIONS request. + */ + @JsonProperty(value = "maxAgeInSeconds") + private Long maxAgeInSeconds; + + /** + * Get the origin domains that are permitted to make a request against the service via CORS. + * + * @return the allowedOrigins value + */ + public String allowedOrigins() { + return this.allowedOrigins; + } + + /** + * Set the origin domains that are permitted to make a request against the service via CORS. + * + * @param allowedOrigins the allowedOrigins value to set + * @return the CorsPolicy object itself. + */ + public CorsPolicy withAllowedOrigins(String allowedOrigins) { + this.allowedOrigins = allowedOrigins; + return this; + } + + /** + * Get the methods (HTTP request verbs) that the origin domain may use for a CORS request. + * + * @return the allowedMethods value + */ + public String allowedMethods() { + return this.allowedMethods; + } + + /** + * Set the methods (HTTP request verbs) that the origin domain may use for a CORS request. + * + * @param allowedMethods the allowedMethods value to set + * @return the CorsPolicy object itself. + */ + public CorsPolicy withAllowedMethods(String allowedMethods) { + this.allowedMethods = allowedMethods; + return this; + } + + /** + * Get the request headers that the origin domain may specify on the CORS request. + * + * @return the allowedHeaders value + */ + public String allowedHeaders() { + return this.allowedHeaders; + } + + /** + * Set the request headers that the origin domain may specify on the CORS request. + * + * @param allowedHeaders the allowedHeaders value to set + * @return the CorsPolicy object itself. + */ + public CorsPolicy withAllowedHeaders(String allowedHeaders) { + this.allowedHeaders = allowedHeaders; + return this; + } + + /** + * Get the response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer. + * + * @return the exposedHeaders value + */ + public String exposedHeaders() { + return this.exposedHeaders; + } + + /** + * Set the response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer. + * + * @param exposedHeaders the exposedHeaders value to set + * @return the CorsPolicy object itself. + */ + public CorsPolicy withExposedHeaders(String exposedHeaders) { + this.exposedHeaders = exposedHeaders; + return this; + } + + /** + * Get the maximum amount time that a browser should cache the preflight OPTIONS request. + * + * @return the maxAgeInSeconds value + */ + public Long maxAgeInSeconds() { + return this.maxAgeInSeconds; + } + + /** + * Set the maximum amount time that a browser should cache the preflight OPTIONS request. + * + * @param maxAgeInSeconds the maxAgeInSeconds value to set + * @return the CorsPolicy object itself. + */ + public CorsPolicy withMaxAgeInSeconds(Long maxAgeInSeconds) { + this.maxAgeInSeconds = maxAgeInSeconds; + return this; + } + +} diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/DatabaseAccountCreateUpdateParameters.java b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/DatabaseAccountCreateUpdateParameters.java index a99600e338ac7..747bfaec66cb6 100644 --- a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/DatabaseAccountCreateUpdateParameters.java +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/DatabaseAccountCreateUpdateParameters.java @@ -8,14 +8,11 @@ package com.microsoft.azure.management.cosmosdb.v2020_06_01_preview; -import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; -import com.microsoft.rest.serializer.JsonFlatten; /** * Parameters to create and update Cosmos DB database accounts. */ -@JsonFlatten public class DatabaseAccountCreateUpdateParameters extends ARMResourceProperties { /** * Indicates the type of database account. This can only be set at database @@ -26,127 +23,10 @@ public class DatabaseAccountCreateUpdateParameters extends ARMResourceProperties private DatabaseAccountKind kind; /** - * The consistency policy for the Cosmos DB account. + * The properties property. */ - @JsonProperty(value = "properties.consistencyPolicy") - private ConsistencyPolicy consistencyPolicy; - - /** - * An array that contains the georeplication locations enabled for the - * Cosmos DB account. - */ - @JsonProperty(value = "properties.locations", required = true) - private List locations; - - /** - * The offer type for the database. - */ - @JsonProperty(value = "properties.databaseAccountOfferType", required = true) - private String databaseAccountOfferType; - - /** - * List of IpRules. - */ - @JsonProperty(value = "properties.ipRules") - private List ipRules; - - /** - * Flag to indicate whether to enable/disable Virtual Network ACL rules. - */ - @JsonProperty(value = "properties.isVirtualNetworkFilterEnabled") - private Boolean isVirtualNetworkFilterEnabled; - - /** - * Enables automatic failover of the write region in the rare event that - * the region is unavailable due to an outage. Automatic failover will - * result in a new write region for the account and is chosen based on the - * failover priorities configured for the account. - */ - @JsonProperty(value = "properties.enableAutomaticFailover") - private Boolean enableAutomaticFailover; - - /** - * List of Cosmos DB capabilities for the account. - */ - @JsonProperty(value = "properties.capabilities") - private List capabilities; - - /** - * List of Virtual Network ACL rules configured for the Cosmos DB account. - */ - @JsonProperty(value = "properties.virtualNetworkRules") - private List virtualNetworkRules; - - /** - * Enables the account to write in multiple locations. - */ - @JsonProperty(value = "properties.enableMultipleWriteLocations") - private Boolean enableMultipleWriteLocations; - - /** - * Enables the cassandra connector on the Cosmos DB C* account. - */ - @JsonProperty(value = "properties.enableCassandraConnector") - private Boolean enableCassandraConnector; - - /** - * The cassandra connector offer type for the Cosmos DB database C* - * account. Possible values include: 'Small'. - */ - @JsonProperty(value = "properties.connectorOffer") - private ConnectorOffer connectorOffer; - - /** - * Disable write operations on metadata resources (databases, containers, - * throughput) via account keys. - */ - @JsonProperty(value = "properties.disableKeyBasedMetadataWriteAccess") - private Boolean disableKeyBasedMetadataWriteAccess; - - /** - * The URI of the key vault. - */ - @JsonProperty(value = "properties.keyVaultKeyUri") - private String keyVaultKeyUri; - - /** - * Whether requests from Public Network are allowed. Possible values - * include: 'Enabled', 'Disabled'. - */ - @JsonProperty(value = "properties.publicNetworkAccess") - private PublicNetworkAccess publicNetworkAccess; - - /** - * Flag to indicate whether Free Tier is enabled. - */ - @JsonProperty(value = "properties.enableFreeTier") - private Boolean enableFreeTier; - - /** - * API specific properties. Currently, supported only for MongoDB API. - */ - @JsonProperty(value = "properties.apiProperties") - private ApiProperties apiProperties; - - /** - * Flag to indicate whether to enable storage analytics. - */ - @JsonProperty(value = "properties.enableAnalyticalStorage") - private Boolean enableAnalyticalStorage; - - /** - * The object representing the policy for taking backups on an account. - */ - @JsonProperty(value = "properties.backupPolicy") - private BackupPolicy backupPolicy; - - /** - * Creates an instance of DatabaseAccountCreateUpdateParameters class. - * @param locations an array that contains the georeplication locations enabled for the Cosmos DB account. - */ - public DatabaseAccountCreateUpdateParameters() { - databaseAccountOfferType = "Standard"; - } + @JsonProperty(value = "properties", required = true) + private DatabaseAccountCreateUpdateProperties properties; /** * Get indicates the type of database account. This can only be set at database account creation. Possible values include: 'GlobalDocumentDB', 'MongoDB', 'Parse'. @@ -169,362 +49,22 @@ public DatabaseAccountCreateUpdateParameters withKind(DatabaseAccountKind kind) } /** - * Get the consistency policy for the Cosmos DB account. - * - * @return the consistencyPolicy value - */ - public ConsistencyPolicy consistencyPolicy() { - return this.consistencyPolicy; - } - - /** - * Set the consistency policy for the Cosmos DB account. - * - * @param consistencyPolicy the consistencyPolicy value to set - * @return the DatabaseAccountCreateUpdateParameters object itself. - */ - public DatabaseAccountCreateUpdateParameters withConsistencyPolicy(ConsistencyPolicy consistencyPolicy) { - this.consistencyPolicy = consistencyPolicy; - return this; - } - - /** - * Get an array that contains the georeplication locations enabled for the Cosmos DB account. - * - * @return the locations value - */ - public List locations() { - return this.locations; - } - - /** - * Set an array that contains the georeplication locations enabled for the Cosmos DB account. - * - * @param locations the locations value to set - * @return the DatabaseAccountCreateUpdateParameters object itself. - */ - public DatabaseAccountCreateUpdateParameters withLocations(List locations) { - this.locations = locations; - return this; - } - - /** - * Get the offer type for the database. - * - * @return the databaseAccountOfferType value - */ - public String databaseAccountOfferType() { - return this.databaseAccountOfferType; - } - - /** - * Set the offer type for the database. - * - * @param databaseAccountOfferType the databaseAccountOfferType value to set - * @return the DatabaseAccountCreateUpdateParameters object itself. - */ - public DatabaseAccountCreateUpdateParameters withDatabaseAccountOfferType(String databaseAccountOfferType) { - this.databaseAccountOfferType = databaseAccountOfferType; - return this; - } - - /** - * Get list of IpRules. - * - * @return the ipRules value - */ - public List ipRules() { - return this.ipRules; - } - - /** - * Set list of IpRules. - * - * @param ipRules the ipRules value to set - * @return the DatabaseAccountCreateUpdateParameters object itself. - */ - public DatabaseAccountCreateUpdateParameters withIpRules(List ipRules) { - this.ipRules = ipRules; - return this; - } - - /** - * Get flag to indicate whether to enable/disable Virtual Network ACL rules. - * - * @return the isVirtualNetworkFilterEnabled value - */ - public Boolean isVirtualNetworkFilterEnabled() { - return this.isVirtualNetworkFilterEnabled; - } - - /** - * Set flag to indicate whether to enable/disable Virtual Network ACL rules. - * - * @param isVirtualNetworkFilterEnabled the isVirtualNetworkFilterEnabled value to set - * @return the DatabaseAccountCreateUpdateParameters object itself. - */ - public DatabaseAccountCreateUpdateParameters withIsVirtualNetworkFilterEnabled(Boolean isVirtualNetworkFilterEnabled) { - this.isVirtualNetworkFilterEnabled = isVirtualNetworkFilterEnabled; - return this; - } - - /** - * Get enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the failover priorities configured for the account. - * - * @return the enableAutomaticFailover value - */ - public Boolean enableAutomaticFailover() { - return this.enableAutomaticFailover; - } - - /** - * Set enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the failover priorities configured for the account. - * - * @param enableAutomaticFailover the enableAutomaticFailover value to set - * @return the DatabaseAccountCreateUpdateParameters object itself. - */ - public DatabaseAccountCreateUpdateParameters withEnableAutomaticFailover(Boolean enableAutomaticFailover) { - this.enableAutomaticFailover = enableAutomaticFailover; - return this; - } - - /** - * Get list of Cosmos DB capabilities for the account. - * - * @return the capabilities value - */ - public List capabilities() { - return this.capabilities; - } - - /** - * Set list of Cosmos DB capabilities for the account. - * - * @param capabilities the capabilities value to set - * @return the DatabaseAccountCreateUpdateParameters object itself. - */ - public DatabaseAccountCreateUpdateParameters withCapabilities(List capabilities) { - this.capabilities = capabilities; - return this; - } - - /** - * Get list of Virtual Network ACL rules configured for the Cosmos DB account. - * - * @return the virtualNetworkRules value - */ - public List virtualNetworkRules() { - return this.virtualNetworkRules; - } - - /** - * Set list of Virtual Network ACL rules configured for the Cosmos DB account. - * - * @param virtualNetworkRules the virtualNetworkRules value to set - * @return the DatabaseAccountCreateUpdateParameters object itself. - */ - public DatabaseAccountCreateUpdateParameters withVirtualNetworkRules(List virtualNetworkRules) { - this.virtualNetworkRules = virtualNetworkRules; - return this; - } - - /** - * Get enables the account to write in multiple locations. - * - * @return the enableMultipleWriteLocations value - */ - public Boolean enableMultipleWriteLocations() { - return this.enableMultipleWriteLocations; - } - - /** - * Set enables the account to write in multiple locations. - * - * @param enableMultipleWriteLocations the enableMultipleWriteLocations value to set - * @return the DatabaseAccountCreateUpdateParameters object itself. - */ - public DatabaseAccountCreateUpdateParameters withEnableMultipleWriteLocations(Boolean enableMultipleWriteLocations) { - this.enableMultipleWriteLocations = enableMultipleWriteLocations; - return this; - } - - /** - * Get enables the cassandra connector on the Cosmos DB C* account. - * - * @return the enableCassandraConnector value - */ - public Boolean enableCassandraConnector() { - return this.enableCassandraConnector; - } - - /** - * Set enables the cassandra connector on the Cosmos DB C* account. - * - * @param enableCassandraConnector the enableCassandraConnector value to set - * @return the DatabaseAccountCreateUpdateParameters object itself. - */ - public DatabaseAccountCreateUpdateParameters withEnableCassandraConnector(Boolean enableCassandraConnector) { - this.enableCassandraConnector = enableCassandraConnector; - return this; - } - - /** - * Get the cassandra connector offer type for the Cosmos DB database C* account. Possible values include: 'Small'. - * - * @return the connectorOffer value - */ - public ConnectorOffer connectorOffer() { - return this.connectorOffer; - } - - /** - * Set the cassandra connector offer type for the Cosmos DB database C* account. Possible values include: 'Small'. - * - * @param connectorOffer the connectorOffer value to set - * @return the DatabaseAccountCreateUpdateParameters object itself. - */ - public DatabaseAccountCreateUpdateParameters withConnectorOffer(ConnectorOffer connectorOffer) { - this.connectorOffer = connectorOffer; - return this; - } - - /** - * Get disable write operations on metadata resources (databases, containers, throughput) via account keys. - * - * @return the disableKeyBasedMetadataWriteAccess value - */ - public Boolean disableKeyBasedMetadataWriteAccess() { - return this.disableKeyBasedMetadataWriteAccess; - } - - /** - * Set disable write operations on metadata resources (databases, containers, throughput) via account keys. - * - * @param disableKeyBasedMetadataWriteAccess the disableKeyBasedMetadataWriteAccess value to set - * @return the DatabaseAccountCreateUpdateParameters object itself. - */ - public DatabaseAccountCreateUpdateParameters withDisableKeyBasedMetadataWriteAccess(Boolean disableKeyBasedMetadataWriteAccess) { - this.disableKeyBasedMetadataWriteAccess = disableKeyBasedMetadataWriteAccess; - return this; - } - - /** - * Get the URI of the key vault. - * - * @return the keyVaultKeyUri value - */ - public String keyVaultKeyUri() { - return this.keyVaultKeyUri; - } - - /** - * Set the URI of the key vault. - * - * @param keyVaultKeyUri the keyVaultKeyUri value to set - * @return the DatabaseAccountCreateUpdateParameters object itself. - */ - public DatabaseAccountCreateUpdateParameters withKeyVaultKeyUri(String keyVaultKeyUri) { - this.keyVaultKeyUri = keyVaultKeyUri; - return this; - } - - /** - * Get whether requests from Public Network are allowed. Possible values include: 'Enabled', 'Disabled'. - * - * @return the publicNetworkAccess value - */ - public PublicNetworkAccess publicNetworkAccess() { - return this.publicNetworkAccess; - } - - /** - * Set whether requests from Public Network are allowed. Possible values include: 'Enabled', 'Disabled'. - * - * @param publicNetworkAccess the publicNetworkAccess value to set - * @return the DatabaseAccountCreateUpdateParameters object itself. - */ - public DatabaseAccountCreateUpdateParameters withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { - this.publicNetworkAccess = publicNetworkAccess; - return this; - } - - /** - * Get flag to indicate whether Free Tier is enabled. - * - * @return the enableFreeTier value - */ - public Boolean enableFreeTier() { - return this.enableFreeTier; - } - - /** - * Set flag to indicate whether Free Tier is enabled. - * - * @param enableFreeTier the enableFreeTier value to set - * @return the DatabaseAccountCreateUpdateParameters object itself. - */ - public DatabaseAccountCreateUpdateParameters withEnableFreeTier(Boolean enableFreeTier) { - this.enableFreeTier = enableFreeTier; - return this; - } - - /** - * Get aPI specific properties. Currently, supported only for MongoDB API. - * - * @return the apiProperties value - */ - public ApiProperties apiProperties() { - return this.apiProperties; - } - - /** - * Set aPI specific properties. Currently, supported only for MongoDB API. - * - * @param apiProperties the apiProperties value to set - * @return the DatabaseAccountCreateUpdateParameters object itself. - */ - public DatabaseAccountCreateUpdateParameters withApiProperties(ApiProperties apiProperties) { - this.apiProperties = apiProperties; - return this; - } - - /** - * Get flag to indicate whether to enable storage analytics. - * - * @return the enableAnalyticalStorage value - */ - public Boolean enableAnalyticalStorage() { - return this.enableAnalyticalStorage; - } - - /** - * Set flag to indicate whether to enable storage analytics. - * - * @param enableAnalyticalStorage the enableAnalyticalStorage value to set - * @return the DatabaseAccountCreateUpdateParameters object itself. - */ - public DatabaseAccountCreateUpdateParameters withEnableAnalyticalStorage(Boolean enableAnalyticalStorage) { - this.enableAnalyticalStorage = enableAnalyticalStorage; - return this; - } - - /** - * Get the object representing the policy for taking backups on an account. + * Get the properties value. * - * @return the backupPolicy value + * @return the properties value */ - public BackupPolicy backupPolicy() { - return this.backupPolicy; + public DatabaseAccountCreateUpdateProperties properties() { + return this.properties; } /** - * Set the object representing the policy for taking backups on an account. + * Set the properties value. * - * @param backupPolicy the backupPolicy value to set + * @param properties the properties value to set * @return the DatabaseAccountCreateUpdateParameters object itself. */ - public DatabaseAccountCreateUpdateParameters withBackupPolicy(BackupPolicy backupPolicy) { - this.backupPolicy = backupPolicy; + public DatabaseAccountCreateUpdateParameters withProperties(DatabaseAccountCreateUpdateProperties properties) { + this.properties = properties; return this; } diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/DatabaseAccountCreateUpdateProperties.java b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/DatabaseAccountCreateUpdateProperties.java index 02b163b9e44bf..0f766a9206a59 100644 --- a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/DatabaseAccountCreateUpdateProperties.java +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/DatabaseAccountCreateUpdateProperties.java @@ -139,6 +139,12 @@ public class DatabaseAccountCreateUpdateProperties { @JsonProperty(value = "backupPolicy") private BackupPolicy backupPolicy; + /** + * The CORS policy for the Cosmos DB database account. + */ + @JsonProperty(value = "cors") + private List cors; + /** * Creates an instance of DatabaseAccountCreateUpdateProperties class. * @param locations an array that contains the georeplication locations enabled for the Cosmos DB account. @@ -507,4 +513,24 @@ public DatabaseAccountCreateUpdateProperties withBackupPolicy(BackupPolicy backu return this; } + /** + * Get the CORS policy for the Cosmos DB database account. + * + * @return the cors value + */ + public List cors() { + return this.cors; + } + + /** + * Set the CORS policy for the Cosmos DB database account. + * + * @param cors the cors value to set + * @return the DatabaseAccountCreateUpdateProperties object itself. + */ + public DatabaseAccountCreateUpdateProperties withCors(List cors) { + this.cors = cors; + return this; + } + } diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/DatabaseAccountGetResults.java b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/DatabaseAccountGetResults.java index afe131f450fa2..ade37d355b88c 100644 --- a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/DatabaseAccountGetResults.java +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/DatabaseAccountGetResults.java @@ -50,6 +50,11 @@ public interface DatabaseAccountGetResults extends HasInner cors(); + /** * @return the createMode value. */ @@ -178,7 +183,7 @@ public interface DatabaseAccountGetResults extends HasInner { /** * The stage of the DatabaseAccountGetResults definition allowing to specify the resource group. */ - interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { - } - - /** - * The stage of the databaseaccountgetresults definition allowing to specify DatabaseAccountOfferType. - */ - interface WithDatabaseAccountOfferType { - /** - * Specifies databaseAccountOfferType. - * @param databaseAccountOfferType The offer type for the database - * @return the next definition stage -*/ - WithLocations withDatabaseAccountOfferType(String databaseAccountOfferType); + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { } /** - * The stage of the databaseaccountgetresults definition allowing to specify Locations. + * The stage of the databaseaccountgetresults definition allowing to specify Properties. */ - interface WithLocations { + interface WithProperties { /** - * Specifies locations. - * @param locations An array that contains the georeplication locations enabled for the Cosmos DB account + * Specifies properties. + * @param properties the properties parameter value * @return the next definition stage */ - WithCreate withLocations(List locations); - } - - /** - * The stage of the databaseaccountgetresults definition allowing to specify ApiProperties. - */ - interface WithApiProperties { - /** - * Specifies apiProperties. - * @param apiProperties API specific properties. Currently, supported only for MongoDB API - * @return the next definition stage - */ - WithCreate withApiProperties(ApiProperties apiProperties); - } - - /** - * The stage of the databaseaccountgetresults definition allowing to specify BackupPolicy. - */ - interface WithBackupPolicy { - /** - * Specifies backupPolicy. - * @param backupPolicy The object representing the policy for taking backups on an account - * @return the next definition stage - */ - WithCreate withBackupPolicy(BackupPolicy backupPolicy); - } - - /** - * The stage of the databaseaccountgetresults definition allowing to specify Capabilities. - */ - interface WithCapabilities { - /** - * Specifies capabilities. - * @param capabilities List of Cosmos DB capabilities for the account - * @return the next definition stage - */ - WithCreate withCapabilities(List capabilities); - } - - /** - * The stage of the databaseaccountgetresults definition allowing to specify ConnectorOffer. - */ - interface WithConnectorOffer { - /** - * Specifies connectorOffer. - * @param connectorOffer The cassandra connector offer type for the Cosmos DB database C* account. Possible values include: 'Small' - * @return the next definition stage - */ - WithCreate withConnectorOffer(ConnectorOffer connectorOffer); - } - - /** - * The stage of the databaseaccountgetresults definition allowing to specify ConsistencyPolicy. - */ - interface WithConsistencyPolicy { - /** - * Specifies consistencyPolicy. - * @param consistencyPolicy The consistency policy for the Cosmos DB account - * @return the next definition stage - */ - WithCreate withConsistencyPolicy(ConsistencyPolicy consistencyPolicy); - } - - /** - * The stage of the databaseaccountgetresults definition allowing to specify DisableKeyBasedMetadataWriteAccess. - */ - interface WithDisableKeyBasedMetadataWriteAccess { - /** - * Specifies disableKeyBasedMetadataWriteAccess. - * @param disableKeyBasedMetadataWriteAccess Disable write operations on metadata resources (databases, containers, throughput) via account keys - * @return the next definition stage - */ - WithCreate withDisableKeyBasedMetadataWriteAccess(Boolean disableKeyBasedMetadataWriteAccess); - } - - /** - * The stage of the databaseaccountgetresults definition allowing to specify EnableAnalyticalStorage. - */ - interface WithEnableAnalyticalStorage { - /** - * Specifies enableAnalyticalStorage. - * @param enableAnalyticalStorage Flag to indicate whether to enable storage analytics - * @return the next definition stage - */ - WithCreate withEnableAnalyticalStorage(Boolean enableAnalyticalStorage); - } - - /** - * The stage of the databaseaccountgetresults definition allowing to specify EnableAutomaticFailover. - */ - interface WithEnableAutomaticFailover { - /** - * Specifies enableAutomaticFailover. - * @param enableAutomaticFailover Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the failover priorities configured for the account - * @return the next definition stage - */ - WithCreate withEnableAutomaticFailover(Boolean enableAutomaticFailover); - } - - /** - * The stage of the databaseaccountgetresults definition allowing to specify EnableCassandraConnector. - */ - interface WithEnableCassandraConnector { - /** - * Specifies enableCassandraConnector. - * @param enableCassandraConnector Enables the cassandra connector on the Cosmos DB C* account - * @return the next definition stage - */ - WithCreate withEnableCassandraConnector(Boolean enableCassandraConnector); - } - - /** - * The stage of the databaseaccountgetresults definition allowing to specify EnableFreeTier. - */ - interface WithEnableFreeTier { - /** - * Specifies enableFreeTier. - * @param enableFreeTier Flag to indicate whether Free Tier is enabled - * @return the next definition stage - */ - WithCreate withEnableFreeTier(Boolean enableFreeTier); - } - - /** - * The stage of the databaseaccountgetresults definition allowing to specify EnableMultipleWriteLocations. - */ - interface WithEnableMultipleWriteLocations { - /** - * Specifies enableMultipleWriteLocations. - * @param enableMultipleWriteLocations Enables the account to write in multiple locations - * @return the next definition stage - */ - WithCreate withEnableMultipleWriteLocations(Boolean enableMultipleWriteLocations); + WithCreate withProperties(DatabaseAccountCreateUpdateProperties properties); } /** @@ -365,42 +226,6 @@ interface WithIdentity { WithCreate withIdentity(ManagedServiceIdentity identity); } - /** - * The stage of the databaseaccountgetresults definition allowing to specify IpRules. - */ - interface WithIpRules { - /** - * Specifies ipRules. - * @param ipRules List of IpRules - * @return the next definition stage - */ - WithCreate withIpRules(List ipRules); - } - - /** - * The stage of the databaseaccountgetresults definition allowing to specify IsVirtualNetworkFilterEnabled. - */ - interface WithIsVirtualNetworkFilterEnabled { - /** - * Specifies isVirtualNetworkFilterEnabled. - * @param isVirtualNetworkFilterEnabled Flag to indicate whether to enable/disable Virtual Network ACL rules - * @return the next definition stage - */ - WithCreate withIsVirtualNetworkFilterEnabled(Boolean isVirtualNetworkFilterEnabled); - } - - /** - * The stage of the databaseaccountgetresults definition allowing to specify KeyVaultKeyUri. - */ - interface WithKeyVaultKeyUri { - /** - * Specifies keyVaultKeyUri. - * @param keyVaultKeyUri The URI of the key vault - * @return the next definition stage - */ - WithCreate withKeyVaultKeyUri(String keyVaultKeyUri); - } - /** * The stage of the databaseaccountgetresults definition allowing to specify Kind. */ @@ -413,42 +238,18 @@ interface WithKind { WithCreate withKind(DatabaseAccountKind kind); } - /** - * The stage of the databaseaccountgetresults definition allowing to specify PublicNetworkAccess. - */ - interface WithPublicNetworkAccess { - /** - * Specifies publicNetworkAccess. - * @param publicNetworkAccess Whether requests from Public Network are allowed. Possible values include: 'Enabled', 'Disabled' - * @return the next definition stage - */ - WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); - } - - /** - * The stage of the databaseaccountgetresults definition allowing to specify VirtualNetworkRules. - */ - interface WithVirtualNetworkRules { - /** - * Specifies virtualNetworkRules. - * @param virtualNetworkRules List of Virtual Network ACL rules configured for the Cosmos DB account - * @return the next definition stage - */ - WithCreate withVirtualNetworkRules(List virtualNetworkRules); - } - /** * The stage of the definition which contains all the minimum required inputs for * the resource to be created (via {@link WithCreate#create()}), but also allows * for any other optional settings to be specified. */ - interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithApiProperties, DefinitionStages.WithBackupPolicy, DefinitionStages.WithCapabilities, DefinitionStages.WithConnectorOffer, DefinitionStages.WithConsistencyPolicy, DefinitionStages.WithDisableKeyBasedMetadataWriteAccess, DefinitionStages.WithEnableAnalyticalStorage, DefinitionStages.WithEnableAutomaticFailover, DefinitionStages.WithEnableCassandraConnector, DefinitionStages.WithEnableFreeTier, DefinitionStages.WithEnableMultipleWriteLocations, DefinitionStages.WithIdentity, DefinitionStages.WithIpRules, DefinitionStages.WithIsVirtualNetworkFilterEnabled, DefinitionStages.WithKeyVaultKeyUri, DefinitionStages.WithKind, DefinitionStages.WithPublicNetworkAccess, DefinitionStages.WithVirtualNetworkRules { + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithIdentity, DefinitionStages.WithKind { } } /** * The template for a DatabaseAccountGetResults update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithApiProperties, UpdateStages.WithBackupPolicy, UpdateStages.WithCapabilities, UpdateStages.WithConnectorOffer, UpdateStages.WithConsistencyPolicy, UpdateStages.WithDisableKeyBasedMetadataWriteAccess, UpdateStages.WithEnableAnalyticalStorage, UpdateStages.WithEnableAutomaticFailover, UpdateStages.WithEnableCassandraConnector, UpdateStages.WithEnableFreeTier, UpdateStages.WithEnableMultipleWriteLocations, UpdateStages.WithIpRules, UpdateStages.WithIsVirtualNetworkFilterEnabled, UpdateStages.WithKeyVaultKeyUri, UpdateStages.WithLocations, UpdateStages.WithPublicNetworkAccess, UpdateStages.WithVirtualNetworkRules { + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithApiProperties, UpdateStages.WithBackupPolicy, UpdateStages.WithCapabilities, UpdateStages.WithConnectorOffer, UpdateStages.WithConsistencyPolicy, UpdateStages.WithCors, UpdateStages.WithDisableKeyBasedMetadataWriteAccess, UpdateStages.WithEnableAnalyticalStorage, UpdateStages.WithEnableAutomaticFailover, UpdateStages.WithEnableCassandraConnector, UpdateStages.WithEnableFreeTier, UpdateStages.WithEnableMultipleWriteLocations, UpdateStages.WithIdentity, UpdateStages.WithIpRules, UpdateStages.WithIsVirtualNetworkFilterEnabled, UpdateStages.WithKeyVaultKeyUri, UpdateStages.WithLocations, UpdateStages.WithPublicNetworkAccess, UpdateStages.WithVirtualNetworkRules { } /** @@ -515,6 +316,18 @@ interface WithConsistencyPolicy { Update withConsistencyPolicy(ConsistencyPolicy consistencyPolicy); } + /** + * The stage of the databaseaccountgetresults update allowing to specify Cors. + */ + interface WithCors { + /** + * Specifies cors. + * @param cors The CORS policy for the Cosmos DB database account + * @return the next update stage + */ + Update withCors(List cors); + } + /** * The stage of the databaseaccountgetresults update allowing to specify DisableKeyBasedMetadataWriteAccess. */ @@ -587,6 +400,18 @@ interface WithEnableMultipleWriteLocations { Update withEnableMultipleWriteLocations(Boolean enableMultipleWriteLocations); } + /** + * The stage of the databaseaccountgetresults update allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity the identity parameter value + * @return the next update stage + */ + Update withIdentity(ManagedServiceIdentity identity); + } + /** * The stage of the databaseaccountgetresults update allowing to specify IpRules. */ diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/DatabaseAccountUpdateParameters.java b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/DatabaseAccountUpdateParameters.java index 6209fe30a6284..db2c820826bdc 100644 --- a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/DatabaseAccountUpdateParameters.java +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/DatabaseAccountUpdateParameters.java @@ -139,6 +139,18 @@ public class DatabaseAccountUpdateParameters { @JsonProperty(value = "properties.backupPolicy") private BackupPolicy backupPolicy; + /** + * The CORS policy for the Cosmos DB database account. + */ + @JsonProperty(value = "properties.cors") + private List cors; + + /** + * The identity property. + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + /** * Get the tags value. * @@ -519,4 +531,44 @@ public DatabaseAccountUpdateParameters withBackupPolicy(BackupPolicy backupPolic return this; } + /** + * Get the CORS policy for the Cosmos DB database account. + * + * @return the cors value + */ + public List cors() { + return this.cors; + } + + /** + * Set the CORS policy for the Cosmos DB database account. + * + * @param cors the cors value to set + * @return the DatabaseAccountUpdateParameters object itself. + */ + public DatabaseAccountUpdateParameters withCors(List cors) { + this.cors = cors; + return this; + } + + /** + * Get the identity value. + * + * @return the identity value + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity value. + * + * @param identity the identity value to set + * @return the DatabaseAccountUpdateParameters object itself. + */ + public DatabaseAccountUpdateParameters withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + } diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/DefaultErrorResponse.java b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/DefaultErrorResponse.java new file mode 100644 index 0000000000000..40e1689d8f451 --- /dev/null +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/DefaultErrorResponse.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2020_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An error response from the service. + */ +public class DefaultErrorResponse { + /** + * The error property. + */ + @JsonProperty(value = "error") + private ErrorResponse error; + + /** + * Get the error value. + * + * @return the error value + */ + public ErrorResponse error() { + return this.error; + } + + /** + * Set the error value. + * + * @param error the error value to set + * @return the DefaultErrorResponse object itself. + */ + public DefaultErrorResponse withError(ErrorResponse error) { + this.error = error; + return this; + } + +} diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/DefaultErrorResponseException.java b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/DefaultErrorResponseException.java new file mode 100644 index 0000000000000..b5b9a30e41486 --- /dev/null +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/DefaultErrorResponseException.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2020_06_01_preview; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with DefaultErrorResponse + * information. + */ +public class DefaultErrorResponseException extends RestException { + /** + * Initializes a new instance of the DefaultErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public DefaultErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the DefaultErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public DefaultErrorResponseException(final String message, final Response response, final DefaultErrorResponse body) { + super(message, response, body); + } + + @Override + public DefaultErrorResponse body() { + return (DefaultErrorResponse) super.body(); + } +} diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/ManagedServiceIdentity.java b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/ManagedServiceIdentity.java index aa5d54598137a..8e06ed0a185ea 100644 --- a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/ManagedServiceIdentity.java +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/ManagedServiceIdentity.java @@ -8,6 +8,7 @@ package com.microsoft.azure.management.cosmosdb.v2020_06_01_preview; +import java.util.Map; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -29,15 +30,23 @@ public class ManagedServiceIdentity { private String tenantId; /** - * The type of identity used for the resource. The type 'SystemAssigned, - * UserAssigned' includes both an implicitly created identity and a set of - * user assigned identities. The type 'None' will remove any identities - * from the service. Possible values include: 'SystemAssigned', - * 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'. + * The type of identity used for the resource. The type + * 'SystemAssigned,UserAssigned' includes both an implicitly created + * identity and a set of user assigned identities. The type 'None' will + * remove any identities from the service. Possible values include: + * 'SystemAssigned', 'UserAssigned', 'SystemAssigned,UserAssigned', 'None'. */ @JsonProperty(value = "type") private ResourceIdentityType type; + /** + * The list of user identities associated with resource. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + */ + @JsonProperty(value = "userAssignedIdentities") + private Map userAssignedIdentities; + /** * Get the principal id of the system assigned identity. This property will only be provided for a system assigned identity. * @@ -57,7 +66,7 @@ public String tenantId() { } /** - * Get the type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'. + * Get the type of identity used for the resource. The type 'SystemAssigned,UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned,UserAssigned', 'None'. * * @return the type value */ @@ -66,7 +75,7 @@ public ResourceIdentityType type() { } /** - * Set the type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'. + * Set the type of identity used for the resource. The type 'SystemAssigned,UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned,UserAssigned', 'None'. * * @param type the type value to set * @return the ManagedServiceIdentity object itself. @@ -76,4 +85,24 @@ public ManagedServiceIdentity withType(ResourceIdentityType type) { return this; } + /** + * Get the list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @return the userAssignedIdentities value + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @param userAssignedIdentities the userAssignedIdentities value to set + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + } diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/ManagedServiceIdentityUserAssignedIdentitiesValue.java b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/ManagedServiceIdentityUserAssignedIdentitiesValue.java new file mode 100644 index 0000000000000..fa6c63627e7d3 --- /dev/null +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/ManagedServiceIdentityUserAssignedIdentitiesValue.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2020_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ManagedServiceIdentityUserAssignedIdentitiesValue model. + */ +public class ManagedServiceIdentityUserAssignedIdentitiesValue { + /** + * The principal id of user assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /** + * The client id of user assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private String clientId; + + /** + * Get the principal id of user assigned identity. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the client id of user assigned identity. + * + * @return the clientId value + */ + public String clientId() { + return this.clientId; + } + +} diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/Permission.java b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/Permission.java new file mode 100644 index 0000000000000..7ae2b29031416 --- /dev/null +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/Permission.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2020_06_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The set of data plane operations permitted through this Role Definition. + */ +public class Permission { + /** + * An array of data actions that are allowed. + */ + @JsonProperty(value = "dataActions") + private List dataActions; + + /** + * An array of data actions that are denied. + */ + @JsonProperty(value = "notDataActions") + private List notDataActions; + + /** + * Get an array of data actions that are allowed. + * + * @return the dataActions value + */ + public List dataActions() { + return this.dataActions; + } + + /** + * Set an array of data actions that are allowed. + * + * @param dataActions the dataActions value to set + * @return the Permission object itself. + */ + public Permission withDataActions(List dataActions) { + this.dataActions = dataActions; + return this; + } + + /** + * Get an array of data actions that are denied. + * + * @return the notDataActions value + */ + public List notDataActions() { + return this.notDataActions; + } + + /** + * Set an array of data actions that are denied. + * + * @param notDataActions the notDataActions value to set + * @return the Permission object itself. + */ + public Permission withNotDataActions(List notDataActions) { + this.notDataActions = notDataActions; + return this; + } + +} diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/ResourceIdentityType.java b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/ResourceIdentityType.java index bb046b409983f..000f8d68b83fc 100644 --- a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/ResourceIdentityType.java +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/ResourceIdentityType.java @@ -21,8 +21,8 @@ public enum ResourceIdentityType { /** Enum value UserAssigned. */ USER_ASSIGNED("UserAssigned"), - /** Enum value SystemAssigned, UserAssigned. */ - SYSTEM_ASSIGNED_USER_ASSIGNED("SystemAssigned, UserAssigned"), + /** Enum value SystemAssigned,UserAssigned. */ + SYSTEM_ASSIGNED_USER_ASSIGNED("SystemAssigned,UserAssigned"), /** Enum value None. */ NONE("None"); diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/RestoreParameters.java b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/RestoreParameters.java index b9f0958ed6b49..71c231fa057e1 100644 --- a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/RestoreParameters.java +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/RestoreParameters.java @@ -24,7 +24,9 @@ public class RestoreParameters { private RestoreMode restoreMode; /** - * Path of the source account from which the restore has to be initiated. + * The id of the restorable database account from which the restore has to + * be initiated. For example: + * /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}. */ @JsonProperty(value = "restoreSource") private String restoreSource; @@ -62,7 +64,7 @@ public RestoreParameters withRestoreMode(RestoreMode restoreMode) { } /** - * Get path of the source account from which the restore has to be initiated. + * Get the id of the restorable database account from which the restore has to be initiated. For example: /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}. * * @return the restoreSource value */ @@ -71,7 +73,7 @@ public String restoreSource() { } /** - * Set path of the source account from which the restore has to be initiated. + * Set the id of the restorable database account from which the restore has to be initiated. For example: /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}. * * @param restoreSource the restoreSource value to set * @return the RestoreParameters object itself. diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/RoleDefinitionType.java b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/RoleDefinitionType.java new file mode 100644 index 0000000000000..0d4090f1cc12c --- /dev/null +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/RoleDefinitionType.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2020_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for RoleDefinitionType. + */ +public enum RoleDefinitionType { + /** Enum value BuiltInRole. */ + BUILT_IN_ROLE("BuiltInRole"), + + /** Enum value CustomRole. */ + CUSTOM_ROLE("CustomRole"); + + /** The actual serialized value for a RoleDefinitionType instance. */ + private String value; + + RoleDefinitionType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a RoleDefinitionType instance. + * + * @param value the serialized value to parse. + * @return the parsed RoleDefinitionType object, or null if unable to parse. + */ + @JsonCreator + public static RoleDefinitionType fromString(String value) { + RoleDefinitionType[] items = RoleDefinitionType.values(); + for (RoleDefinitionType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/SqlResources.java b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/SqlResources.java index 1679bfe5a0db7..818b68d85fdd9 100644 --- a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/SqlResources.java +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/SqlResources.java @@ -15,6 +15,8 @@ import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SqlStoredProcedureGetResults; import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SqlUserDefinedFunctionGetResults; import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SqlTriggerGetResults; +import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SqlRoleDefinitionGetResults; +import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SqlRoleAssignmentGetResults; /** * Type representing SqlResources. @@ -55,6 +57,20 @@ public interface SqlResources { */ SqlTriggerGetResults.DefinitionStages.Blank defineTrigger(String name); + /** + * Begins definition for a new SqlRoleDefinition resource. + * @param name resource name. + * @return the first stage of the new SqlRoleDefinition definition. + */ + SqlRoleDefinitionGetResults.DefinitionStages.Blank defineSqlRoleDefinition(String name); + + /** + * Begins definition for a new SqlRoleAssignment resource. + * @param name resource name. + * @return the first stage of the new SqlRoleAssignment definition. + */ + SqlRoleAssignmentGetResults.DefinitionStages.Blank defineSqlRoleAssignment(String name); + /** * Gets the SQL database under an existing Azure Cosmos DB database account with the provided name. * @@ -284,4 +300,68 @@ public interface SqlResources { */ Completable deleteSqlTriggerAsync(String resourceGroupName, String accountName, String databaseName, String containerName, String triggerName); + /** + * Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition with the given Id. + * + * @param roleDefinitionId The GUID for the Role Definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getSqlRoleDefinitionAsync(String roleDefinitionId, String resourceGroupName, String accountName); + + /** + * Retrieves the list of all Azure Cosmos DB SQL Role Definitions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listSqlRoleDefinitionsAsync(String resourceGroupName, String accountName); + + /** + * Deletes an existing Azure Cosmos DB SQL Role Definition. + * + * @param roleDefinitionId The GUID for the Role Definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteSqlRoleDefinitionAsync(String roleDefinitionId, String resourceGroupName, String accountName); + + /** + * Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment with the given Id. + * + * @param roleAssignmentId The GUID for the Role Assignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getSqlRoleAssignmentAsync(String roleAssignmentId, String resourceGroupName, String accountName); + + /** + * Retrieves the list of all Azure Cosmos DB SQL Role Assignments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listSqlRoleAssignmentsAsync(String resourceGroupName, String accountName); + + /** + * Deletes an existing Azure Cosmos DB SQL Role Assignment. + * + * @param roleAssignmentId The GUID for the Role Assignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteSqlRoleAssignmentAsync(String roleAssignmentId, String resourceGroupName, String accountName); + } diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/SqlRoleAssignmentCreateUpdateParameters.java b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/SqlRoleAssignmentCreateUpdateParameters.java new file mode 100644 index 0000000000000..6ed248029778f --- /dev/null +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/SqlRoleAssignmentCreateUpdateParameters.java @@ -0,0 +1,101 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2020_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters to create and update an Azure Cosmos DB SQL Role Assignment. + */ +@JsonFlatten +public class SqlRoleAssignmentCreateUpdateParameters { + /** + * The unique identifier for the associated Role Definition. + */ + @JsonProperty(value = "properties.roleDefinitionId") + private String roleDefinitionId; + + /** + * The data plane resource path for which access is being granted through + * this Role Assignment. + */ + @JsonProperty(value = "properties.scope") + private String scope; + + /** + * The unique identifier for the associated AAD principal in the AAD graph + * to which access is being granted through this Role Assignment. Tenant ID + * for the principal is inferred using the tenant associated with the + * subscription. + */ + @JsonProperty(value = "properties.principalId") + private String principalId; + + /** + * Get the unique identifier for the associated Role Definition. + * + * @return the roleDefinitionId value + */ + public String roleDefinitionId() { + return this.roleDefinitionId; + } + + /** + * Set the unique identifier for the associated Role Definition. + * + * @param roleDefinitionId the roleDefinitionId value to set + * @return the SqlRoleAssignmentCreateUpdateParameters object itself. + */ + public SqlRoleAssignmentCreateUpdateParameters withRoleDefinitionId(String roleDefinitionId) { + this.roleDefinitionId = roleDefinitionId; + return this; + } + + /** + * Get the data plane resource path for which access is being granted through this Role Assignment. + * + * @return the scope value + */ + public String scope() { + return this.scope; + } + + /** + * Set the data plane resource path for which access is being granted through this Role Assignment. + * + * @param scope the scope value to set + * @return the SqlRoleAssignmentCreateUpdateParameters object itself. + */ + public SqlRoleAssignmentCreateUpdateParameters withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the unique identifier for the associated AAD principal in the AAD graph to which access is being granted through this Role Assignment. Tenant ID for the principal is inferred using the tenant associated with the subscription. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the unique identifier for the associated AAD principal in the AAD graph to which access is being granted through this Role Assignment. Tenant ID for the principal is inferred using the tenant associated with the subscription. + * + * @param principalId the principalId value to set + * @return the SqlRoleAssignmentCreateUpdateParameters object itself. + */ + public SqlRoleAssignmentCreateUpdateParameters withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + +} diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/SqlRoleAssignmentGetResults.java b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/SqlRoleAssignmentGetResults.java new file mode 100644 index 0000000000000..69f4e8c4b3f15 --- /dev/null +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/SqlRoleAssignmentGetResults.java @@ -0,0 +1,175 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2020_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.implementation.SqlRoleAssignmentGetResultsInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.implementation.CosmosDBManager; + +/** + * Type representing SqlRoleAssignmentGetResults. + */ +public interface SqlRoleAssignmentGetResults extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the principalId value. + */ + String principalId(); + + /** + * @return the roleDefinitionId value. + */ + String roleDefinitionId(); + + /** + * @return the scope value. + */ + String scope(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the SqlRoleAssignmentGetResults definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithDatabaseAccount, DefinitionStages.WithCreate { + } + + /** + * Grouping of SqlRoleAssignmentGetResults definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a SqlRoleAssignmentGetResults definition. + */ + interface Blank extends WithDatabaseAccount { + } + + /** + * The stage of the sqlroleassignmentgetresults definition allowing to specify DatabaseAccount. + */ + interface WithDatabaseAccount { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group. The name is case insensitive + * @param accountName Cosmos DB database account name + * @return the next definition stage + */ + WithCreate withExistingDatabaseAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the sqlroleassignmentgetresults definition allowing to specify PrincipalId. + */ + interface WithPrincipalId { + /** + * Specifies principalId. + * @param principalId The unique identifier for the associated AAD principal in the AAD graph to which access is being granted through this Role Assignment. Tenant ID for the principal is inferred using the tenant associated with the subscription + * @return the next definition stage + */ + WithCreate withPrincipalId(String principalId); + } + + /** + * The stage of the sqlroleassignmentgetresults definition allowing to specify RoleDefinitionId. + */ + interface WithRoleDefinitionId { + /** + * Specifies roleDefinitionId. + * @param roleDefinitionId The unique identifier for the associated Role Definition + * @return the next definition stage + */ + WithCreate withRoleDefinitionId(String roleDefinitionId); + } + + /** + * The stage of the sqlroleassignmentgetresults definition allowing to specify Scope. + */ + interface WithScope { + /** + * Specifies scope. + * @param scope The data plane resource path for which access is being granted through this Role Assignment + * @return the next definition stage + */ + WithCreate withScope(String scope); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithPrincipalId, DefinitionStages.WithRoleDefinitionId, DefinitionStages.WithScope { + } + } + /** + * The template for a SqlRoleAssignmentGetResults update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithPrincipalId, UpdateStages.WithRoleDefinitionId, UpdateStages.WithScope { + } + + /** + * Grouping of SqlRoleAssignmentGetResults update stages. + */ + interface UpdateStages { + /** + * The stage of the sqlroleassignmentgetresults update allowing to specify PrincipalId. + */ + interface WithPrincipalId { + /** + * Specifies principalId. + * @param principalId The unique identifier for the associated AAD principal in the AAD graph to which access is being granted through this Role Assignment. Tenant ID for the principal is inferred using the tenant associated with the subscription + * @return the next update stage + */ + Update withPrincipalId(String principalId); + } + + /** + * The stage of the sqlroleassignmentgetresults update allowing to specify RoleDefinitionId. + */ + interface WithRoleDefinitionId { + /** + * Specifies roleDefinitionId. + * @param roleDefinitionId The unique identifier for the associated Role Definition + * @return the next update stage + */ + Update withRoleDefinitionId(String roleDefinitionId); + } + + /** + * The stage of the sqlroleassignmentgetresults update allowing to specify Scope. + */ + interface WithScope { + /** + * Specifies scope. + * @param scope The data plane resource path for which access is being granted through this Role Assignment + * @return the next update stage + */ + Update withScope(String scope); + } + + } +} diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/SqlRoleDefinitionCreateUpdateParameters.java b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/SqlRoleDefinitionCreateUpdateParameters.java new file mode 100644 index 0000000000000..6a4f20af7c26c --- /dev/null +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/SqlRoleDefinitionCreateUpdateParameters.java @@ -0,0 +1,131 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2020_06_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters to create and update an Azure Cosmos DB SQL Role Definition. + */ +@JsonFlatten +public class SqlRoleDefinitionCreateUpdateParameters { + /** + * A user-friendly name for the Role Definition. Must be unique for the + * database account. + */ + @JsonProperty(value = "properties.roleName") + private String roleName; + + /** + * Indicates whether the Role Definition was built-in or user created. + * Possible values include: 'BuiltInRole', 'CustomRole'. + */ + @JsonProperty(value = "properties.type") + private RoleDefinitionType type; + + /** + * A set of fully qualified Scopes at or below which Role Assignments may + * be created using this Role Definition. This will allow application of + * this Role Definition on the entire database account or any underlying + * Database / Collection. Must have at least one element. Scopes higher + * than Database account are not enforceable as assignable Scopes. Note + * that resources referenced in assignable Scopes need not exist. + */ + @JsonProperty(value = "properties.assignableScopes") + private List assignableScopes; + + /** + * The set of operations allowed through this Role Definition. + */ + @JsonProperty(value = "properties.permissions") + private List permissions; + + /** + * Get a user-friendly name for the Role Definition. Must be unique for the database account. + * + * @return the roleName value + */ + public String roleName() { + return this.roleName; + } + + /** + * Set a user-friendly name for the Role Definition. Must be unique for the database account. + * + * @param roleName the roleName value to set + * @return the SqlRoleDefinitionCreateUpdateParameters object itself. + */ + public SqlRoleDefinitionCreateUpdateParameters withRoleName(String roleName) { + this.roleName = roleName; + return this; + } + + /** + * Get indicates whether the Role Definition was built-in or user created. Possible values include: 'BuiltInRole', 'CustomRole'. + * + * @return the type value + */ + public RoleDefinitionType type() { + return this.type; + } + + /** + * Set indicates whether the Role Definition was built-in or user created. Possible values include: 'BuiltInRole', 'CustomRole'. + * + * @param type the type value to set + * @return the SqlRoleDefinitionCreateUpdateParameters object itself. + */ + public SqlRoleDefinitionCreateUpdateParameters withType(RoleDefinitionType type) { + this.type = type; + return this; + } + + /** + * Get a set of fully qualified Scopes at or below which Role Assignments may be created using this Role Definition. This will allow application of this Role Definition on the entire database account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not exist. + * + * @return the assignableScopes value + */ + public List assignableScopes() { + return this.assignableScopes; + } + + /** + * Set a set of fully qualified Scopes at or below which Role Assignments may be created using this Role Definition. This will allow application of this Role Definition on the entire database account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not exist. + * + * @param assignableScopes the assignableScopes value to set + * @return the SqlRoleDefinitionCreateUpdateParameters object itself. + */ + public SqlRoleDefinitionCreateUpdateParameters withAssignableScopes(List assignableScopes) { + this.assignableScopes = assignableScopes; + return this; + } + + /** + * Get the set of operations allowed through this Role Definition. + * + * @return the permissions value + */ + public List permissions() { + return this.permissions; + } + + /** + * Set the set of operations allowed through this Role Definition. + * + * @param permissions the permissions value to set + * @return the SqlRoleDefinitionCreateUpdateParameters object itself. + */ + public SqlRoleDefinitionCreateUpdateParameters withPermissions(List permissions) { + this.permissions = permissions; + return this; + } + +} diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/SqlRoleDefinitionGetResults.java b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/SqlRoleDefinitionGetResults.java new file mode 100644 index 0000000000000..0550ed10b41af --- /dev/null +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/SqlRoleDefinitionGetResults.java @@ -0,0 +1,205 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2020_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.implementation.SqlRoleDefinitionGetResultsInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.implementation.CosmosDBManager; +import java.util.List; + +/** + * Type representing SqlRoleDefinitionGetResults. + */ +public interface SqlRoleDefinitionGetResults extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the assignableScopes value. + */ + List assignableScopes(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the permissions value. + */ + List permissions(); + + /** + * @return the roleName value. + */ + String roleName(); + + /** + * @return the sqlRoleDefinitionGetResultsType value. + */ + RoleDefinitionType sqlRoleDefinitionGetResultsType(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the SqlRoleDefinitionGetResults definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithDatabaseAccount, DefinitionStages.WithCreate { + } + + /** + * Grouping of SqlRoleDefinitionGetResults definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a SqlRoleDefinitionGetResults definition. + */ + interface Blank extends WithDatabaseAccount { + } + + /** + * The stage of the sqlroledefinitiongetresults definition allowing to specify DatabaseAccount. + */ + interface WithDatabaseAccount { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group. The name is case insensitive + * @param accountName Cosmos DB database account name + * @return the next definition stage + */ + WithCreate withExistingDatabaseAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the sqlroledefinitiongetresults definition allowing to specify AssignableScopes. + */ + interface WithAssignableScopes { + /** + * Specifies assignableScopes. + * @param assignableScopes A set of fully qualified Scopes at or below which Role Assignments may be created using this Role Definition. This will allow application of this Role Definition on the entire database account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not exist + * @return the next definition stage + */ + WithCreate withAssignableScopes(List assignableScopes); + } + + /** + * The stage of the sqlroledefinitiongetresults definition allowing to specify Permissions. + */ + interface WithPermissions { + /** + * Specifies permissions. + * @param permissions The set of operations allowed through this Role Definition + * @return the next definition stage + */ + WithCreate withPermissions(List permissions); + } + + /** + * The stage of the sqlroledefinitiongetresults definition allowing to specify RoleName. + */ + interface WithRoleName { + /** + * Specifies roleName. + * @param roleName A user-friendly name for the Role Definition. Must be unique for the database account + * @return the next definition stage + */ + WithCreate withRoleName(String roleName); + } + + /** + * The stage of the sqlroledefinitiongetresults definition allowing to specify Type. + */ + interface WithType { + /** + * Specifies type. + * @param type Indicates whether the Role Definition was built-in or user created. Possible values include: 'BuiltInRole', 'CustomRole' + * @return the next definition stage + */ + WithCreate withType(RoleDefinitionType type); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAssignableScopes, DefinitionStages.WithPermissions, DefinitionStages.WithRoleName, DefinitionStages.WithType { + } + } + /** + * The template for a SqlRoleDefinitionGetResults update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAssignableScopes, UpdateStages.WithPermissions, UpdateStages.WithRoleName, UpdateStages.WithType { + } + + /** + * Grouping of SqlRoleDefinitionGetResults update stages. + */ + interface UpdateStages { + /** + * The stage of the sqlroledefinitiongetresults update allowing to specify AssignableScopes. + */ + interface WithAssignableScopes { + /** + * Specifies assignableScopes. + * @param assignableScopes A set of fully qualified Scopes at or below which Role Assignments may be created using this Role Definition. This will allow application of this Role Definition on the entire database account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not exist + * @return the next update stage + */ + Update withAssignableScopes(List assignableScopes); + } + + /** + * The stage of the sqlroledefinitiongetresults update allowing to specify Permissions. + */ + interface WithPermissions { + /** + * Specifies permissions. + * @param permissions The set of operations allowed through this Role Definition + * @return the next update stage + */ + Update withPermissions(List permissions); + } + + /** + * The stage of the sqlroledefinitiongetresults update allowing to specify RoleName. + */ + interface WithRoleName { + /** + * Specifies roleName. + * @param roleName A user-friendly name for the Role Definition. Must be unique for the database account + * @return the next update stage + */ + Update withRoleName(String roleName); + } + + /** + * The stage of the sqlroledefinitiongetresults update allowing to specify Type. + */ + interface WithType { + /** + * Specifies type. + * @param type Indicates whether the Role Definition was built-in or user created. Possible values include: 'BuiltInRole', 'CustomRole' + * @return the next update stage + */ + Update withType(RoleDefinitionType type); + } + + } +} diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/DatabaseAccountGetResultsImpl.java b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/DatabaseAccountGetResultsImpl.java index a95471cc22b17..0252a4597b697 100644 --- a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/DatabaseAccountGetResultsImpl.java +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/DatabaseAccountGetResultsImpl.java @@ -19,6 +19,7 @@ import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.Capability; import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.ConnectorOffer; import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.ConsistencyPolicy; +import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.CorsPolicy; import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.CreateMode; import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.DatabaseAccountOfferType; import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.FailoverPolicy; @@ -32,6 +33,7 @@ import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SystemData; import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.VirtualNetworkRule; import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.ManagedServiceIdentity; +import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.DatabaseAccountCreateUpdateProperties; import rx.functions.Func1; class DatabaseAccountGetResultsImpl extends GroupableResourceCoreImpl implements DatabaseAccountGetResults, DatabaseAccountGetResults.Definition, DatabaseAccountGetResults.Update { @@ -114,6 +116,11 @@ public ConsistencyPolicy consistencyPolicy() { return this.inner().consistencyPolicy(); } + @Override + public List cors() { + return this.inner().cors(); + } + @Override public CreateMode createMode() { return this.inner().createMode(); @@ -246,14 +253,8 @@ public List writeLocations() { } @Override - public DatabaseAccountGetResultsImpl withDatabaseAccountOfferType(String databaseAccountOfferType) { - this.createParameter.withDatabaseAccountOfferType(databaseAccountOfferType); - return this; - } - - @Override - public DatabaseAccountGetResultsImpl withIdentity(ManagedServiceIdentity identity) { - this.createParameter.withIdentity(identity); + public DatabaseAccountGetResultsImpl withProperties(DatabaseAccountCreateUpdateProperties properties) { + this.createParameter.withProperties(properties); return this; } @@ -263,172 +264,120 @@ public DatabaseAccountGetResultsImpl withKind(DatabaseAccountKind kind) { return this; } - @Override - public DatabaseAccountGetResultsImpl withLocations(List locations) { - if (isInCreateMode()) { - this.createParameter.withLocations(locations); - } else { - this.updateParameter.withLocations(locations); - } - return this; - } - @Override public DatabaseAccountGetResultsImpl withApiProperties(ApiProperties apiProperties) { - if (isInCreateMode()) { - this.createParameter.withApiProperties(apiProperties); - } else { - this.updateParameter.withApiProperties(apiProperties); - } + this.updateParameter.withApiProperties(apiProperties); return this; } @Override public DatabaseAccountGetResultsImpl withBackupPolicy(BackupPolicy backupPolicy) { - if (isInCreateMode()) { - this.createParameter.withBackupPolicy(backupPolicy); - } else { - this.updateParameter.withBackupPolicy(backupPolicy); - } + this.updateParameter.withBackupPolicy(backupPolicy); return this; } @Override public DatabaseAccountGetResultsImpl withCapabilities(List capabilities) { - if (isInCreateMode()) { - this.createParameter.withCapabilities(capabilities); - } else { - this.updateParameter.withCapabilities(capabilities); - } + this.updateParameter.withCapabilities(capabilities); return this; } @Override public DatabaseAccountGetResultsImpl withConnectorOffer(ConnectorOffer connectorOffer) { - if (isInCreateMode()) { - this.createParameter.withConnectorOffer(connectorOffer); - } else { - this.updateParameter.withConnectorOffer(connectorOffer); - } + this.updateParameter.withConnectorOffer(connectorOffer); return this; } @Override public DatabaseAccountGetResultsImpl withConsistencyPolicy(ConsistencyPolicy consistencyPolicy) { - if (isInCreateMode()) { - this.createParameter.withConsistencyPolicy(consistencyPolicy); - } else { - this.updateParameter.withConsistencyPolicy(consistencyPolicy); - } + this.updateParameter.withConsistencyPolicy(consistencyPolicy); + return this; + } + + @Override + public DatabaseAccountGetResultsImpl withCors(List cors) { + this.updateParameter.withCors(cors); return this; } @Override public DatabaseAccountGetResultsImpl withDisableKeyBasedMetadataWriteAccess(Boolean disableKeyBasedMetadataWriteAccess) { - if (isInCreateMode()) { - this.createParameter.withDisableKeyBasedMetadataWriteAccess(disableKeyBasedMetadataWriteAccess); - } else { - this.updateParameter.withDisableKeyBasedMetadataWriteAccess(disableKeyBasedMetadataWriteAccess); - } + this.updateParameter.withDisableKeyBasedMetadataWriteAccess(disableKeyBasedMetadataWriteAccess); return this; } @Override public DatabaseAccountGetResultsImpl withEnableAnalyticalStorage(Boolean enableAnalyticalStorage) { - if (isInCreateMode()) { - this.createParameter.withEnableAnalyticalStorage(enableAnalyticalStorage); - } else { - this.updateParameter.withEnableAnalyticalStorage(enableAnalyticalStorage); - } + this.updateParameter.withEnableAnalyticalStorage(enableAnalyticalStorage); return this; } @Override public DatabaseAccountGetResultsImpl withEnableAutomaticFailover(Boolean enableAutomaticFailover) { - if (isInCreateMode()) { - this.createParameter.withEnableAutomaticFailover(enableAutomaticFailover); - } else { - this.updateParameter.withEnableAutomaticFailover(enableAutomaticFailover); - } + this.updateParameter.withEnableAutomaticFailover(enableAutomaticFailover); return this; } @Override public DatabaseAccountGetResultsImpl withEnableCassandraConnector(Boolean enableCassandraConnector) { - if (isInCreateMode()) { - this.createParameter.withEnableCassandraConnector(enableCassandraConnector); - } else { - this.updateParameter.withEnableCassandraConnector(enableCassandraConnector); - } + this.updateParameter.withEnableCassandraConnector(enableCassandraConnector); return this; } @Override public DatabaseAccountGetResultsImpl withEnableFreeTier(Boolean enableFreeTier) { - if (isInCreateMode()) { - this.createParameter.withEnableFreeTier(enableFreeTier); - } else { - this.updateParameter.withEnableFreeTier(enableFreeTier); - } + this.updateParameter.withEnableFreeTier(enableFreeTier); return this; } @Override public DatabaseAccountGetResultsImpl withEnableMultipleWriteLocations(Boolean enableMultipleWriteLocations) { - if (isInCreateMode()) { - this.createParameter.withEnableMultipleWriteLocations(enableMultipleWriteLocations); - } else { - this.updateParameter.withEnableMultipleWriteLocations(enableMultipleWriteLocations); - } + this.updateParameter.withEnableMultipleWriteLocations(enableMultipleWriteLocations); return this; } @Override public DatabaseAccountGetResultsImpl withIpRules(List ipRules) { - if (isInCreateMode()) { - this.createParameter.withIpRules(ipRules); - } else { - this.updateParameter.withIpRules(ipRules); - } + this.updateParameter.withIpRules(ipRules); return this; } @Override public DatabaseAccountGetResultsImpl withIsVirtualNetworkFilterEnabled(Boolean isVirtualNetworkFilterEnabled) { - if (isInCreateMode()) { - this.createParameter.withIsVirtualNetworkFilterEnabled(isVirtualNetworkFilterEnabled); - } else { - this.updateParameter.withIsVirtualNetworkFilterEnabled(isVirtualNetworkFilterEnabled); - } + this.updateParameter.withIsVirtualNetworkFilterEnabled(isVirtualNetworkFilterEnabled); return this; } @Override public DatabaseAccountGetResultsImpl withKeyVaultKeyUri(String keyVaultKeyUri) { - if (isInCreateMode()) { - this.createParameter.withKeyVaultKeyUri(keyVaultKeyUri); - } else { - this.updateParameter.withKeyVaultKeyUri(keyVaultKeyUri); - } + this.updateParameter.withKeyVaultKeyUri(keyVaultKeyUri); + return this; + } + + @Override + public DatabaseAccountGetResultsImpl withLocations(List locations) { + this.updateParameter.withLocations(locations); return this; } @Override public DatabaseAccountGetResultsImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { - if (isInCreateMode()) { - this.createParameter.withPublicNetworkAccess(publicNetworkAccess); - } else { - this.updateParameter.withPublicNetworkAccess(publicNetworkAccess); - } + this.updateParameter.withPublicNetworkAccess(publicNetworkAccess); return this; } @Override public DatabaseAccountGetResultsImpl withVirtualNetworkRules(List virtualNetworkRules) { + this.updateParameter.withVirtualNetworkRules(virtualNetworkRules); + return this; + } + + @Override + public DatabaseAccountGetResultsImpl withIdentity(ManagedServiceIdentity identity) { if (isInCreateMode()) { - this.createParameter.withVirtualNetworkRules(virtualNetworkRules); + this.createParameter.withIdentity(identity); } else { - this.updateParameter.withVirtualNetworkRules(virtualNetworkRules); + this.updateParameter.withIdentity(identity); } return this; } diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/DatabaseAccountGetResultsInner.java b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/DatabaseAccountGetResultsInner.java index 407e6ca771a37..4a4d6301d5469 100644 --- a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/DatabaseAccountGetResultsInner.java +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/DatabaseAccountGetResultsInner.java @@ -23,6 +23,7 @@ import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.CreateMode; import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.RestoreParameters; import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.BackupPolicy; +import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.CorsPolicy; import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SystemData; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; @@ -214,6 +215,12 @@ public class DatabaseAccountGetResultsInner extends ARMResourceProperties { @JsonProperty(value = "properties.backupPolicy") private BackupPolicy backupPolicy; + /** + * The CORS policy for the Cosmos DB database account. + */ + @JsonProperty(value = "properties.cors") + private List cors; + /** * The system meta data relating to this resource. */ @@ -692,6 +699,26 @@ public DatabaseAccountGetResultsInner withBackupPolicy(BackupPolicy backupPolicy return this; } + /** + * Get the CORS policy for the Cosmos DB database account. + * + * @return the cors value + */ + public List cors() { + return this.cors; + } + + /** + * Set the CORS policy for the Cosmos DB database account. + * + * @param cors the cors value to set + * @return the DatabaseAccountGetResultsInner object itself. + */ + public DatabaseAccountGetResultsInner withCors(List cors) { + this.cors = cors; + return this; + } + /** * Get the system meta data relating to this resource. * diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/NotebookWorkspacesInner.java b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/NotebookWorkspacesInner.java index eb47449f6e96e..b03f772ac5a27 100644 --- a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/NotebookWorkspacesInner.java +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/NotebookWorkspacesInner.java @@ -342,7 +342,7 @@ public Observable> createOrUpdateWithSer } final String notebookWorkspaceName = "default"; final String apiVersion = "2020-06-01-preview"; - Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, apiVersion, this.client.acceptLanguage(), new NotebookWorkspaceCreateUpdateParameters(), this.client.userAgent()); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, apiVersion, this.client.acceptLanguage(), notebookCreateUpdateParameters, this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } @@ -410,7 +410,7 @@ public Observable> beginCreateOrUpdateWi } final String notebookWorkspaceName = "default"; final String apiVersion = "2020-06-01-preview"; - return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, apiVersion, this.client.acceptLanguage(), new NotebookWorkspaceCreateUpdateParameters(), this.client.userAgent()) + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, apiVersion, this.client.acceptLanguage(), notebookCreateUpdateParameters, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/RestorableDatabaseAccountsInner.java b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/RestorableDatabaseAccountsInner.java index 0d3411c767d7a..d68000fbe21ad 100644 --- a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/RestorableDatabaseAccountsInner.java +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/RestorableDatabaseAccountsInner.java @@ -10,7 +10,7 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; -import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.ErrorResponseUpdatedFormatException; +import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.DefaultErrorResponseException; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -73,7 +73,7 @@ interface RestorableDatabaseAccountsService { * * @param location Cosmos DB region, with spaces between words and each word capitalized. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorResponseUpdatedFormatException thrown if the request is rejected by server + * @throws DefaultErrorResponseException 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<RestorableDatabaseAccountGetResultInner> object if successful. */ @@ -143,10 +143,10 @@ public Observable> }); } - private ServiceResponse> listByLocationDelegate(Response response) throws ErrorResponseUpdatedFormatException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseUpdatedFormatException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listByLocationDelegate(Response response) throws DefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., DefaultErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(ErrorResponseUpdatedFormatException.class) + .registerError(DefaultErrorResponseException.class) .build(response); } @@ -222,10 +222,10 @@ public Observable> }); } - private ServiceResponse> listDelegate(Response response) throws ErrorResponseUpdatedFormatException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseUpdatedFormatException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listDelegate(Response response) throws DefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., DefaultErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(ErrorResponseUpdatedFormatException.class) + .registerError(DefaultErrorResponseException.class) .build(response); } @@ -235,7 +235,7 @@ private ServiceResponse> listD * @param location Cosmos DB region, with spaces between words and each word capitalized. * @param instanceId The instanceId GUID of a restorable database account. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorResponseUpdatedFormatException thrown if the request is rejected by server + * @throws DefaultErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the RestorableDatabaseAccountGetResultInner object if successful. */ @@ -306,10 +306,10 @@ public Observable> call }); } - private ServiceResponse getByLocationDelegate(Response response) throws ErrorResponseUpdatedFormatException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getByLocationDelegate(Response response) throws DefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(ErrorResponseUpdatedFormatException.class) + .registerError(DefaultErrorResponseException.class) .build(response); } diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/SqlResourcesImpl.java b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/SqlResourcesImpl.java index cf80a9382da01..3a77937005748 100644 --- a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/SqlResourcesImpl.java +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/SqlResourcesImpl.java @@ -22,6 +22,8 @@ import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SqlStoredProcedureGetResults; import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SqlUserDefinedFunctionGetResults; import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SqlTriggerGetResults; +import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SqlRoleDefinitionGetResults; +import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SqlRoleAssignmentGetResults; class SqlResourcesImpl extends WrapperImpl implements SqlResources { private final CosmosDBManager manager; @@ -60,6 +62,16 @@ public SqlTriggerGetResultsImpl defineTrigger(String name) { return wrapTriggerModel(name); } + @Override + public SqlRoleDefinitionGetResultsImpl defineSqlRoleDefinition(String name) { + return wrapSqlRoleDefinitionModel(name); + } + + @Override + public SqlRoleAssignmentGetResultsImpl defineSqlRoleAssignment(String name) { + return wrapSqlRoleAssignmentModel(name); + } + private SqlDatabaseGetResultsImpl wrapSqlDatabasisModel(String name) { return new SqlDatabaseGetResultsImpl(name, this.manager()); } @@ -80,6 +92,14 @@ private SqlTriggerGetResultsImpl wrapTriggerModel(String name) { return new SqlTriggerGetResultsImpl(name, this.manager()); } + private SqlRoleDefinitionGetResultsImpl wrapSqlRoleDefinitionModel(String name) { + return new SqlRoleDefinitionGetResultsImpl(name, this.manager()); + } + + private SqlRoleAssignmentGetResultsImpl wrapSqlRoleAssignmentModel(String name) { + return new SqlRoleAssignmentGetResultsImpl(name, this.manager()); + } + private SqlDatabaseGetResultsImpl wrapSqlDatabaseGetResultsModel(SqlDatabaseGetResultsInner inner) { return new SqlDatabaseGetResultsImpl(inner, manager()); } @@ -100,6 +120,14 @@ private SqlTriggerGetResultsImpl wrapSqlTriggerGetResultsModel(SqlTriggerGetResu return new SqlTriggerGetResultsImpl(inner, manager()); } + private SqlRoleDefinitionGetResultsImpl wrapSqlRoleDefinitionGetResultsModel(SqlRoleDefinitionGetResultsInner inner) { + return new SqlRoleDefinitionGetResultsImpl(inner, manager()); + } + + private SqlRoleAssignmentGetResultsImpl wrapSqlRoleAssignmentGetResultsModel(SqlRoleAssignmentGetResultsInner inner) { + return new SqlRoleAssignmentGetResultsImpl(inner, manager()); + } + private Observable getSqlDatabaseGetResultsInnerUsingSqlResourcesInnerAsync(String id) { String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); String accountName = IdParsingUtils.getValueFromIdByName(id, "databaseAccounts"); @@ -147,6 +175,22 @@ private Observable getSqlTriggerGetResultsInnerUsingS return client.getSqlTriggerAsync(resourceGroupName, accountName, databaseName, containerName, triggerName); } + private Observable getSqlRoleDefinitionGetResultsInnerUsingSqlResourcesInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String accountName = IdParsingUtils.getValueFromIdByName(id, "databaseAccounts"); + String roleDefinitionId = IdParsingUtils.getValueFromIdByName(id, "sqlRoleDefinitions"); + SqlResourcesInner client = this.inner(); + return client.getSqlRoleDefinitionAsync(roleDefinitionId, resourceGroupName, accountName); + } + + private Observable getSqlRoleAssignmentGetResultsInnerUsingSqlResourcesInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String accountName = IdParsingUtils.getValueFromIdByName(id, "databaseAccounts"); + String roleAssignmentId = IdParsingUtils.getValueFromIdByName(id, "sqlRoleAssignments"); + SqlResourcesInner client = this.inner(); + return client.getSqlRoleAssignmentAsync(roleAssignmentId, resourceGroupName, accountName); + } + @Override public Observable getSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { SqlResourcesInner client = this.inner(); @@ -395,4 +439,84 @@ public Completable deleteSqlTriggerAsync(String resourceGroupName, String accoun return client.deleteSqlTriggerAsync(resourceGroupName, accountName, databaseName, containerName, triggerName).toCompletable(); } + @Override + public Observable getSqlRoleDefinitionAsync(String roleDefinitionId, String resourceGroupName, String accountName) { + SqlResourcesInner client = this.inner(); + return client.getSqlRoleDefinitionAsync(roleDefinitionId, resourceGroupName, accountName) + .flatMap(new Func1>() { + @Override + public Observable call(SqlRoleDefinitionGetResultsInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((SqlRoleDefinitionGetResults)wrapSqlRoleDefinitionGetResultsModel(inner)); + } + } + }); + } + + @Override + public Observable listSqlRoleDefinitionsAsync(String resourceGroupName, String accountName) { + SqlResourcesInner client = this.inner(); + return client.listSqlRoleDefinitionsAsync(resourceGroupName, accountName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public SqlRoleDefinitionGetResults call(SqlRoleDefinitionGetResultsInner inner) { + return wrapSqlRoleDefinitionGetResultsModel(inner); + } + }); + } + + @Override + public Completable deleteSqlRoleDefinitionAsync(String roleDefinitionId, String resourceGroupName, String accountName) { + SqlResourcesInner client = this.inner(); + return client.deleteSqlRoleDefinitionAsync(roleDefinitionId, resourceGroupName, accountName).toCompletable(); + } + + @Override + public Observable getSqlRoleAssignmentAsync(String roleAssignmentId, String resourceGroupName, String accountName) { + SqlResourcesInner client = this.inner(); + return client.getSqlRoleAssignmentAsync(roleAssignmentId, resourceGroupName, accountName) + .flatMap(new Func1>() { + @Override + public Observable call(SqlRoleAssignmentGetResultsInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((SqlRoleAssignmentGetResults)wrapSqlRoleAssignmentGetResultsModel(inner)); + } + } + }); + } + + @Override + public Observable listSqlRoleAssignmentsAsync(String resourceGroupName, String accountName) { + SqlResourcesInner client = this.inner(); + return client.listSqlRoleAssignmentsAsync(resourceGroupName, accountName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public SqlRoleAssignmentGetResults call(SqlRoleAssignmentGetResultsInner inner) { + return wrapSqlRoleAssignmentGetResultsModel(inner); + } + }); + } + + @Override + public Completable deleteSqlRoleAssignmentAsync(String roleAssignmentId, String resourceGroupName, String accountName) { + SqlResourcesInner client = this.inner(); + return client.deleteSqlRoleAssignmentAsync(roleAssignmentId, resourceGroupName, accountName).toCompletable(); + } + } diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/SqlResourcesInner.java b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/SqlResourcesInner.java index 6e8b53198830b..9fce74a6c1395 100644 --- a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/SqlResourcesInner.java +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/SqlResourcesInner.java @@ -11,8 +11,11 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.DefaultErrorResponseException; import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SqlContainerCreateUpdateParameters; import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SqlDatabaseCreateUpdateParameters; +import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SqlRoleAssignmentCreateUpdateParameters; +import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SqlRoleDefinitionCreateUpdateParameters; import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SqlStoredProcedureCreateUpdateParameters; import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SqlTriggerCreateUpdateParameters; import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SqlUserDefinedFunctionCreateUpdateParameters; @@ -206,6 +209,54 @@ interface SqlResourcesService { @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}", method = "DELETE", hasBody = true) Observable> beginDeleteSqlTrigger(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("containerName") String containerName, @Path("triggerName") String triggerName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SqlResources getSqlRoleDefinition" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}") + Observable> getSqlRoleDefinition(@Path("roleDefinitionId") String roleDefinitionId, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SqlResources createUpdateSqlRoleDefinition" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}") + Observable> createUpdateSqlRoleDefinition(@Path("roleDefinitionId") String roleDefinitionId, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Body SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SqlResources beginCreateUpdateSqlRoleDefinition" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}") + Observable> beginCreateUpdateSqlRoleDefinition(@Path("roleDefinitionId") String roleDefinitionId, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Body SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SqlResources deleteSqlRoleDefinition" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}", method = "DELETE", hasBody = true) + Observable> deleteSqlRoleDefinition(@Path("roleDefinitionId") String roleDefinitionId, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SqlResources beginDeleteSqlRoleDefinition" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}", method = "DELETE", hasBody = true) + Observable> beginDeleteSqlRoleDefinition(@Path("roleDefinitionId") String roleDefinitionId, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SqlResources listSqlRoleDefinitions" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions") + Observable> listSqlRoleDefinitions(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SqlResources getSqlRoleAssignment" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}") + Observable> getSqlRoleAssignment(@Path("roleAssignmentId") String roleAssignmentId, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SqlResources createUpdateSqlRoleAssignment" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}") + Observable> createUpdateSqlRoleAssignment(@Path("roleAssignmentId") String roleAssignmentId, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Body SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SqlResources beginCreateUpdateSqlRoleAssignment" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}") + Observable> beginCreateUpdateSqlRoleAssignment(@Path("roleAssignmentId") String roleAssignmentId, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Body SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SqlResources deleteSqlRoleAssignment" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}", method = "DELETE", hasBody = true) + Observable> deleteSqlRoleAssignment(@Path("roleAssignmentId") String roleAssignmentId, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SqlResources beginDeleteSqlRoleAssignment" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}", method = "DELETE", hasBody = true) + Observable> beginDeleteSqlRoleAssignment(@Path("roleAssignmentId") String roleAssignmentId, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SqlResources listSqlRoleAssignments" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments") + Observable> listSqlRoleAssignments(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + } /** @@ -3699,4 +3750,1058 @@ private ServiceResponse beginDeleteSqlTriggerDelegate(Response getSqlRoleDefinitionAsync(String roleDefinitionId, String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSqlRoleDefinitionWithServiceResponseAsync(roleDefinitionId, resourceGroupName, accountName), serviceCallback); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition with the given Id. + * + * @param roleDefinitionId The GUID for the Role Definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SqlRoleDefinitionGetResultsInner object + */ + public Observable getSqlRoleDefinitionAsync(String roleDefinitionId, String resourceGroupName, String accountName) { + return getSqlRoleDefinitionWithServiceResponseAsync(roleDefinitionId, resourceGroupName, accountName).map(new Func1, SqlRoleDefinitionGetResultsInner>() { + @Override + public SqlRoleDefinitionGetResultsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition with the given Id. + * + * @param roleDefinitionId The GUID for the Role Definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SqlRoleDefinitionGetResultsInner object + */ + public Observable> getSqlRoleDefinitionWithServiceResponseAsync(String roleDefinitionId, String resourceGroupName, String accountName) { + if (roleDefinitionId == null) { + throw new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + final String apiVersion = "2020-06-01-preview"; + return service.getSqlRoleDefinition(roleDefinitionId, this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSqlRoleDefinitionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSqlRoleDefinitionDelegate(Response response) throws DefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(DefaultErrorResponseException.class) + .build(response); + } + + /** + * Creates or updates an Azure Cosmos DB SQL Role Definition. + * + * @param roleDefinitionId The GUID for the Role Definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateSqlRoleDefinitionParameters The properties required to create or update a Role Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws DefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SqlRoleDefinitionGetResultsInner object if successful. + */ + public SqlRoleDefinitionGetResultsInner createUpdateSqlRoleDefinition(String roleDefinitionId, String resourceGroupName, String accountName, SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters) { + return createUpdateSqlRoleDefinitionWithServiceResponseAsync(roleDefinitionId, resourceGroupName, accountName, createUpdateSqlRoleDefinitionParameters).toBlocking().last().body(); + } + + /** + * Creates or updates an Azure Cosmos DB SQL Role Definition. + * + * @param roleDefinitionId The GUID for the Role Definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateSqlRoleDefinitionParameters The properties required to create or update a Role Definition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createUpdateSqlRoleDefinitionAsync(String roleDefinitionId, String resourceGroupName, String accountName, SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createUpdateSqlRoleDefinitionWithServiceResponseAsync(roleDefinitionId, resourceGroupName, accountName, createUpdateSqlRoleDefinitionParameters), serviceCallback); + } + + /** + * Creates or updates an Azure Cosmos DB SQL Role Definition. + * + * @param roleDefinitionId The GUID for the Role Definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateSqlRoleDefinitionParameters The properties required to create or update a Role Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createUpdateSqlRoleDefinitionAsync(String roleDefinitionId, String resourceGroupName, String accountName, SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters) { + return createUpdateSqlRoleDefinitionWithServiceResponseAsync(roleDefinitionId, resourceGroupName, accountName, createUpdateSqlRoleDefinitionParameters).map(new Func1, SqlRoleDefinitionGetResultsInner>() { + @Override + public SqlRoleDefinitionGetResultsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an Azure Cosmos DB SQL Role Definition. + * + * @param roleDefinitionId The GUID for the Role Definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateSqlRoleDefinitionParameters The properties required to create or update a Role Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createUpdateSqlRoleDefinitionWithServiceResponseAsync(String roleDefinitionId, String resourceGroupName, String accountName, SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters) { + if (roleDefinitionId == null) { + throw new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (createUpdateSqlRoleDefinitionParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateSqlRoleDefinitionParameters is required and cannot be null."); + } + Validator.validate(createUpdateSqlRoleDefinitionParameters); + final String apiVersion = "2020-06-01-preview"; + Observable> observable = service.createUpdateSqlRoleDefinition(roleDefinitionId, this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, createUpdateSqlRoleDefinitionParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates an Azure Cosmos DB SQL Role Definition. + * + * @param roleDefinitionId The GUID for the Role Definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateSqlRoleDefinitionParameters The properties required to create or update a Role Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws DefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SqlRoleDefinitionGetResultsInner object if successful. + */ + public SqlRoleDefinitionGetResultsInner beginCreateUpdateSqlRoleDefinition(String roleDefinitionId, String resourceGroupName, String accountName, SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters) { + return beginCreateUpdateSqlRoleDefinitionWithServiceResponseAsync(roleDefinitionId, resourceGroupName, accountName, createUpdateSqlRoleDefinitionParameters).toBlocking().single().body(); + } + + /** + * Creates or updates an Azure Cosmos DB SQL Role Definition. + * + * @param roleDefinitionId The GUID for the Role Definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateSqlRoleDefinitionParameters The properties required to create or update a Role Definition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateUpdateSqlRoleDefinitionAsync(String roleDefinitionId, String resourceGroupName, String accountName, SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateUpdateSqlRoleDefinitionWithServiceResponseAsync(roleDefinitionId, resourceGroupName, accountName, createUpdateSqlRoleDefinitionParameters), serviceCallback); + } + + /** + * Creates or updates an Azure Cosmos DB SQL Role Definition. + * + * @param roleDefinitionId The GUID for the Role Definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateSqlRoleDefinitionParameters The properties required to create or update a Role Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SqlRoleDefinitionGetResultsInner object + */ + public Observable beginCreateUpdateSqlRoleDefinitionAsync(String roleDefinitionId, String resourceGroupName, String accountName, SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters) { + return beginCreateUpdateSqlRoleDefinitionWithServiceResponseAsync(roleDefinitionId, resourceGroupName, accountName, createUpdateSqlRoleDefinitionParameters).map(new Func1, SqlRoleDefinitionGetResultsInner>() { + @Override + public SqlRoleDefinitionGetResultsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an Azure Cosmos DB SQL Role Definition. + * + * @param roleDefinitionId The GUID for the Role Definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateSqlRoleDefinitionParameters The properties required to create or update a Role Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SqlRoleDefinitionGetResultsInner object + */ + public Observable> beginCreateUpdateSqlRoleDefinitionWithServiceResponseAsync(String roleDefinitionId, String resourceGroupName, String accountName, SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters) { + if (roleDefinitionId == null) { + throw new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (createUpdateSqlRoleDefinitionParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateSqlRoleDefinitionParameters is required and cannot be null."); + } + Validator.validate(createUpdateSqlRoleDefinitionParameters); + final String apiVersion = "2020-06-01-preview"; + return service.beginCreateUpdateSqlRoleDefinition(roleDefinitionId, this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, createUpdateSqlRoleDefinitionParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateUpdateSqlRoleDefinitionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateUpdateSqlRoleDefinitionDelegate(Response response) throws DefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(DefaultErrorResponseException.class) + .build(response); + } + + /** + * Deletes an existing Azure Cosmos DB SQL Role Definition. + * + * @param roleDefinitionId The GUID for the Role Definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws DefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteSqlRoleDefinition(String roleDefinitionId, String resourceGroupName, String accountName) { + deleteSqlRoleDefinitionWithServiceResponseAsync(roleDefinitionId, resourceGroupName, accountName).toBlocking().last().body(); + } + + /** + * Deletes an existing Azure Cosmos DB SQL Role Definition. + * + * @param roleDefinitionId The GUID for the Role Definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteSqlRoleDefinitionAsync(String roleDefinitionId, String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteSqlRoleDefinitionWithServiceResponseAsync(roleDefinitionId, resourceGroupName, accountName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB SQL Role Definition. + * + * @param roleDefinitionId The GUID for the Role Definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteSqlRoleDefinitionAsync(String roleDefinitionId, String resourceGroupName, String accountName) { + return deleteSqlRoleDefinitionWithServiceResponseAsync(roleDefinitionId, resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB SQL Role Definition. + * + * @param roleDefinitionId The GUID for the Role Definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteSqlRoleDefinitionWithServiceResponseAsync(String roleDefinitionId, String resourceGroupName, String accountName) { + if (roleDefinitionId == null) { + throw new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + final String apiVersion = "2020-06-01-preview"; + Observable> observable = service.deleteSqlRoleDefinition(roleDefinitionId, this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an existing Azure Cosmos DB SQL Role Definition. + * + * @param roleDefinitionId The GUID for the Role Definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws DefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteSqlRoleDefinition(String roleDefinitionId, String resourceGroupName, String accountName) { + beginDeleteSqlRoleDefinitionWithServiceResponseAsync(roleDefinitionId, resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Deletes an existing Azure Cosmos DB SQL Role Definition. + * + * @param roleDefinitionId The GUID for the Role Definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteSqlRoleDefinitionAsync(String roleDefinitionId, String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteSqlRoleDefinitionWithServiceResponseAsync(roleDefinitionId, resourceGroupName, accountName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB SQL Role Definition. + * + * @param roleDefinitionId The GUID for the Role Definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteSqlRoleDefinitionAsync(String roleDefinitionId, String resourceGroupName, String accountName) { + return beginDeleteSqlRoleDefinitionWithServiceResponseAsync(roleDefinitionId, resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB SQL Role Definition. + * + * @param roleDefinitionId The GUID for the Role Definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteSqlRoleDefinitionWithServiceResponseAsync(String roleDefinitionId, String resourceGroupName, String accountName) { + if (roleDefinitionId == null) { + throw new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + final String apiVersion = "2020-06-01-preview"; + return service.beginDeleteSqlRoleDefinition(roleDefinitionId, this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteSqlRoleDefinitionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteSqlRoleDefinitionDelegate(Response response) throws DefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(DefaultErrorResponseException.class) + .build(response); + } + + /** + * Retrieves the list of all Azure Cosmos DB SQL Role Definitions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws DefaultErrorResponseException 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<SqlRoleDefinitionGetResultsInner> object if successful. + */ + public List listSqlRoleDefinitions(String resourceGroupName, String accountName) { + return listSqlRoleDefinitionsWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Retrieves the list of all Azure Cosmos DB SQL Role Definitions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listSqlRoleDefinitionsAsync(String resourceGroupName, String accountName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listSqlRoleDefinitionsWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Retrieves the list of all Azure Cosmos DB SQL Role Definitions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<SqlRoleDefinitionGetResultsInner> object + */ + public Observable> listSqlRoleDefinitionsAsync(String resourceGroupName, String accountName) { + return listSqlRoleDefinitionsWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves the list of all Azure Cosmos DB SQL Role Definitions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<SqlRoleDefinitionGetResultsInner> object + */ + public Observable>> listSqlRoleDefinitionsWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + final String apiVersion = "2020-06-01-preview"; + return service.listSqlRoleDefinitions(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listSqlRoleDefinitionsDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listSqlRoleDefinitionsDelegate(Response response) throws DefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., DefaultErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(DefaultErrorResponseException.class) + .build(response); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment with the given Id. + * + * @param roleAssignmentId The GUID for the Role Assignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws DefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SqlRoleAssignmentGetResultsInner object if successful. + */ + public SqlRoleAssignmentGetResultsInner getSqlRoleAssignment(String roleAssignmentId, String resourceGroupName, String accountName) { + return getSqlRoleAssignmentWithServiceResponseAsync(roleAssignmentId, resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment with the given Id. + * + * @param roleAssignmentId The GUID for the Role Assignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSqlRoleAssignmentAsync(String roleAssignmentId, String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSqlRoleAssignmentWithServiceResponseAsync(roleAssignmentId, resourceGroupName, accountName), serviceCallback); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment with the given Id. + * + * @param roleAssignmentId The GUID for the Role Assignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SqlRoleAssignmentGetResultsInner object + */ + public Observable getSqlRoleAssignmentAsync(String roleAssignmentId, String resourceGroupName, String accountName) { + return getSqlRoleAssignmentWithServiceResponseAsync(roleAssignmentId, resourceGroupName, accountName).map(new Func1, SqlRoleAssignmentGetResultsInner>() { + @Override + public SqlRoleAssignmentGetResultsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment with the given Id. + * + * @param roleAssignmentId The GUID for the Role Assignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SqlRoleAssignmentGetResultsInner object + */ + public Observable> getSqlRoleAssignmentWithServiceResponseAsync(String roleAssignmentId, String resourceGroupName, String accountName) { + if (roleAssignmentId == null) { + throw new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + final String apiVersion = "2020-06-01-preview"; + return service.getSqlRoleAssignment(roleAssignmentId, this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSqlRoleAssignmentDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSqlRoleAssignmentDelegate(Response response) throws DefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(DefaultErrorResponseException.class) + .build(response); + } + + /** + * Creates or updates an Azure Cosmos DB SQL Role Assignment. + * + * @param roleAssignmentId The GUID for the Role Assignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateSqlRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws DefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SqlRoleAssignmentGetResultsInner object if successful. + */ + public SqlRoleAssignmentGetResultsInner createUpdateSqlRoleAssignment(String roleAssignmentId, String resourceGroupName, String accountName, SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters) { + return createUpdateSqlRoleAssignmentWithServiceResponseAsync(roleAssignmentId, resourceGroupName, accountName, createUpdateSqlRoleAssignmentParameters).toBlocking().last().body(); + } + + /** + * Creates or updates an Azure Cosmos DB SQL Role Assignment. + * + * @param roleAssignmentId The GUID for the Role Assignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateSqlRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createUpdateSqlRoleAssignmentAsync(String roleAssignmentId, String resourceGroupName, String accountName, SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createUpdateSqlRoleAssignmentWithServiceResponseAsync(roleAssignmentId, resourceGroupName, accountName, createUpdateSqlRoleAssignmentParameters), serviceCallback); + } + + /** + * Creates or updates an Azure Cosmos DB SQL Role Assignment. + * + * @param roleAssignmentId The GUID for the Role Assignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateSqlRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createUpdateSqlRoleAssignmentAsync(String roleAssignmentId, String resourceGroupName, String accountName, SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters) { + return createUpdateSqlRoleAssignmentWithServiceResponseAsync(roleAssignmentId, resourceGroupName, accountName, createUpdateSqlRoleAssignmentParameters).map(new Func1, SqlRoleAssignmentGetResultsInner>() { + @Override + public SqlRoleAssignmentGetResultsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an Azure Cosmos DB SQL Role Assignment. + * + * @param roleAssignmentId The GUID for the Role Assignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateSqlRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createUpdateSqlRoleAssignmentWithServiceResponseAsync(String roleAssignmentId, String resourceGroupName, String accountName, SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters) { + if (roleAssignmentId == null) { + throw new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (createUpdateSqlRoleAssignmentParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateSqlRoleAssignmentParameters is required and cannot be null."); + } + Validator.validate(createUpdateSqlRoleAssignmentParameters); + final String apiVersion = "2020-06-01-preview"; + Observable> observable = service.createUpdateSqlRoleAssignment(roleAssignmentId, this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, createUpdateSqlRoleAssignmentParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates an Azure Cosmos DB SQL Role Assignment. + * + * @param roleAssignmentId The GUID for the Role Assignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateSqlRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws DefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SqlRoleAssignmentGetResultsInner object if successful. + */ + public SqlRoleAssignmentGetResultsInner beginCreateUpdateSqlRoleAssignment(String roleAssignmentId, String resourceGroupName, String accountName, SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters) { + return beginCreateUpdateSqlRoleAssignmentWithServiceResponseAsync(roleAssignmentId, resourceGroupName, accountName, createUpdateSqlRoleAssignmentParameters).toBlocking().single().body(); + } + + /** + * Creates or updates an Azure Cosmos DB SQL Role Assignment. + * + * @param roleAssignmentId The GUID for the Role Assignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateSqlRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateUpdateSqlRoleAssignmentAsync(String roleAssignmentId, String resourceGroupName, String accountName, SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateUpdateSqlRoleAssignmentWithServiceResponseAsync(roleAssignmentId, resourceGroupName, accountName, createUpdateSqlRoleAssignmentParameters), serviceCallback); + } + + /** + * Creates or updates an Azure Cosmos DB SQL Role Assignment. + * + * @param roleAssignmentId The GUID for the Role Assignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateSqlRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SqlRoleAssignmentGetResultsInner object + */ + public Observable beginCreateUpdateSqlRoleAssignmentAsync(String roleAssignmentId, String resourceGroupName, String accountName, SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters) { + return beginCreateUpdateSqlRoleAssignmentWithServiceResponseAsync(roleAssignmentId, resourceGroupName, accountName, createUpdateSqlRoleAssignmentParameters).map(new Func1, SqlRoleAssignmentGetResultsInner>() { + @Override + public SqlRoleAssignmentGetResultsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an Azure Cosmos DB SQL Role Assignment. + * + * @param roleAssignmentId The GUID for the Role Assignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateSqlRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SqlRoleAssignmentGetResultsInner object + */ + public Observable> beginCreateUpdateSqlRoleAssignmentWithServiceResponseAsync(String roleAssignmentId, String resourceGroupName, String accountName, SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters) { + if (roleAssignmentId == null) { + throw new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (createUpdateSqlRoleAssignmentParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateSqlRoleAssignmentParameters is required and cannot be null."); + } + Validator.validate(createUpdateSqlRoleAssignmentParameters); + final String apiVersion = "2020-06-01-preview"; + return service.beginCreateUpdateSqlRoleAssignment(roleAssignmentId, this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, createUpdateSqlRoleAssignmentParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateUpdateSqlRoleAssignmentDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateUpdateSqlRoleAssignmentDelegate(Response response) throws DefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(DefaultErrorResponseException.class) + .build(response); + } + + /** + * Deletes an existing Azure Cosmos DB SQL Role Assignment. + * + * @param roleAssignmentId The GUID for the Role Assignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws DefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteSqlRoleAssignment(String roleAssignmentId, String resourceGroupName, String accountName) { + deleteSqlRoleAssignmentWithServiceResponseAsync(roleAssignmentId, resourceGroupName, accountName).toBlocking().last().body(); + } + + /** + * Deletes an existing Azure Cosmos DB SQL Role Assignment. + * + * @param roleAssignmentId The GUID for the Role Assignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteSqlRoleAssignmentAsync(String roleAssignmentId, String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteSqlRoleAssignmentWithServiceResponseAsync(roleAssignmentId, resourceGroupName, accountName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB SQL Role Assignment. + * + * @param roleAssignmentId The GUID for the Role Assignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteSqlRoleAssignmentAsync(String roleAssignmentId, String resourceGroupName, String accountName) { + return deleteSqlRoleAssignmentWithServiceResponseAsync(roleAssignmentId, resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB SQL Role Assignment. + * + * @param roleAssignmentId The GUID for the Role Assignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteSqlRoleAssignmentWithServiceResponseAsync(String roleAssignmentId, String resourceGroupName, String accountName) { + if (roleAssignmentId == null) { + throw new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + final String apiVersion = "2020-06-01-preview"; + Observable> observable = service.deleteSqlRoleAssignment(roleAssignmentId, this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an existing Azure Cosmos DB SQL Role Assignment. + * + * @param roleAssignmentId The GUID for the Role Assignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws DefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteSqlRoleAssignment(String roleAssignmentId, String resourceGroupName, String accountName) { + beginDeleteSqlRoleAssignmentWithServiceResponseAsync(roleAssignmentId, resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Deletes an existing Azure Cosmos DB SQL Role Assignment. + * + * @param roleAssignmentId The GUID for the Role Assignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteSqlRoleAssignmentAsync(String roleAssignmentId, String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteSqlRoleAssignmentWithServiceResponseAsync(roleAssignmentId, resourceGroupName, accountName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB SQL Role Assignment. + * + * @param roleAssignmentId The GUID for the Role Assignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteSqlRoleAssignmentAsync(String roleAssignmentId, String resourceGroupName, String accountName) { + return beginDeleteSqlRoleAssignmentWithServiceResponseAsync(roleAssignmentId, resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB SQL Role Assignment. + * + * @param roleAssignmentId The GUID for the Role Assignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteSqlRoleAssignmentWithServiceResponseAsync(String roleAssignmentId, String resourceGroupName, String accountName) { + if (roleAssignmentId == null) { + throw new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + final String apiVersion = "2020-06-01-preview"; + return service.beginDeleteSqlRoleAssignment(roleAssignmentId, this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteSqlRoleAssignmentDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteSqlRoleAssignmentDelegate(Response response) throws DefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(DefaultErrorResponseException.class) + .build(response); + } + + /** + * Retrieves the list of all Azure Cosmos DB SQL Role Assignments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws DefaultErrorResponseException 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<SqlRoleAssignmentGetResultsInner> object if successful. + */ + public List listSqlRoleAssignments(String resourceGroupName, String accountName) { + return listSqlRoleAssignmentsWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Retrieves the list of all Azure Cosmos DB SQL Role Assignments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listSqlRoleAssignmentsAsync(String resourceGroupName, String accountName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listSqlRoleAssignmentsWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Retrieves the list of all Azure Cosmos DB SQL Role Assignments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<SqlRoleAssignmentGetResultsInner> object + */ + public Observable> listSqlRoleAssignmentsAsync(String resourceGroupName, String accountName) { + return listSqlRoleAssignmentsWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves the list of all Azure Cosmos DB SQL Role Assignments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<SqlRoleAssignmentGetResultsInner> object + */ + public Observable>> listSqlRoleAssignmentsWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + final String apiVersion = "2020-06-01-preview"; + return service.listSqlRoleAssignments(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listSqlRoleAssignmentsDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listSqlRoleAssignmentsDelegate(Response response) throws DefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., DefaultErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(DefaultErrorResponseException.class) + .build(response); + } + } diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/SqlRoleAssignmentGetResultsImpl.java b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/SqlRoleAssignmentGetResultsImpl.java new file mode 100644 index 0000000000000..d1949fd3ff86d --- /dev/null +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/SqlRoleAssignmentGetResultsImpl.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.implementation; + +import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SqlRoleAssignmentGetResults; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SqlRoleAssignmentCreateUpdateParameters; +import rx.functions.Func1; + +class SqlRoleAssignmentGetResultsImpl extends CreatableUpdatableImpl implements SqlRoleAssignmentGetResults, SqlRoleAssignmentGetResults.Definition, SqlRoleAssignmentGetResults.Update { + private final CosmosDBManager manager; + private String roleAssignmentId; + private String resourceGroupName; + private String accountName; + private SqlRoleAssignmentCreateUpdateParameters createOrUpdateParameter; + + SqlRoleAssignmentGetResultsImpl(String name, CosmosDBManager manager) { + super(name, new SqlRoleAssignmentGetResultsInner()); + this.manager = manager; + // Set resource name + this.roleAssignmentId = name; + // + this.createOrUpdateParameter = new SqlRoleAssignmentCreateUpdateParameters(); + } + + SqlRoleAssignmentGetResultsImpl(SqlRoleAssignmentGetResultsInner inner, CosmosDBManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.roleAssignmentId = inner.name(); + // set resource ancestor and positional variables + this.roleAssignmentId = IdParsingUtils.getValueFromIdByName(inner.id(), "sqlRoleAssignments"); + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "databaseAccounts"); + // + this.createOrUpdateParameter = new SqlRoleAssignmentCreateUpdateParameters(); + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + SqlResourcesInner client = this.manager().inner().sqlResources(); + return client.createUpdateSqlRoleAssignmentAsync(this.roleAssignmentId, this.resourceGroupName, this.accountName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public SqlRoleAssignmentGetResultsInner call(SqlRoleAssignmentGetResultsInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + SqlResourcesInner client = this.manager().inner().sqlResources(); + return client.createUpdateSqlRoleAssignmentAsync(this.roleAssignmentId, this.resourceGroupName, this.accountName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public SqlRoleAssignmentGetResultsInner call(SqlRoleAssignmentGetResultsInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + SqlResourcesInner client = this.manager().inner().sqlResources(); + return client.getSqlRoleAssignmentAsync(this.roleAssignmentId, this.resourceGroupName, this.accountName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new SqlRoleAssignmentCreateUpdateParameters(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String principalId() { + return this.inner().principalId(); + } + + @Override + public String roleDefinitionId() { + return this.inner().roleDefinitionId(); + } + + @Override + public String scope() { + return this.inner().scope(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public SqlRoleAssignmentGetResultsImpl withExistingDatabaseAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public SqlRoleAssignmentGetResultsImpl withPrincipalId(String principalId) { + this.createOrUpdateParameter.withPrincipalId(principalId); + return this; + } + + @Override + public SqlRoleAssignmentGetResultsImpl withRoleDefinitionId(String roleDefinitionId) { + this.createOrUpdateParameter.withRoleDefinitionId(roleDefinitionId); + return this; + } + + @Override + public SqlRoleAssignmentGetResultsImpl withScope(String scope) { + this.createOrUpdateParameter.withScope(scope); + return this; + } + +} diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/SqlRoleAssignmentGetResultsInner.java b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/SqlRoleAssignmentGetResultsInner.java new file mode 100644 index 0000000000000..0feece843525c --- /dev/null +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/SqlRoleAssignmentGetResultsInner.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.ARMProxyResource; + +/** + * An Azure Cosmos DB Role Assignment. + */ +@JsonFlatten +public class SqlRoleAssignmentGetResultsInner extends ARMProxyResource { + /** + * The unique identifier for the associated Role Definition. + */ + @JsonProperty(value = "properties.roleDefinitionId") + private String roleDefinitionId; + + /** + * The data plane resource path for which access is being granted through + * this Role Assignment. + */ + @JsonProperty(value = "properties.scope") + private String scope; + + /** + * The unique identifier for the associated AAD principal in the AAD graph + * to which access is being granted through this Role Assignment. Tenant ID + * for the principal is inferred using the tenant associated with the + * subscription. + */ + @JsonProperty(value = "properties.principalId") + private String principalId; + + /** + * Get the unique identifier for the associated Role Definition. + * + * @return the roleDefinitionId value + */ + public String roleDefinitionId() { + return this.roleDefinitionId; + } + + /** + * Set the unique identifier for the associated Role Definition. + * + * @param roleDefinitionId the roleDefinitionId value to set + * @return the SqlRoleAssignmentGetResultsInner object itself. + */ + public SqlRoleAssignmentGetResultsInner withRoleDefinitionId(String roleDefinitionId) { + this.roleDefinitionId = roleDefinitionId; + return this; + } + + /** + * Get the data plane resource path for which access is being granted through this Role Assignment. + * + * @return the scope value + */ + public String scope() { + return this.scope; + } + + /** + * Set the data plane resource path for which access is being granted through this Role Assignment. + * + * @param scope the scope value to set + * @return the SqlRoleAssignmentGetResultsInner object itself. + */ + public SqlRoleAssignmentGetResultsInner withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the unique identifier for the associated AAD principal in the AAD graph to which access is being granted through this Role Assignment. Tenant ID for the principal is inferred using the tenant associated with the subscription. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the unique identifier for the associated AAD principal in the AAD graph to which access is being granted through this Role Assignment. Tenant ID for the principal is inferred using the tenant associated with the subscription. + * + * @param principalId the principalId value to set + * @return the SqlRoleAssignmentGetResultsInner object itself. + */ + public SqlRoleAssignmentGetResultsInner withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + +} diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/SqlRoleDefinitionGetResultsImpl.java b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/SqlRoleDefinitionGetResultsImpl.java new file mode 100644 index 0000000000000..51c582138d1fd --- /dev/null +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/SqlRoleDefinitionGetResultsImpl.java @@ -0,0 +1,163 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.implementation; + +import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SqlRoleDefinitionGetResults; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.SqlRoleDefinitionCreateUpdateParameters; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.Permission; +import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.RoleDefinitionType; +import rx.functions.Func1; + +class SqlRoleDefinitionGetResultsImpl extends CreatableUpdatableImpl implements SqlRoleDefinitionGetResults, SqlRoleDefinitionGetResults.Definition, SqlRoleDefinitionGetResults.Update { + private final CosmosDBManager manager; + private String roleDefinitionId; + private String resourceGroupName; + private String accountName; + private SqlRoleDefinitionCreateUpdateParameters createOrUpdateParameter; + + SqlRoleDefinitionGetResultsImpl(String name, CosmosDBManager manager) { + super(name, new SqlRoleDefinitionGetResultsInner()); + this.manager = manager; + // Set resource name + this.roleDefinitionId = name; + // + this.createOrUpdateParameter = new SqlRoleDefinitionCreateUpdateParameters(); + } + + SqlRoleDefinitionGetResultsImpl(SqlRoleDefinitionGetResultsInner inner, CosmosDBManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.roleDefinitionId = inner.name(); + // set resource ancestor and positional variables + this.roleDefinitionId = IdParsingUtils.getValueFromIdByName(inner.id(), "sqlRoleDefinitions"); + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "databaseAccounts"); + // + this.createOrUpdateParameter = new SqlRoleDefinitionCreateUpdateParameters(); + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + SqlResourcesInner client = this.manager().inner().sqlResources(); + return client.createUpdateSqlRoleDefinitionAsync(this.roleDefinitionId, this.resourceGroupName, this.accountName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public SqlRoleDefinitionGetResultsInner call(SqlRoleDefinitionGetResultsInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + SqlResourcesInner client = this.manager().inner().sqlResources(); + return client.createUpdateSqlRoleDefinitionAsync(this.roleDefinitionId, this.resourceGroupName, this.accountName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public SqlRoleDefinitionGetResultsInner call(SqlRoleDefinitionGetResultsInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + SqlResourcesInner client = this.manager().inner().sqlResources(); + return client.getSqlRoleDefinitionAsync(this.roleDefinitionId, this.resourceGroupName, this.accountName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new SqlRoleDefinitionCreateUpdateParameters(); + } + + @Override + public List assignableScopes() { + return this.inner().assignableScopes(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List permissions() { + return this.inner().permissions(); + } + + @Override + public String roleName() { + return this.inner().roleName(); + } + + @Override + public RoleDefinitionType sqlRoleDefinitionGetResultsType() { + return this.inner().sqlRoleDefinitionGetResultsType(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public SqlRoleDefinitionGetResultsImpl withExistingDatabaseAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public SqlRoleDefinitionGetResultsImpl withAssignableScopes(List assignableScopes) { + this.createOrUpdateParameter.withAssignableScopes(assignableScopes); + return this; + } + + @Override + public SqlRoleDefinitionGetResultsImpl withPermissions(List permissions) { + this.createOrUpdateParameter.withPermissions(permissions); + return this; + } + + @Override + public SqlRoleDefinitionGetResultsImpl withRoleName(String roleName) { + this.createOrUpdateParameter.withRoleName(roleName); + return this; + } + + @Override + public SqlRoleDefinitionGetResultsImpl withType(RoleDefinitionType type) { + this.createOrUpdateParameter.withType(type); + return this; + } + +} diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/SqlRoleDefinitionGetResultsInner.java b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/SqlRoleDefinitionGetResultsInner.java new file mode 100644 index 0000000000000..82d5294f3ba83 --- /dev/null +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/SqlRoleDefinitionGetResultsInner.java @@ -0,0 +1,134 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.implementation; + +import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.RoleDefinitionType; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.Permission; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.ARMProxyResource; + +/** + * An Azure Cosmos DB SQL Role Definition. + */ +@JsonFlatten +public class SqlRoleDefinitionGetResultsInner extends ARMProxyResource { + /** + * A user-friendly name for the Role Definition. Must be unique for the + * database account. + */ + @JsonProperty(value = "properties.roleName") + private String roleName; + + /** + * Indicates whether the Role Definition was built-in or user created. + * Possible values include: 'BuiltInRole', 'CustomRole'. + */ + @JsonProperty(value = "properties.type") + private RoleDefinitionType sqlRoleDefinitionGetResultsType; + + /** + * A set of fully qualified Scopes at or below which Role Assignments may + * be created using this Role Definition. This will allow application of + * this Role Definition on the entire database account or any underlying + * Database / Collection. Must have at least one element. Scopes higher + * than Database account are not enforceable as assignable Scopes. Note + * that resources referenced in assignable Scopes need not exist. + */ + @JsonProperty(value = "properties.assignableScopes") + private List assignableScopes; + + /** + * The set of operations allowed through this Role Definition. + */ + @JsonProperty(value = "properties.permissions") + private List permissions; + + /** + * Get a user-friendly name for the Role Definition. Must be unique for the database account. + * + * @return the roleName value + */ + public String roleName() { + return this.roleName; + } + + /** + * Set a user-friendly name for the Role Definition. Must be unique for the database account. + * + * @param roleName the roleName value to set + * @return the SqlRoleDefinitionGetResultsInner object itself. + */ + public SqlRoleDefinitionGetResultsInner withRoleName(String roleName) { + this.roleName = roleName; + return this; + } + + /** + * Get indicates whether the Role Definition was built-in or user created. Possible values include: 'BuiltInRole', 'CustomRole'. + * + * @return the sqlRoleDefinitionGetResultsType value + */ + public RoleDefinitionType sqlRoleDefinitionGetResultsType() { + return this.sqlRoleDefinitionGetResultsType; + } + + /** + * Set indicates whether the Role Definition was built-in or user created. Possible values include: 'BuiltInRole', 'CustomRole'. + * + * @param sqlRoleDefinitionGetResultsType the sqlRoleDefinitionGetResultsType value to set + * @return the SqlRoleDefinitionGetResultsInner object itself. + */ + public SqlRoleDefinitionGetResultsInner withSqlRoleDefinitionGetResultsType(RoleDefinitionType sqlRoleDefinitionGetResultsType) { + this.sqlRoleDefinitionGetResultsType = sqlRoleDefinitionGetResultsType; + return this; + } + + /** + * Get a set of fully qualified Scopes at or below which Role Assignments may be created using this Role Definition. This will allow application of this Role Definition on the entire database account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not exist. + * + * @return the assignableScopes value + */ + public List assignableScopes() { + return this.assignableScopes; + } + + /** + * Set a set of fully qualified Scopes at or below which Role Assignments may be created using this Role Definition. This will allow application of this Role Definition on the entire database account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not exist. + * + * @param assignableScopes the assignableScopes value to set + * @return the SqlRoleDefinitionGetResultsInner object itself. + */ + public SqlRoleDefinitionGetResultsInner withAssignableScopes(List assignableScopes) { + this.assignableScopes = assignableScopes; + return this; + } + + /** + * Get the set of operations allowed through this Role Definition. + * + * @return the permissions value + */ + public List permissions() { + return this.permissions; + } + + /** + * Set the set of operations allowed through this Role Definition. + * + * @param permissions the permissions value to set + * @return the SqlRoleDefinitionGetResultsInner object itself. + */ + public SqlRoleDefinitionGetResultsInner withPermissions(List permissions) { + this.permissions = permissions; + return this; + } + +} diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/package-info.java b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/package-info.java index a9155c8b80ec9..54e661d9b5eb2 100644 --- a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/package-info.java +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/implementation/package-info.java @@ -6,6 +6,5 @@ /** * This package contains the implementation classes for CosmosDBManagementClient. - * Azure Cosmos DB Database Service Resource Provider REST API. */ package com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.implementation; diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/package-info.java b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/package-info.java index 0f4c17ee6b0c9..22c827d8bec47 100644 --- a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/package-info.java +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/package-info.java @@ -6,6 +6,5 @@ /** * This package contains the classes for CosmosDBManagementClient. - * Azure Cosmos DB Database Service Resource Provider REST API. */ package com.microsoft.azure.management.cosmosdb.v2020_06_01_preview;