diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/pom.xml b/sdk/cosmos/mgmt-v2020_06_01_preview/pom.xml index 15cf60e245bf..fe8e8b2e577f 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/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 000000000000..950b4e519deb --- /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 a99600e338ac..747bfaec66cb 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 02b163b9e44b..0f766a9206a5 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 afe131f450fa..09928e439e63 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.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. */ 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 6209fe30a628..de4acc4870fa 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,12 @@ 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; + /** * Get the tags value. * @@ -519,4 +525,24 @@ 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; + } + } diff --git a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/ErrorResponseUpdatedFormat.java b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/ErrorResponseUpdatedFormat.java new file mode 100644 index 000000000000..bed10796d1c9 --- /dev/null +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/ErrorResponseUpdatedFormat.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 ErrorResponseUpdatedFormat { + /** + * 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 ErrorResponseUpdatedFormat object itself. + */ + public ErrorResponseUpdatedFormat 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/ErrorResponseUpdatedFormatException.java b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/ErrorResponseUpdatedFormatException.java index ac2df771c105..1d63336a79d5 100644 --- a/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/ErrorResponseUpdatedFormatException.java +++ b/sdk/cosmos/mgmt-v2020_06_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_06_01_preview/ErrorResponseUpdatedFormatException.java @@ -8,7 +8,6 @@ package com.microsoft.azure.management.cosmosdb.v2020_06_01_preview; -import com.microsoft.azure.CloudError; import com.microsoft.rest.RestException; import okhttp3.ResponseBody; import retrofit2.Response; @@ -35,12 +34,12 @@ public ErrorResponseUpdatedFormatException(final String message, final Response< * @param response the HTTP response * @param body the deserialized response body */ - public ErrorResponseUpdatedFormatException(final String message, final Response response, final ErrorResponse body) { + public ErrorResponseUpdatedFormatException(final String message, final Response response, final ErrorResponseUpdatedFormat body) { super(message, response, body); } @Override - public ErrorResponse body() { - return (ErrorResponse) super.body(); + public ErrorResponseUpdatedFormat body() { + return (ErrorResponseUpdatedFormat) super.body(); } } 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 a95471cc22b1..1c78c6002f90 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; @@ -31,6 +32,7 @@ import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.RestoreParameters; 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.DatabaseAccountCreateUpdateProperties; import com.microsoft.azure.management.cosmosdb.v2020_06_01_preview.ManagedServiceIdentity; import rx.functions.Func1; @@ -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,8 +253,8 @@ public List writeLocations() { } @Override - public DatabaseAccountGetResultsImpl withDatabaseAccountOfferType(String databaseAccountOfferType) { - this.createParameter.withDatabaseAccountOfferType(databaseAccountOfferType); + public DatabaseAccountGetResultsImpl withProperties(DatabaseAccountCreateUpdateProperties properties) { + this.createParameter.withProperties(properties); return this; } @@ -263,173 +270,111 @@ 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) { - if (isInCreateMode()) { - this.createParameter.withVirtualNetworkRules(virtualNetworkRules); - } else { - this.updateParameter.withVirtualNetworkRules(virtualNetworkRules); - } + this.updateParameter.withVirtualNetworkRules(virtualNetworkRules); 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 407e6ca771a3..4a4d6301d546 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 eb47449f6e96..b03f772ac5a2 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) {