diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/pom.xml b/sdk/appconfiguration/mgmt-v2020_07_01_preview/pom.xml new file mode 100644 index 000000000000..77a7c87483ae --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.appconfiguration.v2020_07_01_preview + + com.microsoft.azure + azure-arm-parent + 1.1.0 + ../../../pom.management.xml + + azure-mgmt-appconfiguration + 1.0.0-beta + jar + Microsoft Azure SDK for AppConfiguration Management + This package contains Microsoft AppConfiguration Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + 1.6.5 + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ActionsRequired.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ActionsRequired.java new file mode 100644 index 000000000000..27f960f9b3e1 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ActionsRequired.java @@ -0,0 +1,41 @@ +/** + * 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.appconfiguration.v2020_07_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ActionsRequired. + */ +public final class ActionsRequired extends ExpandableStringEnum { + /** Static value None for ActionsRequired. */ + public static final ActionsRequired NONE = fromString("None"); + + /** Static value Recreate for ActionsRequired. */ + public static final ActionsRequired RECREATE = fromString("Recreate"); + + /** + * Creates or finds a ActionsRequired from its string representation. + * @param name a name to look for + * @return the corresponding ActionsRequired + */ + @JsonCreator + public static ActionsRequired fromString(String name) { + return fromString(name, ActionsRequired.class); + } + + /** + * @return known ActionsRequired values + */ + public static Collection values() { + return values(ActionsRequired.class); + } +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ApiKey.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ApiKey.java new file mode 100644 index 000000000000..da36124a2fdd --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ApiKey.java @@ -0,0 +1,51 @@ +/** + * 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.appconfiguration.v2020_07_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.implementation.AppConfigurationManager; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.implementation.ApiKeyInner; +import org.joda.time.DateTime; + +/** + * Type representing ApiKey. + */ +public interface ApiKey extends HasInner, HasManager { + /** + * @return the connectionString value. + */ + String connectionString(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastModified value. + */ + DateTime lastModified(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the readOnly value. + */ + Boolean readOnly(); + + /** + * @return the value value. + */ + String value(); + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/CheckNameAvailabilityParameters.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/CheckNameAvailabilityParameters.java new file mode 100644 index 000000000000..1bdc68df74ff --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/CheckNameAvailabilityParameters.java @@ -0,0 +1,77 @@ +/** + * 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.appconfiguration.v2020_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters used for checking whether a resource name is available. + */ +public class CheckNameAvailabilityParameters { + /** + * The name to check for availability. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The resource type to check for name availability. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Creates an instance of CheckNameAvailabilityParameters class. + * @param name the name to check for availability. + */ + public CheckNameAvailabilityParameters() { + type = "Microsoft.AppConfiguration/configurationStores"; + } + + /** + * Get the name to check for availability. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name to check for availability. + * + * @param name the name value to set + * @return the CheckNameAvailabilityParameters object itself. + */ + public CheckNameAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the resource type to check for name availability. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the resource type to check for name availability. + * + * @param type the type value to set + * @return the CheckNameAvailabilityParameters object itself. + */ + public CheckNameAvailabilityParameters withType(String type) { + this.type = type; + return this; + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ConfigurationStore.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ConfigurationStore.java new file mode 100644 index 000000000000..552ee953c21d --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ConfigurationStore.java @@ -0,0 +1,194 @@ +/** + * 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.appconfiguration.v2020_07_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +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.appconfiguration.v2020_07_01_preview.implementation.AppConfigurationManager; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.implementation.ConfigurationStoreInner; + +/** + * Type representing ConfigurationStore. + */ +public interface ConfigurationStore extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the creationDate value. + */ + DateTime creationDate(); + + /** + * @return the encryption value. + */ + EncryptionProperties encryption(); + + /** + * @return the endpoint value. + */ + String endpoint(); + + /** + * @return the identity value. + */ + ResourceIdentity identity(); + + /** + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the publicNetworkAccess value. + */ + PublicNetworkAccess publicNetworkAccess(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * The entirety of the ConfigurationStore definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithSku, DefinitionStages.WithCreate { + } + + /** + * Grouping of ConfigurationStore definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ConfigurationStore definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ConfigurationStore definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the configurationstore definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The sku of the configuration store + * @return the next definition stage +*/ + WithCreate withSku(Sku sku); + } + + /** + * The stage of the configurationstore definition allowing to specify Encryption. + */ + interface WithEncryption { + /** + * Specifies encryption. + * @param encryption The encryption settings of the configuration store + * @return the next definition stage + */ + WithCreate withEncryption(EncryptionProperties encryption); + } + + /** + * The stage of the configurationstore definition allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity The managed identity information, if configured + * @return the next definition stage + */ + WithCreate withIdentity(ResourceIdentity identity); + } + + /** + * The stage of the configurationstore definition allowing to specify PublicNetworkAccess. + */ + interface WithPublicNetworkAccess { + /** + * Specifies publicNetworkAccess. + * @param publicNetworkAccess Control permission for data plane traffic coming from public networks while private endpoint is enabled. Possible values include: 'Enabled', 'Disabled' + * @return the next definition stage + */ + WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + + /** + * 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.WithEncryption, DefinitionStages.WithIdentity, DefinitionStages.WithPublicNetworkAccess { + } + } + /** + * The template for a ConfigurationStore update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithEncryption, UpdateStages.WithIdentity, UpdateStages.WithSku { + } + + /** + * Grouping of ConfigurationStore update stages. + */ + interface UpdateStages { + /** + * The stage of the configurationstore update allowing to specify Encryption. + */ + interface WithEncryption { + /** + * Specifies encryption. + * @param encryption The encryption settings of the configuration store + * @return the next update stage + */ + Update withEncryption(EncryptionProperties encryption); + } + + /** + * The stage of the configurationstore update allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity The managed identity information for the configuration store + * @return the next update stage + */ + Update withIdentity(ResourceIdentity identity); + } + + /** + * The stage of the configurationstore update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The SKU of the configuration store + * @return the next update stage + */ + Update withSku(Sku sku); + } + + } +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ConfigurationStoreUpdateParameters.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ConfigurationStoreUpdateParameters.java new file mode 100644 index 000000000000..81e184a67a10 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ConfigurationStoreUpdateParameters.java @@ -0,0 +1,124 @@ +/** + * 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.appconfiguration.v2020_07_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters for updating a configuration store. + */ +@JsonFlatten +public class ConfigurationStoreUpdateParameters { + /** + * The encryption settings of the configuration store. + */ + @JsonProperty(value = "properties.encryption") + private EncryptionProperties encryption; + + /** + * The managed identity information for the configuration store. + */ + @JsonProperty(value = "identity") + private ResourceIdentity identity; + + /** + * The SKU of the configuration store. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * The ARM resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the encryption settings of the configuration store. + * + * @return the encryption value + */ + public EncryptionProperties encryption() { + return this.encryption; + } + + /** + * Set the encryption settings of the configuration store. + * + * @param encryption the encryption value to set + * @return the ConfigurationStoreUpdateParameters object itself. + */ + public ConfigurationStoreUpdateParameters withEncryption(EncryptionProperties encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get the managed identity information for the configuration store. + * + * @return the identity value + */ + public ResourceIdentity identity() { + return this.identity; + } + + /** + * Set the managed identity information for the configuration store. + * + * @param identity the identity value to set + * @return the ConfigurationStoreUpdateParameters object itself. + */ + public ConfigurationStoreUpdateParameters withIdentity(ResourceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the SKU of the configuration store. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the SKU of the configuration store. + * + * @param sku the sku value to set + * @return the ConfigurationStoreUpdateParameters object itself. + */ + public ConfigurationStoreUpdateParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the ARM resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the ARM resource tags. + * + * @param tags the tags value to set + * @return the ConfigurationStoreUpdateParameters object itself. + */ + public ConfigurationStoreUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ConfigurationStores.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ConfigurationStores.java new file mode 100644 index 000000000000..2d4190aefd71 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ConfigurationStores.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.appconfiguration.v2020_07_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.implementation.ConfigurationStoresInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ConfigurationStores. + */ +public interface ConfigurationStores extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Lists the access key for the specified configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listKeysAsync(final String resourceGroupName, final String configStoreName); + + /** + * Regenerates an access key for the specified configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateKeyAsync(String resourceGroupName, String configStoreName); + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ConnectionStatus.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ConnectionStatus.java new file mode 100644 index 000000000000..adece8282fc8 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ConnectionStatus.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.appconfiguration.v2020_07_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ConnectionStatus. + */ +public final class ConnectionStatus extends ExpandableStringEnum { + /** Static value Pending for ConnectionStatus. */ + public static final ConnectionStatus PENDING = fromString("Pending"); + + /** Static value Approved for ConnectionStatus. */ + public static final ConnectionStatus APPROVED = fromString("Approved"); + + /** Static value Rejected for ConnectionStatus. */ + public static final ConnectionStatus REJECTED = fromString("Rejected"); + + /** Static value Disconnected for ConnectionStatus. */ + public static final ConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** + * Creates or finds a ConnectionStatus from its string representation. + * @param name a name to look for + * @return the corresponding ConnectionStatus + */ + @JsonCreator + public static ConnectionStatus fromString(String name) { + return fromString(name, ConnectionStatus.class); + } + + /** + * @return known ConnectionStatus values + */ + public static Collection values() { + return values(ConnectionStatus.class); + } +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/EncryptionProperties.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/EncryptionProperties.java new file mode 100644 index 000000000000..40fc278625e1 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/EncryptionProperties.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.appconfiguration.v2020_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The encryption settings for a configuration store. + */ +public class EncryptionProperties { + /** + * Key vault properties. + */ + @JsonProperty(value = "keyVaultProperties") + private KeyVaultProperties keyVaultProperties; + + /** + * Get key vault properties. + * + * @return the keyVaultProperties value + */ + public KeyVaultProperties keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set key vault properties. + * + * @param keyVaultProperties the keyVaultProperties value to set + * @return the EncryptionProperties object itself. + */ + public EncryptionProperties withKeyVaultProperties(KeyVaultProperties keyVaultProperties) { + this.keyVaultProperties = keyVaultProperties; + return this; + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ErrorAdditionalInfo.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ErrorAdditionalInfo.java new file mode 100644 index 000000000000..c4cc831d86af --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ErrorAdditionalInfo.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.appconfiguration.v2020_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource management error additional info. + */ +public class ErrorAdditionalInfo { + /** + * The additional info type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * The additional info. + */ + @JsonProperty(value = "info", access = JsonProperty.Access.WRITE_ONLY) + private Object info; + + /** + * Get the additional info type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get the additional info. + * + * @return the info value + */ + public Object info() { + return this.info; + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ErrorDetails.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ErrorDetails.java new file mode 100644 index 000000000000..bebbf741f1c3 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ErrorDetails.java @@ -0,0 +1,63 @@ +/** + * 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.appconfiguration.v2020_07_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The details of the error. + */ +public class ErrorDetails { + /** + * Error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * Error message indicating why the operation failed. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * The error additional info. + */ + @JsonProperty(value = "additionalInfo", access = JsonProperty.Access.WRITE_ONLY) + private List additionalInfo; + + /** + * Get error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get error message indicating why the operation failed. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the error additional info. + * + * @return the additionalInfo value + */ + public List additionalInfo() { + return this.additionalInfo; + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ErrorResponse.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ErrorResponse.java new file mode 100644 index 000000000000..ec815014e2b4 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ErrorResponse.java @@ -0,0 +1,44 @@ +/** + * 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.appconfiguration.v2020_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error response indicates that the service is not able to process the + * incoming request. The reason is provided in the error message. + */ +public class ErrorResponse { + /** + * The details of the error. + */ + @JsonProperty(value = "error") + private ErrorDetails error; + + /** + * Get the details of the error. + * + * @return the error value + */ + public ErrorDetails error() { + return this.error; + } + + /** + * Set the details of the error. + * + * @param error the error value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withError(ErrorDetails error) { + this.error = error; + return this; + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ErrorResponseException.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ErrorResponseException.java new file mode 100644 index 000000000000..f9a7bf8c742b --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ErrorResponseException.java @@ -0,0 +1,44 @@ +/** + * 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.appconfiguration.v2020_07_01_preview; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException 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 ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.body(); + } +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/IdentityType.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/IdentityType.java new file mode 100644 index 000000000000..a048c1963f1a --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/IdentityType.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.appconfiguration.v2020_07_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IdentityType. + */ +public final class IdentityType extends ExpandableStringEnum { + /** Static value None for IdentityType. */ + public static final IdentityType NONE = fromString("None"); + + /** Static value SystemAssigned for IdentityType. */ + public static final IdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** Static value UserAssigned for IdentityType. */ + public static final IdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** Static value SystemAssigned, UserAssigned for IdentityType. */ + public static final IdentityType SYSTEM_ASSIGNED_USER_ASSIGNED = fromString("SystemAssigned, UserAssigned"); + + /** + * Creates or finds a IdentityType from its string representation. + * @param name a name to look for + * @return the corresponding IdentityType + */ + @JsonCreator + public static IdentityType fromString(String name) { + return fromString(name, IdentityType.class); + } + + /** + * @return known IdentityType values + */ + public static Collection values() { + return values(IdentityType.class); + } +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/KeyValue.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/KeyValue.java new file mode 100644 index 000000000000..1e1f1cd1329b --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/KeyValue.java @@ -0,0 +1,204 @@ +/** + * 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.appconfiguration.v2020_07_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.implementation.KeyValueInner; +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.appconfiguration.v2020_07_01_preview.implementation.AppConfigurationManager; +import org.joda.time.DateTime; +import java.util.Map; + +/** + * Type representing KeyValue. + */ +public interface KeyValue extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the contentType value. + */ + String contentType(); + + /** + * @return the eTag value. + */ + String eTag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the key value. + */ + String keyVal(); + + /** + * @return the label value. + */ + String label(); + + /** + * @return the lastModified value. + */ + DateTime lastModified(); + + /** + * @return the locked value. + */ + Boolean locked(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the value value. + */ + String value(); + + /** + * The entirety of the KeyValue definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithConfigurationStore, DefinitionStages.WithCreate { + } + + /** + * Grouping of KeyValue definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a KeyValue definition. + */ + interface Blank extends WithConfigurationStore { + } + + /** + * The stage of the keyvalue definition allowing to specify ConfigurationStore. + */ + interface WithConfigurationStore { + /** + * Specifies resourceGroupName, configStoreName. + * @param resourceGroupName The name of the resource group to which the container registry belongs + * @param configStoreName The name of the configuration store + * @return the next definition stage + */ + WithCreate withExistingConfigurationStore(String resourceGroupName, String configStoreName); + } + + /** + * The stage of the keyvalue definition allowing to specify ContentType. + */ + interface WithContentType { + /** + * Specifies contentType. + * @param contentType The content type of the key-value's value. + Providing a proper content-type can enable transformations of values when they are retrieved by applications + * @return the next definition stage + */ + WithCreate withContentType(String contentType); + } + + /** + * The stage of the keyvalue definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags A dictionary of tags that can help identify what a key-value may be applicable for + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the keyvalue definition allowing to specify Value. + */ + interface WithValue { + /** + * Specifies value. + * @param value The value of the key-value + * @return the next definition stage + */ + WithCreate withValue(String value); + } + + /** + * 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.WithContentType, DefinitionStages.WithTags, DefinitionStages.WithValue { + } + } + /** + * The template for a KeyValue update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithContentType, UpdateStages.WithTags, UpdateStages.WithValue { + } + + /** + * Grouping of KeyValue update stages. + */ + interface UpdateStages { + /** + * The stage of the keyvalue update allowing to specify ContentType. + */ + interface WithContentType { + /** + * Specifies contentType. + * @param contentType The content type of the key-value's value. + Providing a proper content-type can enable transformations of values when they are retrieved by applications + * @return the next update stage + */ + Update withContentType(String contentType); + } + + /** + * The stage of the keyvalue update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags A dictionary of tags that can help identify what a key-value may be applicable for + * @return the next update stage + */ + Update withTags(Map tags); + } + + /** + * The stage of the keyvalue update allowing to specify Value. + */ + interface WithValue { + /** + * Specifies value. + * @param value The value of the key-value + * @return the next update stage + */ + Update withValue(String value); + } + + } +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/KeyValues.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/KeyValues.java new file mode 100644 index 000000000000..722597195005 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/KeyValues.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.appconfiguration.v2020_07_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.implementation.KeyValuesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing KeyValues. + */ +public interface KeyValues extends SupportsCreating, HasInner { + /** + * Gets the properties of the specified key-value. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String configStoreName, String keyValueName); + + /** + * Lists the key-values for a given configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByConfigurationStoreAsync(final String resourceGroupName, final String configStoreName); + + /** + * Deletes a key-value. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String configStoreName, String keyValueName); + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/KeyVaultProperties.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/KeyVaultProperties.java new file mode 100644 index 000000000000..4482031f17c5 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/KeyVaultProperties.java @@ -0,0 +1,69 @@ +/** + * 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.appconfiguration.v2020_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Settings concerning key vault encryption for a configuration store. + */ +public class KeyVaultProperties { + /** + * The URI of the key vault key used to encrypt data. + */ + @JsonProperty(value = "keyIdentifier") + private String keyIdentifier; + + /** + * The client id of the identity which will be used to access key vault. + */ + @JsonProperty(value = "identityClientId") + private String identityClientId; + + /** + * Get the URI of the key vault key used to encrypt data. + * + * @return the keyIdentifier value + */ + public String keyIdentifier() { + return this.keyIdentifier; + } + + /** + * Set the URI of the key vault key used to encrypt data. + * + * @param keyIdentifier the keyIdentifier value to set + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyIdentifier(String keyIdentifier) { + this.keyIdentifier = keyIdentifier; + return this; + } + + /** + * Get the client id of the identity which will be used to access key vault. + * + * @return the identityClientId value + */ + public String identityClientId() { + return this.identityClientId; + } + + /** + * Set the client id of the identity which will be used to access key vault. + * + * @param identityClientId the identityClientId value to set + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withIdentityClientId(String identityClientId) { + this.identityClientId = identityClientId; + return this; + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/LogSpecification.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/LogSpecification.java new file mode 100644 index 000000000000..413f144e9679 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/LogSpecification.java @@ -0,0 +1,95 @@ +/** + * 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.appconfiguration.v2020_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifications of the Log for Azure Monitoring. + */ +public class LogSpecification { + /** + * Name of the log. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Localized friendly display name of the log. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Blob duration of the log. + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** + * Get name of the log. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the log. + * + * @param name the name value to set + * @return the LogSpecification object itself. + */ + public LogSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get localized friendly display name of the log. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set localized friendly display name of the log. + * + * @param displayName the displayName value to set + * @return the LogSpecification object itself. + */ + public LogSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get blob duration of the log. + * + * @return the blobDuration value + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set blob duration of the log. + * + * @param blobDuration the blobDuration value to set + * @return the LogSpecification object itself. + */ + public LogSpecification withBlobDuration(String blobDuration) { + this.blobDuration = blobDuration; + return this; + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/MetricDimension.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/MetricDimension.java new file mode 100644 index 000000000000..2a4a89e74c75 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/MetricDimension.java @@ -0,0 +1,95 @@ +/** + * 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.appconfiguration.v2020_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifications of the Dimension of metrics. + */ +public class MetricDimension { + /** + * Name of the dimension. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Localized friendly display name of the dimension. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Internal name of the dimension. + */ + @JsonProperty(value = "internalName") + private String internalName; + + /** + * Get name of the dimension. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the dimension. + * + * @param name the name value to set + * @return the MetricDimension object itself. + */ + public MetricDimension withName(String name) { + this.name = name; + return this; + } + + /** + * Get localized friendly display name of the dimension. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set localized friendly display name of the dimension. + * + * @param displayName the displayName value to set + * @return the MetricDimension object itself. + */ + public MetricDimension withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get internal name of the dimension. + * + * @return the internalName value + */ + public String internalName() { + return this.internalName; + } + + /** + * Set internal name of the dimension. + * + * @param internalName the internalName value to set + * @return the MetricDimension object itself. + */ + public MetricDimension withInternalName(String internalName) { + this.internalName = internalName; + return this; + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/MetricSpecification.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/MetricSpecification.java new file mode 100644 index 000000000000..eeebc30333c4 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/MetricSpecification.java @@ -0,0 +1,201 @@ +/** + * 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.appconfiguration.v2020_07_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifications of the Metrics for Azure Monitoring. + */ +public class MetricSpecification { + /** + * Name of the metric. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Localized friendly display name of the metric. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Localized friendly description of the metric. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /** + * Unit that makes sense for the metric. + */ + @JsonProperty(value = "unit") + private String unit; + + /** + * Only provide one value for this field. Valid values: Average, Minimum, + * Maximum, Total, Count. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /** + * Internal metric name. + */ + @JsonProperty(value = "internalMetricName") + private String internalMetricName; + + /** + * Dimensions of the metric. + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /** + * Get name of the metric. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the metric. + * + * @param name the name value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get localized friendly display name of the metric. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set localized friendly display name of the metric. + * + * @param displayName the displayName value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get localized friendly description of the metric. + * + * @return the displayDescription value + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set localized friendly description of the metric. + * + * @param displayDescription the displayDescription value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get unit that makes sense for the metric. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set unit that makes sense for the metric. + * + * @param unit the unit value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get only provide one value for this field. Valid values: Average, Minimum, Maximum, Total, Count. + * + * @return the aggregationType value + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set only provide one value for this field. Valid values: Average, Minimum, Maximum, Total, Count. + * + * @param aggregationType the aggregationType value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get internal metric name. + * + * @return the internalMetricName value + */ + public String internalMetricName() { + return this.internalMetricName; + } + + /** + * Set internal metric name. + * + * @param internalMetricName the internalMetricName value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withInternalMetricName(String internalMetricName) { + this.internalMetricName = internalMetricName; + return this; + } + + /** + * Get dimensions of the metric. + * + * @return the dimensions value + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set dimensions of the metric. + * + * @param dimensions the dimensions value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/NameAvailabilityStatus.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/NameAvailabilityStatus.java new file mode 100644 index 000000000000..cee32698520f --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/NameAvailabilityStatus.java @@ -0,0 +1,35 @@ +/** + * 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.appconfiguration.v2020_07_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.implementation.AppConfigurationManager; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.implementation.NameAvailabilityStatusInner; + +/** + * Type representing NameAvailabilityStatus. + */ +public interface NameAvailabilityStatus extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + String reason(); + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/OperationDefinition.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/OperationDefinition.java new file mode 100644 index 000000000000..053b8839e6dc --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/OperationDefinition.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.appconfiguration.v2020_07_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.implementation.AppConfigurationManager; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.implementation.OperationDefinitionInner; + +/** + * Type representing OperationDefinition. + */ +public interface OperationDefinition extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDefinitionDisplay display(); + + /** + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the origin value. + */ + String origin(); + + /** + * @return the properties value. + */ + OperationProperties properties(); + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/OperationDefinitionDisplay.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/OperationDefinitionDisplay.java new file mode 100644 index 000000000000..c10bb7143c13 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/OperationDefinitionDisplay.java @@ -0,0 +1,110 @@ +/** + * 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.appconfiguration.v2020_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The display information for a configuration store operation. + */ +public class OperationDefinitionDisplay { + /** + * The resource provider name: Microsoft App Configuration.". + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** + * The resource on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * The operation that users can perform. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * The description for the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the resource provider name: Microsoft App Configuration.". + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource on which the operation is performed. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource on which the operation is performed. + * + * @param resource the resource value to set + * @return the OperationDefinitionDisplay object itself. + */ + public OperationDefinitionDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation that users can perform. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation that users can perform. + * + * @param operation the operation value to set + * @return the OperationDefinitionDisplay object itself. + */ + public OperationDefinitionDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description for the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description for the operation. + * + * @param description the description value to set + * @return the OperationDefinitionDisplay object itself. + */ + public OperationDefinitionDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/OperationProperties.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/OperationProperties.java new file mode 100644 index 000000000000..2bd0f7311382 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/OperationProperties.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.appconfiguration.v2020_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Extra Operation properties. + */ +public class OperationProperties { + /** + * Service specifications of the operation. + */ + @JsonProperty(value = "serviceSpecification") + private ServiceSpecification serviceSpecification; + + /** + * Get service specifications of the operation. + * + * @return the serviceSpecification value + */ + public ServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set service specifications of the operation. + * + * @param serviceSpecification the serviceSpecification value to set + * @return the OperationProperties object itself. + */ + public OperationProperties withServiceSpecification(ServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/Operations.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/Operations.java new file mode 100644 index 000000000000..c8842ca28c2a --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/Operations.java @@ -0,0 +1,36 @@ +/** + * 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.appconfiguration.v2020_07_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Checks whether the configuration store name is available for use. + * + * @param name The name to check for availability. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String name); + + /** + * Lists the operations available from this provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/PrivateEndpoint.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/PrivateEndpoint.java new file mode 100644 index 000000000000..ad06e03f5393 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/PrivateEndpoint.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.appconfiguration.v2020_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Private endpoint which a connection belongs to. + */ +public class PrivateEndpoint { + /** + * The resource Id for private endpoint. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the resource Id for private endpoint. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the resource Id for private endpoint. + * + * @param id the id value to set + * @return the PrivateEndpoint object itself. + */ + public PrivateEndpoint withId(String id) { + this.id = id; + return this; + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/PrivateEndpointConnection.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/PrivateEndpointConnection.java new file mode 100644 index 000000000000..306741e24e20 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/PrivateEndpointConnection.java @@ -0,0 +1,139 @@ +/** + * 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.appconfiguration.v2020_07_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.implementation.PrivateEndpointConnectionInner; +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.appconfiguration.v2020_07_01_preview.implementation.AppConfigurationManager; + +/** + * Type representing PrivateEndpointConnection. + */ +public interface PrivateEndpointConnection extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * @return the privateLinkServiceConnectionState value. + */ + PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the PrivateEndpointConnection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithConfigurationStore, DefinitionStages.WithPrivateLinkServiceConnectionState, DefinitionStages.WithCreate { + } + + /** + * Grouping of PrivateEndpointConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a PrivateEndpointConnection definition. + */ + interface Blank extends WithConfigurationStore { + } + + /** + * The stage of the privateendpointconnection definition allowing to specify ConfigurationStore. + */ + interface WithConfigurationStore { + /** + * Specifies resourceGroupName, configStoreName. + * @param resourceGroupName The name of the resource group to which the container registry belongs + * @param configStoreName The name of the configuration store + * @return the next definition stage + */ + WithPrivateLinkServiceConnectionState withExistingConfigurationStore(String resourceGroupName, String configStoreName); + } + + /** + * The stage of the privateendpointconnection definition allowing to specify PrivateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies privateLinkServiceConnectionState. + * @param privateLinkServiceConnectionState A collection of information about the state of the connection between service consumer and provider + * @return the next definition stage + */ + WithCreate withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + + /** + * The stage of the privateendpointconnection definition allowing to specify PrivateEndpoint. + */ + interface WithPrivateEndpoint { + /** + * Specifies privateEndpoint. + * @param privateEndpoint The resource of private endpoint + * @return the next definition stage + */ + WithCreate withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + + /** + * 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.WithPrivateEndpoint { + } + } + /** + * The template for a PrivateEndpointConnection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithPrivateEndpoint { + } + + /** + * Grouping of PrivateEndpointConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the privateendpointconnection update allowing to specify PrivateEndpoint. + */ + interface WithPrivateEndpoint { + /** + * Specifies privateEndpoint. + * @param privateEndpoint The resource of private endpoint + * @return the next update stage + */ + Update withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + + } +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/PrivateEndpointConnectionReference.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/PrivateEndpointConnectionReference.java new file mode 100644 index 000000000000..23f7f38d5f51 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/PrivateEndpointConnectionReference.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.appconfiguration.v2020_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * A reference to a related private endpoint connection. + */ +@JsonFlatten +public class PrivateEndpointConnectionReference { + /** + * The resource ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The name of the resource. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * The provisioning status of the private endpoint connection. Possible + * values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', + * 'Failed', 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * The resource of private endpoint. + */ + @JsonProperty(value = "properties.privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /** + * A collection of information about the state of the connection between + * service consumer and provider. + */ + @JsonProperty(value = "properties.privateLinkServiceConnectionState", required = true) + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /** + * Get the resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the name of the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get the provisioning status of the private endpoint connection. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the resource of private endpoint. + * + * @return the privateEndpoint value + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the resource of private endpoint. + * + * @param privateEndpoint the privateEndpoint value to set + * @return the PrivateEndpointConnectionReference object itself. + */ + public PrivateEndpointConnectionReference withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get a collection of information about the state of the connection between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set a collection of information about the state of the connection between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set + * @return the PrivateEndpointConnectionReference object itself. + */ + public PrivateEndpointConnectionReference withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/PrivateEndpointConnections.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/PrivateEndpointConnections.java new file mode 100644 index 000000000000..86a7fb9ccc30 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/PrivateEndpointConnections.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.appconfiguration.v2020_07_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.implementation.PrivateEndpointConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PrivateEndpointConnections. + */ +public interface PrivateEndpointConnections extends SupportsCreating, HasInner { + /** + * Gets the specified private endpoint connection associated with the configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param privateEndpointConnectionName Private endpoint connection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String configStoreName, String privateEndpointConnectionName); + + /** + * Lists all private endpoint connections for a configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByConfigurationStoreAsync(final String resourceGroupName, final String configStoreName); + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param privateEndpointConnectionName Private endpoint connection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String configStoreName, String privateEndpointConnectionName); + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/PrivateLinkResource.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/PrivateLinkResource.java new file mode 100644 index 000000000000..7460b1bac2c4 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/PrivateLinkResource.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.appconfiguration.v2020_07_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.implementation.PrivateLinkResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.implementation.AppConfigurationManager; +import java.util.List; + +/** + * Type representing PrivateLinkResource. + */ +public interface PrivateLinkResource extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the groupId value. + */ + String groupId(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the requiredMembers value. + */ + List requiredMembers(); + + /** + * @return the requiredZoneNames value. + */ + List requiredZoneNames(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/PrivateLinkResources.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/PrivateLinkResources.java new file mode 100644 index 000000000000..67b4dd7df438 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/PrivateLinkResources.java @@ -0,0 +1,40 @@ +/** + * 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.appconfiguration.v2020_07_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.implementation.PrivateLinkResourcesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PrivateLinkResources. + */ +public interface PrivateLinkResources extends HasInner { + /** + * Gets a private link resource that need to be created for a configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param groupName The name of the private link resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String configStoreName, String groupName); + + /** + * Gets the private link resources that need to be created for a configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByConfigurationStoreAsync(final String resourceGroupName, final String configStoreName); + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/PrivateLinkServiceConnectionState.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/PrivateLinkServiceConnectionState.java new file mode 100644 index 000000000000..ac88fb3f4b8d --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/PrivateLinkServiceConnectionState.java @@ -0,0 +1,86 @@ +/** + * 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.appconfiguration.v2020_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The state of a private link service connection. + */ +public class PrivateLinkServiceConnectionState { + /** + * The private link service connection status. Possible values include: + * 'Pending', 'Approved', 'Rejected', 'Disconnected'. + */ + @JsonProperty(value = "status") + private ConnectionStatus status; + + /** + * The private link service connection description. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Any action that is required beyond basic workflow (approve/ reject/ + * disconnect). Possible values include: 'None', 'Recreate'. + */ + @JsonProperty(value = "actionsRequired", access = JsonProperty.Access.WRITE_ONLY) + private ActionsRequired actionsRequired; + + /** + * Get the private link service connection status. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected'. + * + * @return the status value + */ + public ConnectionStatus status() { + return this.status; + } + + /** + * Set the private link service connection status. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected'. + * + * @param status the status value to set + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(ConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the private link service connection description. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the private link service connection description. + * + * @param description the description value to set + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get any action that is required beyond basic workflow (approve/ reject/ disconnect). Possible values include: 'None', 'Recreate'. + * + * @return the actionsRequired value + */ + public ActionsRequired actionsRequired() { + return this.actionsRequired; + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ProvisioningState.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ProvisioningState.java new file mode 100644 index 000000000000..1a17c8c7fa81 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ProvisioningState.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.appconfiguration.v2020_07_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProvisioningState. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Creating for ProvisioningState. */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ProvisioningState. */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding ProvisioningState + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * @return known ProvisioningState values + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/PublicNetworkAccess.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/PublicNetworkAccess.java new file mode 100644 index 000000000000..2d0083c0a71f --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/PublicNetworkAccess.java @@ -0,0 +1,41 @@ +/** + * 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.appconfiguration.v2020_07_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PublicNetworkAccess. + */ +public final class PublicNetworkAccess extends ExpandableStringEnum { + /** Static value Enabled for PublicNetworkAccess. */ + public static final PublicNetworkAccess ENABLED = fromString("Enabled"); + + /** Static value Disabled for PublicNetworkAccess. */ + public static final PublicNetworkAccess DISABLED = fromString("Disabled"); + + /** + * Creates or finds a PublicNetworkAccess from its string representation. + * @param name a name to look for + * @return the corresponding PublicNetworkAccess + */ + @JsonCreator + public static PublicNetworkAccess fromString(String name) { + return fromString(name, PublicNetworkAccess.class); + } + + /** + * @return known PublicNetworkAccess values + */ + public static Collection values() { + return values(PublicNetworkAccess.class); + } +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/RegenerateKeyParameters.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/RegenerateKeyParameters.java new file mode 100644 index 000000000000..4751a6661b4d --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/RegenerateKeyParameters.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.appconfiguration.v2020_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters used to regenerate an API key. + */ +public class RegenerateKeyParameters { + /** + * The id of the key to regenerate. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id of the key to regenerate. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the id of the key to regenerate. + * + * @param id the id value to set + * @return the RegenerateKeyParameters object itself. + */ + public RegenerateKeyParameters withId(String id) { + this.id = id; + return this; + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ResourceIdentity.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ResourceIdentity.java new file mode 100644 index 000000000000..d9366d9e7735 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ResourceIdentity.java @@ -0,0 +1,109 @@ +/** + * 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.appconfiguration.v2020_07_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An identity that can be associated with a resource. + */ +public class ResourceIdentity { + /** + * The type of managed identity used. The type 'SystemAssigned, + * UserAssigned' includes both an implicitly created identity and a set of + * user-assigned identities. The type 'None' will remove any identities. + * Possible values include: 'None', 'SystemAssigned', 'UserAssigned', + * 'SystemAssigned, UserAssigned'. + */ + @JsonProperty(value = "type") + private IdentityType type; + + /** + * The list of user-assigned identities associated with the resource. The + * user-assigned identity dictionary keys will be ARM resource ids in the + * form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + */ + @JsonProperty(value = "userAssignedIdentities") + private Map userAssignedIdentities; + + /** + * The principal id of the identity. This property will only be provided + * for a system-assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /** + * The tenant id associated with the resource's identity. This property + * will only be provided for a system-assigned identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /** + * Get the type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identities. Possible values include: 'None', 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned'. + * + * @return the type value + */ + public IdentityType type() { + return this.type; + } + + /** + * Set the type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identities. Possible values include: 'None', 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned'. + * + * @param type the type value to set + * @return the ResourceIdentity object itself. + */ + public ResourceIdentity withType(IdentityType type) { + this.type = type; + return this; + } + + /** + * Get the list of user-assigned identities associated with the resource. The user-assigned identity dictionary keys 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-assigned identities associated with the resource. The user-assigned identity dictionary keys 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 ResourceIdentity object itself. + */ + public ResourceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Get the principal id of the identity. This property will only be provided for a system-assigned identity. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenant id associated with the resource's identity. This property will only be provided for a system-assigned identity. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ServiceSpecification.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ServiceSpecification.java new file mode 100644 index 000000000000..c01de90f26c4 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/ServiceSpecification.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.appconfiguration.v2020_07_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Service specification payload. + */ +public class ServiceSpecification { + /** + * Specifications of the Log for Azure Monitoring. + */ + @JsonProperty(value = "logSpecifications") + private List logSpecifications; + + /** + * Specifications of the Metrics for Azure Monitoring. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /** + * Get specifications of the Log for Azure Monitoring. + * + * @return the logSpecifications value + */ + public List logSpecifications() { + return this.logSpecifications; + } + + /** + * Set specifications of the Log for Azure Monitoring. + * + * @param logSpecifications the logSpecifications value to set + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withLogSpecifications(List logSpecifications) { + this.logSpecifications = logSpecifications; + return this; + } + + /** + * Get specifications of the Metrics for Azure Monitoring. + * + * @return the metricSpecifications value + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set specifications of the Metrics for Azure Monitoring. + * + * @param metricSpecifications the metricSpecifications value to set + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withMetricSpecifications(List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/Sku.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/Sku.java new file mode 100644 index 000000000000..0f7850f568b6 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/Sku.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.appconfiguration.v2020_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a configuration store SKU. + */ +public class Sku { + /** + * The SKU name of the configuration store. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the SKU name of the configuration store. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the SKU name of the configuration store. + * + * @param name the name value to set + * @return the Sku object itself. + */ + public Sku withName(String name) { + this.name = name; + return this; + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/UserIdentity.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/UserIdentity.java new file mode 100644 index 000000000000..78dfdb7998e4 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/UserIdentity.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.appconfiguration.v2020_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A resource identity that is managed by the user of the service. + */ +public class UserIdentity { + /** + * The principal ID of the user-assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /** + * The client ID of the user-assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private String clientId; + + /** + * Get the principal ID of the user-assigned identity. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the client ID of the user-assigned identity. + * + * @return the clientId value + */ + public String clientId() { + return this.clientId; + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/ApiKeyImpl.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/ApiKeyImpl.java new file mode 100644 index 000000000000..0d3aabd597b0 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/ApiKeyImpl.java @@ -0,0 +1,57 @@ +/** + * 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.appconfiguration.v2020_07_01_preview.implementation; + +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.ApiKey; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import org.joda.time.DateTime; + +class ApiKeyImpl extends WrapperImpl implements ApiKey { + private final AppConfigurationManager manager; + ApiKeyImpl(ApiKeyInner inner, AppConfigurationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public AppConfigurationManager manager() { + return this.manager; + } + + @Override + public String connectionString() { + return this.inner().connectionString(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public DateTime lastModified() { + return this.inner().lastModified(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Boolean readOnly() { + return this.inner().readOnly(); + } + + @Override + public String value() { + return this.inner().value(); + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/ApiKeyInner.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/ApiKeyInner.java new file mode 100644 index 000000000000..0d41c478d132 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/ApiKeyInner.java @@ -0,0 +1,109 @@ +/** + * 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.appconfiguration.v2020_07_01_preview.implementation; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An API key used for authenticating with a configuration store endpoint. + */ +public class ApiKeyInner { + /** + * The key ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * A name for the key describing its usage. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The value of the key that is used for authentication purposes. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * A connection string that can be used by supporting clients for + * authentication. + */ + @JsonProperty(value = "connectionString", access = JsonProperty.Access.WRITE_ONLY) + private String connectionString; + + /** + * The last time any of the key's properties were modified. + */ + @JsonProperty(value = "lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * Whether this key can only be used for read operations. + */ + @JsonProperty(value = "readOnly", access = JsonProperty.Access.WRITE_ONLY) + private Boolean readOnly; + + /** + * Get the key ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get a name for the key describing its usage. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the value of the key that is used for authentication purposes. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Get a connection string that can be used by supporting clients for authentication. + * + * @return the connectionString value + */ + public String connectionString() { + return this.connectionString; + } + + /** + * Get the last time any of the key's properties were modified. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + + /** + * Get whether this key can only be used for read operations. + * + * @return the readOnly value + */ + public Boolean readOnly() { + return this.readOnly; + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/AppConfigurationManagementClientImpl.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/AppConfigurationManagementClientImpl.java new file mode 100644 index 000000000000..573064f77084 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/AppConfigurationManagementClientImpl.java @@ -0,0 +1,252 @@ +/** + * 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.appconfiguration.v2020_07_01_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the AppConfigurationManagementClientImpl class. + */ +public class AppConfigurationManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The Microsoft Azure subscription ID. */ + private String subscriptionId; + + /** + * Gets The Microsoft Azure subscription ID. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The Microsoft Azure subscription ID. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public AppConfigurationManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The client API version. */ + private String apiVersion; + + /** + * Gets The client API version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public AppConfigurationManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public AppConfigurationManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public AppConfigurationManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ConfigurationStoresInner object to access its operations. + */ + private ConfigurationStoresInner configurationStores; + + /** + * Gets the ConfigurationStoresInner object to access its operations. + * @return the ConfigurationStoresInner object. + */ + public ConfigurationStoresInner configurationStores() { + return this.configurationStores; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The PrivateEndpointConnectionsInner object to access its operations. + */ + private PrivateEndpointConnectionsInner privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsInner object to access its operations. + * @return the PrivateEndpointConnectionsInner object. + */ + public PrivateEndpointConnectionsInner privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * The PrivateLinkResourcesInner object to access its operations. + */ + private PrivateLinkResourcesInner privateLinkResources; + + /** + * Gets the PrivateLinkResourcesInner object to access its operations. + * @return the PrivateLinkResourcesInner object. + */ + public PrivateLinkResourcesInner privateLinkResources() { + return this.privateLinkResources; + } + + /** + * The KeyValuesInner object to access its operations. + */ + private KeyValuesInner keyValues; + + /** + * Gets the KeyValuesInner object to access its operations. + * @return the KeyValuesInner object. + */ + public KeyValuesInner keyValues() { + return this.keyValues; + } + + /** + * Initializes an instance of AppConfigurationManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public AppConfigurationManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of AppConfigurationManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public AppConfigurationManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of AppConfigurationManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public AppConfigurationManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2020-07-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.configurationStores = new ConfigurationStoresInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.privateEndpointConnections = new PrivateEndpointConnectionsInner(restClient().retrofit(), this); + this.privateLinkResources = new PrivateLinkResourcesInner(restClient().retrofit(), this); + this.keyValues = new KeyValuesInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "AppConfigurationManagementClient", "2020-07-01-preview"); + } +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/AppConfigurationManager.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/AppConfigurationManager.java new file mode 100644 index 000000000000..48dc87b2bd21 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/AppConfigurationManager.java @@ -0,0 +1,147 @@ +/** + * 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.appconfiguration.v2020_07_01_preview.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.ConfigurationStores; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.Operations; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.PrivateEndpointConnections; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.PrivateLinkResources; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.KeyValues; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure AppConfiguration resource management. + */ +public final class AppConfigurationManager extends ManagerCore { + private ConfigurationStores configurationStores; + private Operations operations; + private PrivateEndpointConnections privateEndpointConnections; + private PrivateLinkResources privateLinkResources; + private KeyValues keyValues; + /** + * Get a Configurable instance that can be used to create AppConfigurationManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new AppConfigurationManager.ConfigurableImpl(); + } + /** + * Creates an instance of AppConfigurationManager that exposes AppConfiguration resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the AppConfigurationManager + */ + public static AppConfigurationManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new AppConfigurationManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of AppConfigurationManager that exposes AppConfiguration resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the AppConfigurationManager + */ + public static AppConfigurationManager authenticate(RestClient restClient, String subscriptionId) { + return new AppConfigurationManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of AppConfigurationManager that exposes AppConfiguration management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing AppConfiguration management API entry points that work across subscriptions + */ + AppConfigurationManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage ConfigurationStores. + */ + public ConfigurationStores configurationStores() { + if (this.configurationStores == null) { + this.configurationStores = new ConfigurationStoresImpl(this); + } + return this.configurationStores; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage PrivateEndpointConnections. + */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); + } + return this.privateEndpointConnections; + } + + /** + * @return Entry point to manage PrivateLinkResources. + */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(this); + } + return this.privateLinkResources; + } + + /** + * @return Entry point to manage KeyValues. + */ + public KeyValues keyValues() { + if (this.keyValues == null) { + this.keyValues = new KeyValuesImpl(this); + } + return this.keyValues; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public AppConfigurationManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return AppConfigurationManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private AppConfigurationManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new AppConfigurationManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/ConfigurationStoreImpl.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/ConfigurationStoreImpl.java new file mode 100644 index 000000000000..dc70d76410c2 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/ConfigurationStoreImpl.java @@ -0,0 +1,151 @@ +/** + * 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.appconfiguration.v2020_07_01_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.ConfigurationStore; +import rx.Observable; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.ConfigurationStoreUpdateParameters; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.ResourceIdentity; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.ProvisioningState; +import org.joda.time.DateTime; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.EncryptionProperties; +import java.util.List; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.PrivateEndpointConnectionReference; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.PublicNetworkAccess; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.Sku; +import rx.functions.Func1; + +class ConfigurationStoreImpl extends GroupableResourceCoreImpl implements ConfigurationStore, ConfigurationStore.Definition, ConfigurationStore.Update { + private ConfigurationStoreUpdateParameters updateParameter; + ConfigurationStoreImpl(String name, ConfigurationStoreInner inner, AppConfigurationManager manager) { + super(name, inner, manager); + this.updateParameter = new ConfigurationStoreUpdateParameters(); + } + + @Override + public Observable createResourceAsync() { + ConfigurationStoresInner client = this.manager().inner().configurationStores(); + return client.createAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public ConfigurationStoreInner call(ConfigurationStoreInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ConfigurationStoresInner client = this.manager().inner().configurationStores(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public ConfigurationStoreInner call(ConfigurationStoreInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ConfigurationStoresInner client = this.manager().inner().configurationStores(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new ConfigurationStoreUpdateParameters(); + } + + @Override + public DateTime creationDate() { + return this.inner().creationDate(); + } + + @Override + public EncryptionProperties encryption() { + return this.inner().encryption(); + } + + @Override + public String endpoint() { + return this.inner().endpoint(); + } + + @Override + public ResourceIdentity identity() { + return this.inner().identity(); + } + + @Override + public List privateEndpointConnections() { + return this.inner().privateEndpointConnections(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public PublicNetworkAccess publicNetworkAccess() { + return this.inner().publicNetworkAccess(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public ConfigurationStoreImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.inner().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + @Override + public ConfigurationStoreImpl withSku(Sku sku) { + if (isInCreateMode()) { + this.inner().withSku(sku); + } else { + this.updateParameter.withSku(sku); + } + return this; + } + + @Override + public ConfigurationStoreImpl withEncryption(EncryptionProperties encryption) { + if (isInCreateMode()) { + this.inner().withEncryption(encryption); + } else { + this.updateParameter.withEncryption(encryption); + } + return this; + } + + @Override + public ConfigurationStoreImpl withIdentity(ResourceIdentity identity) { + if (isInCreateMode()) { + this.inner().withIdentity(identity); + } else { + this.updateParameter.withIdentity(identity); + } + return this; + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/ConfigurationStoreInner.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/ConfigurationStoreInner.java new file mode 100644 index 000000000000..012b145c6707 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/ConfigurationStoreInner.java @@ -0,0 +1,198 @@ +/** + * 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.appconfiguration.v2020_07_01_preview.implementation; + +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.ResourceIdentity; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.ProvisioningState; +import org.joda.time.DateTime; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.EncryptionProperties; +import java.util.List; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.PrivateEndpointConnectionReference; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.PublicNetworkAccess; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * The configuration store along with all resource properties. The + * Configuration Store will have all information to begin utilizing it. + */ +@JsonFlatten +public class ConfigurationStoreInner extends Resource { + /** + * The managed identity information, if configured. + */ + @JsonProperty(value = "identity") + private ResourceIdentity identity; + + /** + * The provisioning state of the configuration store. Possible values + * include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', + * 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * The creation date of configuration store. + */ + @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationDate; + + /** + * The DNS endpoint where the configuration store API will be available. + */ + @JsonProperty(value = "properties.endpoint", access = JsonProperty.Access.WRITE_ONLY) + private String endpoint; + + /** + * The encryption settings of the configuration store. + */ + @JsonProperty(value = "properties.encryption") + private EncryptionProperties encryption; + + /** + * The list of private endpoint connections that are set up for this + * resource. + */ + @JsonProperty(value = "properties.privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /** + * Control permission for data plane traffic coming from public networks + * while private endpoint is enabled. Possible values include: 'Enabled', + * 'Disabled'. + */ + @JsonProperty(value = "properties.publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /** + * The sku of the configuration store. + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /** + * Get the managed identity information, if configured. + * + * @return the identity value + */ + public ResourceIdentity identity() { + return this.identity; + } + + /** + * Set the managed identity information, if configured. + * + * @param identity the identity value to set + * @return the ConfigurationStoreInner object itself. + */ + public ConfigurationStoreInner withIdentity(ResourceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the provisioning state of the configuration store. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the creation date of configuration store. + * + * @return the creationDate value + */ + public DateTime creationDate() { + return this.creationDate; + } + + /** + * Get the DNS endpoint where the configuration store API will be available. + * + * @return the endpoint value + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Get the encryption settings of the configuration store. + * + * @return the encryption value + */ + public EncryptionProperties encryption() { + return this.encryption; + } + + /** + * Set the encryption settings of the configuration store. + * + * @param encryption the encryption value to set + * @return the ConfigurationStoreInner object itself. + */ + public ConfigurationStoreInner withEncryption(EncryptionProperties encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get the list of private endpoint connections that are set up for this resource. + * + * @return the privateEndpointConnections value + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Get control permission for data plane traffic coming from public networks while private endpoint is enabled. Possible values include: 'Enabled', 'Disabled'. + * + * @return the publicNetworkAccess value + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set control permission for data plane traffic coming from public networks while private endpoint is enabled. Possible values include: 'Enabled', 'Disabled'. + * + * @param publicNetworkAccess the publicNetworkAccess value to set + * @return the ConfigurationStoreInner object itself. + */ + public ConfigurationStoreInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the sku of the configuration store. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku of the configuration store. + * + * @param sku the sku value to set + * @return the ConfigurationStoreInner object itself. + */ + public ConfigurationStoreInner withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/ConfigurationStoresImpl.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/ConfigurationStoresImpl.java new file mode 100644 index 000000000000..c9ed218dfb01 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/ConfigurationStoresImpl.java @@ -0,0 +1,169 @@ +/** + * 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. + * def + */ + +package com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.ConfigurationStores; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.ConfigurationStore; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.ApiKey; + +class ConfigurationStoresImpl extends GroupableResourcesCoreImpl implements ConfigurationStores { + protected ConfigurationStoresImpl(AppConfigurationManager manager) { + super(manager.inner().configurationStores(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ConfigurationStoresInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ConfigurationStoresInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ConfigurationStoresInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ConfigurationStoresInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ConfigurationStore call(ConfigurationStoreInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ConfigurationStoresInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ConfigurationStoresInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ConfigurationStore call(ConfigurationStoreInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ConfigurationStoreImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable listKeysAsync(final String resourceGroupName, final String configStoreName) { + ConfigurationStoresInner client = this.inner(); + return client.listKeysAsync(resourceGroupName, configStoreName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ApiKey call(ApiKeyInner inner) { + return new ApiKeyImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateKeyAsync(String resourceGroupName, String configStoreName) { + ConfigurationStoresInner client = this.inner(); + return client.regenerateKeyAsync(resourceGroupName, configStoreName) + .map(new Func1() { + @Override + public ApiKey call(ApiKeyInner inner) { + return new ApiKeyImpl(inner, manager()); + } + }); + } + + @Override + protected ConfigurationStoreImpl wrapModel(ConfigurationStoreInner inner) { + return new ConfigurationStoreImpl(inner.name(), inner, manager()); + } + + @Override + protected ConfigurationStoreImpl wrapModel(String name) { + return new ConfigurationStoreImpl(name, new ConfigurationStoreInner(), this.manager()); + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/ConfigurationStoresInner.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/ConfigurationStoresInner.java new file mode 100644 index 000000000000..17a09a34ea1b --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/ConfigurationStoresInner.java @@ -0,0 +1,1908 @@ +/** + * 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.appconfiguration.v2020_07_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.ConfigurationStoreUpdateParameters; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.ErrorResponseException; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.RegenerateKeyParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ConfigurationStores. + */ +public class ConfigurationStoresInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ConfigurationStoresService service; + /** The service client containing this operation class. */ + private AppConfigurationManagementClientImpl client; + + /** + * Initializes an instance of ConfigurationStoresInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ConfigurationStoresInner(Retrofit retrofit, AppConfigurationManagementClientImpl client) { + this.service = retrofit.create(ConfigurationStoresService.class); + this.client = client; + } + + /** + * The interface defining all the services for ConfigurationStores to be + * used by Retrofit to perform actually REST calls. + */ + interface ConfigurationStoresService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.ConfigurationStores list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/configurationStores") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$skipToken") String skipToken, @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.appconfiguration.v2020_07_01_preview.ConfigurationStores listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Query("$skipToken") String skipToken, @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.appconfiguration.v2020_07_01_preview.ConfigurationStores getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("configStoreName") String configStoreName, @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.appconfiguration.v2020_07_01_preview.ConfigurationStores create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("configStoreName") String configStoreName, @Query("api-version") String apiVersion, @Body ConfigurationStoreInner configStoreCreationParameters, @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.appconfiguration.v2020_07_01_preview.ConfigurationStores beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("configStoreName") String configStoreName, @Query("api-version") String apiVersion, @Body ConfigurationStoreInner configStoreCreationParameters, @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.appconfiguration.v2020_07_01_preview.ConfigurationStores delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("configStoreName") String configStoreName, @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.appconfiguration.v2020_07_01_preview.ConfigurationStores beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("configStoreName") String configStoreName, @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.appconfiguration.v2020_07_01_preview.ConfigurationStores update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("configStoreName") String configStoreName, @Query("api-version") String apiVersion, @Body ConfigurationStoreUpdateParameters configStoreUpdateParameters, @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.appconfiguration.v2020_07_01_preview.ConfigurationStores beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("configStoreName") String configStoreName, @Query("api-version") String apiVersion, @Body ConfigurationStoreUpdateParameters configStoreUpdateParameters, @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.appconfiguration.v2020_07_01_preview.ConfigurationStores listKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/listKeys") + Observable> listKeys(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("configStoreName") String configStoreName, @Query("api-version") String apiVersion, @Query("$skipToken") String skipToken, @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.appconfiguration.v2020_07_01_preview.ConfigurationStores regenerateKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/regenerateKey") + Observable> regenerateKey(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("configStoreName") String configStoreName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RegenerateKeyParameters regenerateKeyParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.ConfigurationStores listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @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.appconfiguration.v2020_07_01_preview.ConfigurationStores listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @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.appconfiguration.v2020_07_01_preview.ConfigurationStores listKeysNext" }) + @GET + Observable> listKeysNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists the configuration stores for a given subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ConfigurationStoreInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the configuration stores for a given subscription. + * + * @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> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the configuration stores for a given subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ConfigurationStoreInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the configuration stores for a given subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ConfigurationStoreInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the configuration stores for a given subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ConfigurationStoreInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String skipToken = null; + return service.list(this.client.subscriptionId(), this.client.apiVersion(), skipToken, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists the configuration stores for a given subscription. + * + * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ConfigurationStoreInner> object if successful. + */ + public PagedList list(final String skipToken) { + ServiceResponse> response = listSinglePageAsync(skipToken).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the configuration stores for a given subscription. + * + * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + * @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> listAsync(final String skipToken, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(skipToken), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the configuration stores for a given subscription. + * + * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ConfigurationStoreInner> object + */ + public Observable> listAsync(final String skipToken) { + return listWithServiceResponseAsync(skipToken) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the configuration stores for a given subscription. + * + * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ConfigurationStoreInner> object + */ + public Observable>> listWithServiceResponseAsync(final String skipToken) { + return listSinglePageAsync(skipToken) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the configuration stores for a given subscription. + * + ServiceResponse> * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ConfigurationStoreInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String skipToken) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), skipToken, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the configuration stores for a given resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ConfigurationStoreInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the configuration stores for a given resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @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> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the configuration stores for a given resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ConfigurationStoreInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the configuration stores for a given resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ConfigurationStoreInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the configuration stores for a given resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ConfigurationStoreInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String skipToken = null; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), skipToken, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists the configuration stores for a given resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ConfigurationStoreInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName, final String skipToken) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName, skipToken).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the configuration stores for a given resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + * @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> listByResourceGroupAsync(final String resourceGroupName, final String skipToken, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName, skipToken), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the configuration stores for a given resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ConfigurationStoreInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName, final String skipToken) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName, skipToken) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the configuration stores for a given resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ConfigurationStoreInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String skipToken) { + return listByResourceGroupSinglePageAsync(resourceGroupName, skipToken) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the configuration stores for a given resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the container registry belongs. + ServiceResponse> * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ConfigurationStoreInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName, final String skipToken) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), skipToken, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the properties of the specified configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConfigurationStoreInner object if successful. + */ + public ConfigurationStoreInner getByResourceGroup(String resourceGroupName, String configStoreName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, configStoreName).toBlocking().single().body(); + } + + /** + * Gets the properties of the specified configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @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 getByResourceGroupAsync(String resourceGroupName, String configStoreName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, configStoreName), serviceCallback); + } + + /** + * Gets the properties of the specified configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConfigurationStoreInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String configStoreName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, configStoreName).map(new Func1, ConfigurationStoreInner>() { + @Override + public ConfigurationStoreInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of the specified configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConfigurationStoreInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String configStoreName) { + 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 (configStoreName == null) { + throw new IllegalArgumentException("Parameter configStoreName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, configStoreName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Creates a configuration store with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param configStoreCreationParameters The parameters for creating a configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConfigurationStoreInner object if successful. + */ + public ConfigurationStoreInner create(String resourceGroupName, String configStoreName, ConfigurationStoreInner configStoreCreationParameters) { + return createWithServiceResponseAsync(resourceGroupName, configStoreName, configStoreCreationParameters).toBlocking().last().body(); + } + + /** + * Creates a configuration store with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param configStoreCreationParameters The parameters for creating a configuration store. + * @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 createAsync(String resourceGroupName, String configStoreName, ConfigurationStoreInner configStoreCreationParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, configStoreName, configStoreCreationParameters), serviceCallback); + } + + /** + * Creates a configuration store with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param configStoreCreationParameters The parameters for creating a configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String configStoreName, ConfigurationStoreInner configStoreCreationParameters) { + return createWithServiceResponseAsync(resourceGroupName, configStoreName, configStoreCreationParameters).map(new Func1, ConfigurationStoreInner>() { + @Override + public ConfigurationStoreInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a configuration store with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param configStoreCreationParameters The parameters for creating a configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String configStoreName, ConfigurationStoreInner configStoreCreationParameters) { + 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 (configStoreName == null) { + throw new IllegalArgumentException("Parameter configStoreName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (configStoreCreationParameters == null) { + throw new IllegalArgumentException("Parameter configStoreCreationParameters is required and cannot be null."); + } + Validator.validate(configStoreCreationParameters); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, configStoreName, this.client.apiVersion(), configStoreCreationParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a configuration store with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param configStoreCreationParameters The parameters for creating a configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConfigurationStoreInner object if successful. + */ + public ConfigurationStoreInner beginCreate(String resourceGroupName, String configStoreName, ConfigurationStoreInner configStoreCreationParameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, configStoreName, configStoreCreationParameters).toBlocking().single().body(); + } + + /** + * Creates a configuration store with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param configStoreCreationParameters The parameters for creating a configuration store. + * @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 beginCreateAsync(String resourceGroupName, String configStoreName, ConfigurationStoreInner configStoreCreationParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, configStoreName, configStoreCreationParameters), serviceCallback); + } + + /** + * Creates a configuration store with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param configStoreCreationParameters The parameters for creating a configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConfigurationStoreInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String configStoreName, ConfigurationStoreInner configStoreCreationParameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, configStoreName, configStoreCreationParameters).map(new Func1, ConfigurationStoreInner>() { + @Override + public ConfigurationStoreInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a configuration store with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param configStoreCreationParameters The parameters for creating a configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConfigurationStoreInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String configStoreName, ConfigurationStoreInner configStoreCreationParameters) { + 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 (configStoreName == null) { + throw new IllegalArgumentException("Parameter configStoreName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (configStoreCreationParameters == null) { + throw new IllegalArgumentException("Parameter configStoreCreationParameters is required and cannot be null."); + } + Validator.validate(configStoreCreationParameters); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, configStoreName, this.client.apiVersion(), configStoreCreationParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes a configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String configStoreName) { + deleteWithServiceResponseAsync(resourceGroupName, configStoreName).toBlocking().last().body(); + } + + /** + * Deletes a configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @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 deleteAsync(String resourceGroupName, String configStoreName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, configStoreName), serviceCallback); + } + + /** + * Deletes a configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String configStoreName) { + return deleteWithServiceResponseAsync(resourceGroupName, configStoreName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String configStoreName) { + 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 (configStoreName == null) { + throw new IllegalArgumentException("Parameter configStoreName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, configStoreName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String configStoreName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, configStoreName).toBlocking().single().body(); + } + + /** + * Deletes a configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @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 beginDeleteAsync(String resourceGroupName, String configStoreName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, configStoreName), serviceCallback); + } + + /** + * Deletes a configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String configStoreName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, configStoreName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String configStoreName) { + 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 (configStoreName == null) { + throw new IllegalArgumentException("Parameter configStoreName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, configStoreName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, 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(ErrorResponseException.class) + .build(response); + } + + /** + * Updates a configuration store with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param configStoreUpdateParameters The parameters for updating a configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConfigurationStoreInner object if successful. + */ + public ConfigurationStoreInner update(String resourceGroupName, String configStoreName, ConfigurationStoreUpdateParameters configStoreUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, configStoreName, configStoreUpdateParameters).toBlocking().last().body(); + } + + /** + * Updates a configuration store with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param configStoreUpdateParameters The parameters for updating a configuration store. + * @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 updateAsync(String resourceGroupName, String configStoreName, ConfigurationStoreUpdateParameters configStoreUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, configStoreName, configStoreUpdateParameters), serviceCallback); + } + + /** + * Updates a configuration store with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param configStoreUpdateParameters The parameters for updating a configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String configStoreName, ConfigurationStoreUpdateParameters configStoreUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, configStoreName, configStoreUpdateParameters).map(new Func1, ConfigurationStoreInner>() { + @Override + public ConfigurationStoreInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a configuration store with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param configStoreUpdateParameters The parameters for updating a configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String configStoreName, ConfigurationStoreUpdateParameters configStoreUpdateParameters) { + 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 (configStoreName == null) { + throw new IllegalArgumentException("Parameter configStoreName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (configStoreUpdateParameters == null) { + throw new IllegalArgumentException("Parameter configStoreUpdateParameters is required and cannot be null."); + } + Validator.validate(configStoreUpdateParameters); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, configStoreName, this.client.apiVersion(), configStoreUpdateParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a configuration store with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param configStoreUpdateParameters The parameters for updating a configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConfigurationStoreInner object if successful. + */ + public ConfigurationStoreInner beginUpdate(String resourceGroupName, String configStoreName, ConfigurationStoreUpdateParameters configStoreUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, configStoreName, configStoreUpdateParameters).toBlocking().single().body(); + } + + /** + * Updates a configuration store with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param configStoreUpdateParameters The parameters for updating a configuration store. + * @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 beginUpdateAsync(String resourceGroupName, String configStoreName, ConfigurationStoreUpdateParameters configStoreUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, configStoreName, configStoreUpdateParameters), serviceCallback); + } + + /** + * Updates a configuration store with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param configStoreUpdateParameters The parameters for updating a configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConfigurationStoreInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String configStoreName, ConfigurationStoreUpdateParameters configStoreUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, configStoreName, configStoreUpdateParameters).map(new Func1, ConfigurationStoreInner>() { + @Override + public ConfigurationStoreInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a configuration store with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param configStoreUpdateParameters The parameters for updating a configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConfigurationStoreInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String configStoreName, ConfigurationStoreUpdateParameters configStoreUpdateParameters) { + 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 (configStoreName == null) { + throw new IllegalArgumentException("Parameter configStoreName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (configStoreUpdateParameters == null) { + throw new IllegalArgumentException("Parameter configStoreUpdateParameters is required and cannot be null."); + } + Validator.validate(configStoreUpdateParameters); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, configStoreName, this.client.apiVersion(), configStoreUpdateParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the access key for the specified configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApiKeyInner> object if successful. + */ + public PagedList listKeys(final String resourceGroupName, final String configStoreName) { + ServiceResponse> response = listKeysSinglePageAsync(resourceGroupName, configStoreName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listKeysNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the access key for the specified configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @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> listKeysAsync(final String resourceGroupName, final String configStoreName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listKeysSinglePageAsync(resourceGroupName, configStoreName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listKeysNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the access key for the specified configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApiKeyInner> object + */ + public Observable> listKeysAsync(final String resourceGroupName, final String configStoreName) { + return listKeysWithServiceResponseAsync(resourceGroupName, configStoreName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the access key for the specified configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApiKeyInner> object + */ + public Observable>> listKeysWithServiceResponseAsync(final String resourceGroupName, final String configStoreName) { + return listKeysSinglePageAsync(resourceGroupName, configStoreName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listKeysNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the access key for the specified configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApiKeyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listKeysSinglePageAsync(final String resourceGroupName, final String configStoreName) { + 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 (configStoreName == null) { + throw new IllegalArgumentException("Parameter configStoreName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String skipToken = null; + return service.listKeys(this.client.subscriptionId(), resourceGroupName, configStoreName, this.client.apiVersion(), skipToken, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listKeysDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists the access key for the specified configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApiKeyInner> object if successful. + */ + public PagedList listKeys(final String resourceGroupName, final String configStoreName, final String skipToken) { + ServiceResponse> response = listKeysSinglePageAsync(resourceGroupName, configStoreName, skipToken).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listKeysNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the access key for the specified configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + * @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> listKeysAsync(final String resourceGroupName, final String configStoreName, final String skipToken, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listKeysSinglePageAsync(resourceGroupName, configStoreName, skipToken), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listKeysNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the access key for the specified configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApiKeyInner> object + */ + public Observable> listKeysAsync(final String resourceGroupName, final String configStoreName, final String skipToken) { + return listKeysWithServiceResponseAsync(resourceGroupName, configStoreName, skipToken) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the access key for the specified configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApiKeyInner> object + */ + public Observable>> listKeysWithServiceResponseAsync(final String resourceGroupName, final String configStoreName, final String skipToken) { + return listKeysSinglePageAsync(resourceGroupName, configStoreName, skipToken) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listKeysNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the access key for the specified configuration store. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the container registry belongs. + ServiceResponse> * @param configStoreName The name of the configuration store. + ServiceResponse> * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApiKeyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listKeysSinglePageAsync(final String resourceGroupName, final String configStoreName, final String skipToken) { + 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 (configStoreName == null) { + throw new IllegalArgumentException("Parameter configStoreName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listKeys(this.client.subscriptionId(), resourceGroupName, configStoreName, this.client.apiVersion(), skipToken, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listKeysDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listKeysDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Regenerates an access key for the specified configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApiKeyInner object if successful. + */ + public ApiKeyInner regenerateKey(String resourceGroupName, String configStoreName) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, configStoreName).toBlocking().single().body(); + } + + /** + * Regenerates an access key for the specified configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @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 regenerateKeyAsync(String resourceGroupName, String configStoreName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeyWithServiceResponseAsync(resourceGroupName, configStoreName), serviceCallback); + } + + /** + * Regenerates an access key for the specified configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApiKeyInner object + */ + public Observable regenerateKeyAsync(String resourceGroupName, String configStoreName) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, configStoreName).map(new Func1, ApiKeyInner>() { + @Override + public ApiKeyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates an access key for the specified configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApiKeyInner object + */ + public Observable> regenerateKeyWithServiceResponseAsync(String resourceGroupName, String configStoreName) { + 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 (configStoreName == null) { + throw new IllegalArgumentException("Parameter configStoreName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String id = null; + RegenerateKeyParameters regenerateKeyParameters = new RegenerateKeyParameters(); + regenerateKeyParameters.withId(null); + return service.regenerateKey(this.client.subscriptionId(), resourceGroupName, configStoreName, this.client.apiVersion(), this.client.acceptLanguage(), regenerateKeyParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Regenerates an access key for the specified configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param id The id of the key to regenerate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApiKeyInner object if successful. + */ + public ApiKeyInner regenerateKey(String resourceGroupName, String configStoreName, String id) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, configStoreName, id).toBlocking().single().body(); + } + + /** + * Regenerates an access key for the specified configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param id The id of the key to regenerate. + * @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 regenerateKeyAsync(String resourceGroupName, String configStoreName, String id, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeyWithServiceResponseAsync(resourceGroupName, configStoreName, id), serviceCallback); + } + + /** + * Regenerates an access key for the specified configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param id The id of the key to regenerate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApiKeyInner object + */ + public Observable regenerateKeyAsync(String resourceGroupName, String configStoreName, String id) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, configStoreName, id).map(new Func1, ApiKeyInner>() { + @Override + public ApiKeyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates an access key for the specified configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param id The id of the key to regenerate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApiKeyInner object + */ + public Observable> regenerateKeyWithServiceResponseAsync(String resourceGroupName, String configStoreName, String id) { + 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 (configStoreName == null) { + throw new IllegalArgumentException("Parameter configStoreName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + RegenerateKeyParameters regenerateKeyParameters = new RegenerateKeyParameters(); + regenerateKeyParameters.withId(id); + return service.regenerateKey(this.client.subscriptionId(), resourceGroupName, configStoreName, this.client.apiVersion(), this.client.acceptLanguage(), regenerateKeyParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateKeyDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the configuration stores for a given subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ConfigurationStoreInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the configuration stores for a given subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the configuration stores for a given subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ConfigurationStoreInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the configuration stores for a given subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ConfigurationStoreInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the configuration stores for a given subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ConfigurationStoreInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the configuration stores for a given resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ConfigurationStoreInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the configuration stores for a given resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the configuration stores for a given resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ConfigurationStoreInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the configuration stores for a given resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ConfigurationStoreInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the configuration stores for a given resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ConfigurationStoreInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the access key for the specified configuration store. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApiKeyInner> object if successful. + */ + public PagedList listKeysNext(final String nextPageLink) { + ServiceResponse> response = listKeysNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listKeysNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the access key for the specified configuration store. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listKeysNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listKeysNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listKeysNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the access key for the specified configuration store. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApiKeyInner> object + */ + public Observable> listKeysNextAsync(final String nextPageLink) { + return listKeysNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the access key for the specified configuration store. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApiKeyInner> object + */ + public Observable>> listKeysNextWithServiceResponseAsync(final String nextPageLink) { + return listKeysNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listKeysNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the access key for the specified configuration store. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApiKeyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listKeysNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listKeysNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listKeysNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listKeysNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/IdParsingUtils.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..59185bf4921f --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * 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.appconfiguration.v2020_07_01_preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/KeyValueImpl.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/KeyValueImpl.java new file mode 100644 index 000000000000..abae7ac4ee97 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/KeyValueImpl.java @@ -0,0 +1,154 @@ +/** + * 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.appconfiguration.v2020_07_01_preview.implementation; + +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.KeyValue; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import org.joda.time.DateTime; +import java.util.Map; + +class KeyValueImpl extends CreatableUpdatableImpl implements KeyValue, KeyValue.Definition, KeyValue.Update { + private final AppConfigurationManager manager; + private String resourceGroupName; + private String configStoreName; + private String keyValueName; + + KeyValueImpl(String name, AppConfigurationManager manager) { + super(name, new KeyValueInner()); + this.manager = manager; + // Set resource name + this.keyValueName = name; + // + } + + KeyValueImpl(KeyValueInner inner, AppConfigurationManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.keyValueName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.configStoreName = IdParsingUtils.getValueFromIdByName(inner.id(), "configurationStores"); + this.keyValueName = IdParsingUtils.getValueFromIdByName(inner.id(), "keyValues"); + // + } + + @Override + public AppConfigurationManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + KeyValuesInner client = this.manager().inner().keyValues(); + return client.createOrUpdateAsync(this.resourceGroupName, this.configStoreName, this.keyValueName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + KeyValuesInner client = this.manager().inner().keyValues(); + return client.createOrUpdateAsync(this.resourceGroupName, this.configStoreName, this.keyValueName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + KeyValuesInner client = this.manager().inner().keyValues(); + return client.getAsync(this.resourceGroupName, this.configStoreName, this.keyValueName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String contentType() { + return this.inner().contentType(); + } + + @Override + public String eTag() { + return this.inner().eTag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String keyVal() { + return this.inner().key(); + } + + @Override + public String label() { + return this.inner().label(); + } + + @Override + public DateTime lastModified() { + return this.inner().lastModified(); + } + + @Override + public Boolean locked() { + return this.inner().locked(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Map tags() { + return this.inner().tags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String value() { + return this.inner().value(); + } + + @Override + public KeyValueImpl withExistingConfigurationStore(String resourceGroupName, String configStoreName) { + this.resourceGroupName = resourceGroupName; + this.configStoreName = configStoreName; + return this; + } + + @Override + public KeyValueImpl withContentType(String contentType) { + this.inner().withContentType(contentType); + return this; + } + + @Override + public KeyValueImpl withTags(Map tags) { + this.inner().withTags(tags); + return this; + } + + @Override + public KeyValueImpl withValue(String value) { + this.inner().withValue(value); + return this; + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/KeyValueInner.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/KeyValueInner.java new file mode 100644 index 000000000000..ac002f0ff960 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/KeyValueInner.java @@ -0,0 +1,190 @@ +/** + * 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.appconfiguration.v2020_07_01_preview.implementation; + +import org.joda.time.DateTime; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The key-value resource along with all resource properties. + */ +@JsonFlatten +public class KeyValueInner extends ProxyResource { + /** + * The primary identifier of a key-value. + * The key is used in unison with the label to uniquely identify a + * key-value. + */ + @JsonProperty(value = "properties.key", access = JsonProperty.Access.WRITE_ONLY) + private String key; + + /** + * A value used to group key-values. + * The label is used in unison with the key to uniquely identify a + * key-value. + */ + @JsonProperty(value = "properties.label", access = JsonProperty.Access.WRITE_ONLY) + private String label; + + /** + * The value of the key-value. + */ + @JsonProperty(value = "properties.value") + private String value; + + /** + * The content type of the key-value's value. + * Providing a proper content-type can enable transformations of values + * when they are retrieved by applications. + */ + @JsonProperty(value = "properties.contentType") + private String contentType; + + /** + * An ETag indicating the state of a key-value within a configuration + * store. + */ + @JsonProperty(value = "properties.eTag", access = JsonProperty.Access.WRITE_ONLY) + private String eTag; + + /** + * The last time a modifying operation was performed on the given + * key-value. + */ + @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * A value indicating whether the key-value is locked. + * A locked key-value may not be modified until it is unlocked. + */ + @JsonProperty(value = "properties.locked", access = JsonProperty.Access.WRITE_ONLY) + private Boolean locked; + + /** + * A dictionary of tags that can help identify what a key-value may be + * applicable for. + */ + @JsonProperty(value = "properties.tags") + private Map tags; + + /** + * Get the primary identifier of a key-value. + The key is used in unison with the label to uniquely identify a key-value. + * + * @return the key value + */ + public String key() { + return this.key; + } + + /** + * Get a value used to group key-values. + The label is used in unison with the key to uniquely identify a key-value. + * + * @return the label value + */ + public String label() { + return this.label; + } + + /** + * Get the value of the key-value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value of the key-value. + * + * @param value the value value to set + * @return the KeyValueInner object itself. + */ + public KeyValueInner withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the content type of the key-value's value. + Providing a proper content-type can enable transformations of values when they are retrieved by applications. + * + * @return the contentType value + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the content type of the key-value's value. + Providing a proper content-type can enable transformations of values when they are retrieved by applications. + * + * @param contentType the contentType value to set + * @return the KeyValueInner object itself. + */ + public KeyValueInner withContentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get an ETag indicating the state of a key-value within a configuration store. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Get the last time a modifying operation was performed on the given key-value. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + + /** + * Get a value indicating whether the key-value is locked. + A locked key-value may not be modified until it is unlocked. + * + * @return the locked value + */ + public Boolean locked() { + return this.locked; + } + + /** + * Get a dictionary of tags that can help identify what a key-value may be applicable for. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set a dictionary of tags that can help identify what a key-value may be applicable for. + * + * @param tags the tags value to set + * @return the KeyValueInner object itself. + */ + public KeyValueInner withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/KeyValuesImpl.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/KeyValuesImpl.java new file mode 100644 index 000000000000..02067e22a804 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/KeyValuesImpl.java @@ -0,0 +1,85 @@ +/** + * 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.appconfiguration.v2020_07_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.KeyValues; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.KeyValue; + +class KeyValuesImpl extends WrapperImpl implements KeyValues { + private final AppConfigurationManager manager; + + KeyValuesImpl(AppConfigurationManager manager) { + super(manager.inner().keyValues()); + this.manager = manager; + } + + public AppConfigurationManager manager() { + return this.manager; + } + + @Override + public KeyValueImpl define(String name) { + return wrapModel(name); + } + + private KeyValueImpl wrapModel(KeyValueInner inner) { + return new KeyValueImpl(inner, manager()); + } + + private KeyValueImpl wrapModel(String name) { + return new KeyValueImpl(name, this.manager()); + } + + @Override + public Observable listByConfigurationStoreAsync(final String resourceGroupName, final String configStoreName) { + KeyValuesInner client = this.inner(); + return client.listByConfigurationStoreAsync(resourceGroupName, configStoreName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public KeyValue call(KeyValueInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String configStoreName, String keyValueName) { + KeyValuesInner client = this.inner(); + return client.getAsync(resourceGroupName, configStoreName, keyValueName) + .flatMap(new Func1>() { + @Override + public Observable call(KeyValueInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((KeyValue)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String configStoreName, String keyValueName) { + KeyValuesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, configStoreName, keyValueName).toCompletable(); + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/KeyValuesInner.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/KeyValuesInner.java new file mode 100644 index 000000000000..e33afb60d726 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/KeyValuesInner.java @@ -0,0 +1,893 @@ +/** + * 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.appconfiguration.v2020_07_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in KeyValues. + */ +public class KeyValuesInner { + /** The Retrofit service to perform REST calls. */ + private KeyValuesService service; + /** The service client containing this operation class. */ + private AppConfigurationManagementClientImpl client; + + /** + * Initializes an instance of KeyValuesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public KeyValuesInner(Retrofit retrofit, AppConfigurationManagementClientImpl client) { + this.service = retrofit.create(KeyValuesService.class); + this.client = client; + } + + /** + * The interface defining all the services for KeyValues to be + * used by Retrofit to perform actually REST calls. + */ + interface KeyValuesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.KeyValues listByConfigurationStore" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues") + Observable> listByConfigurationStore(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("configStoreName") String configStoreName, @Query("api-version") String apiVersion, @Query("$skipToken") String skipToken, @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.appconfiguration.v2020_07_01_preview.KeyValues get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("configStoreName") String configStoreName, @Path("keyValueName") String keyValueName, @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.appconfiguration.v2020_07_01_preview.KeyValues createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("configStoreName") String configStoreName, @Path("keyValueName") String keyValueName, @Query("api-version") String apiVersion, @Body KeyValueInner keyValueParameters, @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.appconfiguration.v2020_07_01_preview.KeyValues delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("configStoreName") String configStoreName, @Path("keyValueName") String keyValueName, @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.appconfiguration.v2020_07_01_preview.KeyValues beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("configStoreName") String configStoreName, @Path("keyValueName") String keyValueName, @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.appconfiguration.v2020_07_01_preview.KeyValues listByConfigurationStoreNext" }) + @GET + Observable> listByConfigurationStoreNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists the key-values for a given configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<KeyValueInner> object if successful. + */ + public PagedList listByConfigurationStore(final String resourceGroupName, final String configStoreName) { + ServiceResponse> response = listByConfigurationStoreSinglePageAsync(resourceGroupName, configStoreName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByConfigurationStoreNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the key-values for a given configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @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> listByConfigurationStoreAsync(final String resourceGroupName, final String configStoreName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByConfigurationStoreSinglePageAsync(resourceGroupName, configStoreName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByConfigurationStoreNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the key-values for a given configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyValueInner> object + */ + public Observable> listByConfigurationStoreAsync(final String resourceGroupName, final String configStoreName) { + return listByConfigurationStoreWithServiceResponseAsync(resourceGroupName, configStoreName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the key-values for a given configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyValueInner> object + */ + public Observable>> listByConfigurationStoreWithServiceResponseAsync(final String resourceGroupName, final String configStoreName) { + return listByConfigurationStoreSinglePageAsync(resourceGroupName, configStoreName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByConfigurationStoreNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the key-values for a given configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<KeyValueInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByConfigurationStoreSinglePageAsync(final String resourceGroupName, final String configStoreName) { + 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 (configStoreName == null) { + throw new IllegalArgumentException("Parameter configStoreName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String skipToken = null; + return service.listByConfigurationStore(this.client.subscriptionId(), resourceGroupName, configStoreName, this.client.apiVersion(), skipToken, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByConfigurationStoreDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists the key-values for a given configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<KeyValueInner> object if successful. + */ + public PagedList listByConfigurationStore(final String resourceGroupName, final String configStoreName, final String skipToken) { + ServiceResponse> response = listByConfigurationStoreSinglePageAsync(resourceGroupName, configStoreName, skipToken).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByConfigurationStoreNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the key-values for a given configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + * @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> listByConfigurationStoreAsync(final String resourceGroupName, final String configStoreName, final String skipToken, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByConfigurationStoreSinglePageAsync(resourceGroupName, configStoreName, skipToken), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByConfigurationStoreNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the key-values for a given configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyValueInner> object + */ + public Observable> listByConfigurationStoreAsync(final String resourceGroupName, final String configStoreName, final String skipToken) { + return listByConfigurationStoreWithServiceResponseAsync(resourceGroupName, configStoreName, skipToken) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the key-values for a given configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyValueInner> object + */ + public Observable>> listByConfigurationStoreWithServiceResponseAsync(final String resourceGroupName, final String configStoreName, final String skipToken) { + return listByConfigurationStoreSinglePageAsync(resourceGroupName, configStoreName, skipToken) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByConfigurationStoreNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the key-values for a given configuration store. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the container registry belongs. + ServiceResponse> * @param configStoreName The name of the configuration store. + ServiceResponse> * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<KeyValueInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByConfigurationStoreSinglePageAsync(final String resourceGroupName, final String configStoreName, final String skipToken) { + 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 (configStoreName == null) { + throw new IllegalArgumentException("Parameter configStoreName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByConfigurationStore(this.client.subscriptionId(), resourceGroupName, configStoreName, this.client.apiVersion(), skipToken, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByConfigurationStoreDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByConfigurationStoreDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the properties of the specified key-value. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyValueInner object if successful. + */ + public KeyValueInner get(String resourceGroupName, String configStoreName, String keyValueName) { + return getWithServiceResponseAsync(resourceGroupName, configStoreName, keyValueName).toBlocking().single().body(); + } + + /** + * Gets the properties of the specified key-value. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + * @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 getAsync(String resourceGroupName, String configStoreName, String keyValueName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, configStoreName, keyValueName), serviceCallback); + } + + /** + * Gets the properties of the specified key-value. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyValueInner object + */ + public Observable getAsync(String resourceGroupName, String configStoreName, String keyValueName) { + return getWithServiceResponseAsync(resourceGroupName, configStoreName, keyValueName).map(new Func1, KeyValueInner>() { + @Override + public KeyValueInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of the specified key-value. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyValueInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String configStoreName, String keyValueName) { + 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 (configStoreName == null) { + throw new IllegalArgumentException("Parameter configStoreName is required and cannot be null."); + } + if (keyValueName == null) { + throw new IllegalArgumentException("Parameter keyValueName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, configStoreName, keyValueName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Creates a key-value. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyValueInner object if successful. + */ + public KeyValueInner createOrUpdate(String resourceGroupName, String configStoreName, String keyValueName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, configStoreName, keyValueName).toBlocking().single().body(); + } + + /** + * Creates a key-value. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + * @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 createOrUpdateAsync(String resourceGroupName, String configStoreName, String keyValueName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, configStoreName, keyValueName), serviceCallback); + } + + /** + * Creates a key-value. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyValueInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String configStoreName, String keyValueName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, configStoreName, keyValueName).map(new Func1, KeyValueInner>() { + @Override + public KeyValueInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a key-value. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyValueInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String configStoreName, String keyValueName) { + 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 (configStoreName == null) { + throw new IllegalArgumentException("Parameter configStoreName is required and cannot be null."); + } + if (keyValueName == null) { + throw new IllegalArgumentException("Parameter keyValueName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final KeyValueInner keyValueParameters = null; + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, configStoreName, keyValueName, this.client.apiVersion(), keyValueParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Creates a key-value. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + * @param keyValueParameters The parameters for creating a key-value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyValueInner object if successful. + */ + public KeyValueInner createOrUpdate(String resourceGroupName, String configStoreName, String keyValueName, KeyValueInner keyValueParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, configStoreName, keyValueName, keyValueParameters).toBlocking().single().body(); + } + + /** + * Creates a key-value. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + * @param keyValueParameters The parameters for creating a key-value. + * @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 createOrUpdateAsync(String resourceGroupName, String configStoreName, String keyValueName, KeyValueInner keyValueParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, configStoreName, keyValueName, keyValueParameters), serviceCallback); + } + + /** + * Creates a key-value. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + * @param keyValueParameters The parameters for creating a key-value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyValueInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String configStoreName, String keyValueName, KeyValueInner keyValueParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, configStoreName, keyValueName, keyValueParameters).map(new Func1, KeyValueInner>() { + @Override + public KeyValueInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a key-value. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + * @param keyValueParameters The parameters for creating a key-value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyValueInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String configStoreName, String keyValueName, KeyValueInner keyValueParameters) { + 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 (configStoreName == null) { + throw new IllegalArgumentException("Parameter configStoreName is required and cannot be null."); + } + if (keyValueName == null) { + throw new IllegalArgumentException("Parameter keyValueName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(keyValueParameters); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, configStoreName, keyValueName, this.client.apiVersion(), keyValueParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes a key-value. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String configStoreName, String keyValueName) { + deleteWithServiceResponseAsync(resourceGroupName, configStoreName, keyValueName).toBlocking().last().body(); + } + + /** + * Deletes a key-value. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + * @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 deleteAsync(String resourceGroupName, String configStoreName, String keyValueName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, configStoreName, keyValueName), serviceCallback); + } + + /** + * Deletes a key-value. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String configStoreName, String keyValueName) { + return deleteWithServiceResponseAsync(resourceGroupName, configStoreName, keyValueName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a key-value. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String configStoreName, String keyValueName) { + 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 (configStoreName == null) { + throw new IllegalArgumentException("Parameter configStoreName is required and cannot be null."); + } + if (keyValueName == null) { + throw new IllegalArgumentException("Parameter keyValueName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, configStoreName, keyValueName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a key-value. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String configStoreName, String keyValueName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, configStoreName, keyValueName).toBlocking().single().body(); + } + + /** + * Deletes a key-value. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + * @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 beginDeleteAsync(String resourceGroupName, String configStoreName, String keyValueName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, configStoreName, keyValueName), serviceCallback); + } + + /** + * Deletes a key-value. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String configStoreName, String keyValueName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, configStoreName, keyValueName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a key-value. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String configStoreName, String keyValueName) { + 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 (configStoreName == null) { + throw new IllegalArgumentException("Parameter configStoreName is required and cannot be null."); + } + if (keyValueName == null) { + throw new IllegalArgumentException("Parameter keyValueName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, configStoreName, keyValueName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, 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(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the key-values for a given configuration store. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<KeyValueInner> object if successful. + */ + public PagedList listByConfigurationStoreNext(final String nextPageLink) { + ServiceResponse> response = listByConfigurationStoreNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByConfigurationStoreNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the key-values for a given configuration store. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listByConfigurationStoreNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByConfigurationStoreNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByConfigurationStoreNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the key-values for a given configuration store. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyValueInner> object + */ + public Observable> listByConfigurationStoreNextAsync(final String nextPageLink) { + return listByConfigurationStoreNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the key-values for a given configuration store. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyValueInner> object + */ + public Observable>> listByConfigurationStoreNextWithServiceResponseAsync(final String nextPageLink) { + return listByConfigurationStoreNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByConfigurationStoreNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the key-values for a given configuration store. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<KeyValueInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByConfigurationStoreNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByConfigurationStoreNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByConfigurationStoreNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByConfigurationStoreNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/NameAvailabilityStatusImpl.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/NameAvailabilityStatusImpl.java new file mode 100644 index 000000000000..73de6507532b --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/NameAvailabilityStatusImpl.java @@ -0,0 +1,41 @@ +/** + * 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.appconfiguration.v2020_07_01_preview.implementation; + +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.NameAvailabilityStatus; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class NameAvailabilityStatusImpl extends WrapperImpl implements NameAvailabilityStatus { + private final AppConfigurationManager manager; + NameAvailabilityStatusImpl(NameAvailabilityStatusInner inner, AppConfigurationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public AppConfigurationManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public String reason() { + return this.inner().reason(); + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/NameAvailabilityStatusInner.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/NameAvailabilityStatusInner.java new file mode 100644 index 000000000000..8be8a65103f0 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/NameAvailabilityStatusInner.java @@ -0,0 +1,63 @@ +/** + * 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.appconfiguration.v2020_07_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result of a request to check the availability of a resource name. + */ +public class NameAvailabilityStatusInner { + /** + * The value indicating whether the resource name is available. + */ + @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean nameAvailable; + + /** + * If any, the error message that provides more detail for the reason that + * the name is not available. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * If any, the reason that the name is not available. + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private String reason; + + /** + * Get the value indicating whether the resource name is available. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Get if any, the error message that provides more detail for the reason that the name is not available. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get if any, the reason that the name is not available. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/OperationDefinitionImpl.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/OperationDefinitionImpl.java new file mode 100644 index 000000000000..e284494d7048 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/OperationDefinitionImpl.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.appconfiguration.v2020_07_01_preview.implementation; + +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.OperationDefinition; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.OperationDefinitionDisplay; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.OperationProperties; + +class OperationDefinitionImpl extends WrapperImpl implements OperationDefinition { + private final AppConfigurationManager manager; + OperationDefinitionImpl(OperationDefinitionInner inner, AppConfigurationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public AppConfigurationManager manager() { + return this.manager; + } + + @Override + public OperationDefinitionDisplay display() { + return this.inner().display(); + } + + @Override + public Boolean isDataAction() { + return this.inner().isDataAction(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String origin() { + return this.inner().origin(); + } + + @Override + public OperationProperties properties() { + return this.inner().properties(); + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/OperationDefinitionInner.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/OperationDefinitionInner.java new file mode 100644 index 000000000000..2d5e18e18564 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/OperationDefinitionInner.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.appconfiguration.v2020_07_01_preview.implementation; + +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.OperationDefinitionDisplay; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.OperationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The definition of a configuration store operation. + */ +public class OperationDefinitionInner { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Indicates whether the operation is a data action. + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + + /** + * The display information for the configuration store operation. + */ + @JsonProperty(value = "display") + private OperationDefinitionDisplay display; + + /** + * Origin of the operation. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * Properties of the operation. + */ + @JsonProperty(value = "properties") + private OperationProperties properties; + + /** + * Get operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set + * @return the OperationDefinitionInner object itself. + */ + public OperationDefinitionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get indicates whether the operation is a data action. + * + * @return the isDataAction value + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set indicates whether the operation is a data action. + * + * @param isDataAction the isDataAction value to set + * @return the OperationDefinitionInner object itself. + */ + public OperationDefinitionInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get the display information for the configuration store operation. + * + * @return the display value + */ + public OperationDefinitionDisplay display() { + return this.display; + } + + /** + * Set the display information for the configuration store operation. + * + * @param display the display value to set + * @return the OperationDefinitionInner object itself. + */ + public OperationDefinitionInner withDisplay(OperationDefinitionDisplay display) { + this.display = display; + return this; + } + + /** + * Get origin of the operation. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set origin of the operation. + * + * @param origin the origin value to set + * @return the OperationDefinitionInner object itself. + */ + public OperationDefinitionInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get properties of the operation. + * + * @return the properties value + */ + public OperationProperties properties() { + return this.properties; + } + + /** + * Set properties of the operation. + * + * @param properties the properties value to set + * @return the OperationDefinitionInner object itself. + */ + public OperationDefinitionInner withProperties(OperationProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/OperationsImpl.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/OperationsImpl.java new file mode 100644 index 000000000000..258d35f900c8 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/OperationsImpl.java @@ -0,0 +1,62 @@ +/** + * 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. + * abc + */ + +package com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.NameAvailabilityStatus; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.OperationDefinition; + +class OperationsImpl extends WrapperImpl implements Operations { + private final AppConfigurationManager manager; + + OperationsImpl(AppConfigurationManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public AppConfigurationManager manager() { + return this.manager; + } + + @Override + public Observable checkNameAvailabilityAsync(String name) { + OperationsInner client = this.inner(); + return client.checkNameAvailabilityAsync(name) + .map(new Func1() { + @Override + public NameAvailabilityStatus call(NameAvailabilityStatusInner inner) { + return new NameAvailabilityStatusImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public OperationDefinition call(OperationDefinitionInner inner) { + return new OperationDefinitionImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/OperationsInner.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/OperationsInner.java new file mode 100644 index 000000000000..703cf874f354 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/OperationsInner.java @@ -0,0 +1,476 @@ +/** + * 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.appconfiguration.v2020_07_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.CheckNameAvailabilityParameters; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private AppConfigurationManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, AppConfigurationManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.Operations checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CheckNameAvailabilityParameters checkNameAvailabilityParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.Operations list" }) + @GET("providers/Microsoft.AppConfiguration/operations") + Observable> list(@Query("api-version") String apiVersion, @Query("$skipToken") String skipToken, @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.appconfiguration.v2020_07_01_preview.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Checks whether the configuration store name is available for use. + * + * @param name The name to check for availability. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NameAvailabilityStatusInner object if successful. + */ + public NameAvailabilityStatusInner checkNameAvailability(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).toBlocking().single().body(); + } + + /** + * Checks whether the configuration store name is available for use. + * + * @param name The name to check for availability. + * @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 checkNameAvailabilityAsync(String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(name), serviceCallback); + } + + /** + * Checks whether the configuration store name is available for use. + * + * @param name The name to check for availability. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NameAvailabilityStatusInner object + */ + public Observable checkNameAvailabilityAsync(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).map(new Func1, NameAvailabilityStatusInner>() { + @Override + public NameAvailabilityStatusInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks whether the configuration store name is available for use. + * + * @param name The name to check for availability. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NameAvailabilityStatusInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String name) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + CheckNameAvailabilityParameters checkNameAvailabilityParameters = new CheckNameAvailabilityParameters(); + checkNameAvailabilityParameters.withName(name); + return service.checkNameAvailability(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), checkNameAvailabilityParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the operations available from this provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationDefinitionInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the operations available from this provider. + * + * @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> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the operations available from this provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationDefinitionInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the operations available from this provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationDefinitionInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the operations available from this provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String skipToken = null; + return service.list(this.client.apiVersion(), skipToken, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists the operations available from this provider. + * + * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationDefinitionInner> object if successful. + */ + public PagedList list(final String skipToken) { + ServiceResponse> response = listSinglePageAsync(skipToken).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the operations available from this provider. + * + * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + * @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> listAsync(final String skipToken, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(skipToken), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the operations available from this provider. + * + * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationDefinitionInner> object + */ + public Observable> listAsync(final String skipToken) { + return listWithServiceResponseAsync(skipToken) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the operations available from this provider. + * + * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationDefinitionInner> object + */ + public Observable>> listWithServiceResponseAsync(final String skipToken) { + return listSinglePageAsync(skipToken) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the operations available from this provider. + * + ServiceResponse> * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String skipToken) { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), skipToken, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the operations available from this provider. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationDefinitionInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the operations available from this provider. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the operations available from this provider. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationDefinitionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the operations available from this provider. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationDefinitionInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the operations available from this provider. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/PageImpl.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/PageImpl.java new file mode 100644 index 000000000000..c898d0447535 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * 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.appconfiguration.v2020_07_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/PrivateEndpointConnectionImpl.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 000000000000..d9ebaae187e5 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,124 @@ +/** + * 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.appconfiguration.v2020_07_01_preview.implementation; + +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.PrivateEndpointConnection; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.ProvisioningState; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.PrivateEndpoint; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.PrivateLinkServiceConnectionState; + +class PrivateEndpointConnectionImpl extends CreatableUpdatableImpl implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { + private final AppConfigurationManager manager; + private String resourceGroupName; + private String configStoreName; + private String privateEndpointConnectionName; + + PrivateEndpointConnectionImpl(String name, AppConfigurationManager manager) { + super(name, new PrivateEndpointConnectionInner()); + this.manager = manager; + // Set resource name + this.privateEndpointConnectionName = name; + // + } + + PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner inner, AppConfigurationManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.privateEndpointConnectionName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.configStoreName = IdParsingUtils.getValueFromIdByName(inner.id(), "configurationStores"); + this.privateEndpointConnectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "privateEndpointConnections"); + // + } + + @Override + public AppConfigurationManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.configStoreName, this.privateEndpointConnectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.configStoreName, this.privateEndpointConnectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); + return client.getAsync(this.resourceGroupName, this.configStoreName, this.privateEndpointConnectionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public PrivateEndpoint privateEndpoint() { + return this.inner().privateEndpoint(); + } + + @Override + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.inner().privateLinkServiceConnectionState(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public PrivateEndpointConnectionImpl withExistingConfigurationStore(String resourceGroupName, String configStoreName) { + this.resourceGroupName = resourceGroupName; + this.configStoreName = configStoreName; + return this; + } + + @Override + public PrivateEndpointConnectionImpl withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.inner().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + @Override + public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.inner().withPrivateEndpoint(privateEndpoint); + return this; + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/PrivateEndpointConnectionInner.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/PrivateEndpointConnectionInner.java new file mode 100644 index 000000000000..37cc32b936a9 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/PrivateEndpointConnectionInner.java @@ -0,0 +1,93 @@ +/** + * 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.appconfiguration.v2020_07_01_preview.implementation; + +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.ProvisioningState; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.PrivateEndpoint; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.PrivateLinkServiceConnectionState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A private endpoint connection. + */ +@JsonFlatten +public class PrivateEndpointConnectionInner extends ProxyResource { + /** + * The provisioning status of the private endpoint connection. Possible + * values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', + * 'Failed', 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * The resource of private endpoint. + */ + @JsonProperty(value = "properties.privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /** + * A collection of information about the state of the connection between + * service consumer and provider. + */ + @JsonProperty(value = "properties.privateLinkServiceConnectionState", required = true) + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /** + * Get the provisioning status of the private endpoint connection. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the resource of private endpoint. + * + * @return the privateEndpoint value + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the resource of private endpoint. + * + * @param privateEndpoint the privateEndpoint value to set + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get a collection of information about the state of the connection between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set a collection of information about the state of the connection between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/PrivateEndpointConnectionsImpl.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 000000000000..5a95e212f945 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,85 @@ +/** + * 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.appconfiguration.v2020_07_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.PrivateEndpointConnections; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.PrivateEndpointConnection; + +class PrivateEndpointConnectionsImpl extends WrapperImpl implements PrivateEndpointConnections { + private final AppConfigurationManager manager; + + PrivateEndpointConnectionsImpl(AppConfigurationManager manager) { + super(manager.inner().privateEndpointConnections()); + this.manager = manager; + } + + public AppConfigurationManager manager() { + return this.manager; + } + + @Override + public PrivateEndpointConnectionImpl define(String name) { + return wrapModel(name); + } + + private PrivateEndpointConnectionImpl wrapModel(PrivateEndpointConnectionInner inner) { + return new PrivateEndpointConnectionImpl(inner, manager()); + } + + private PrivateEndpointConnectionImpl wrapModel(String name) { + return new PrivateEndpointConnectionImpl(name, this.manager()); + } + + @Override + public Observable listByConfigurationStoreAsync(final String resourceGroupName, final String configStoreName) { + PrivateEndpointConnectionsInner client = this.inner(); + return client.listByConfigurationStoreAsync(resourceGroupName, configStoreName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PrivateEndpointConnection call(PrivateEndpointConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String configStoreName, String privateEndpointConnectionName) { + PrivateEndpointConnectionsInner client = this.inner(); + return client.getAsync(resourceGroupName, configStoreName, privateEndpointConnectionName) + .flatMap(new Func1>() { + @Override + public Observable call(PrivateEndpointConnectionInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((PrivateEndpointConnection)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String configStoreName, String privateEndpointConnectionName) { + PrivateEndpointConnectionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, configStoreName, privateEndpointConnectionName).toCompletable(); + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/PrivateEndpointConnectionsInner.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/PrivateEndpointConnectionsInner.java new file mode 100644 index 000000000000..04fb203a7e68 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/PrivateEndpointConnectionsInner.java @@ -0,0 +1,776 @@ +/** + * 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.appconfiguration.v2020_07_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PrivateEndpointConnections. + */ +public class PrivateEndpointConnectionsInner { + /** The Retrofit service to perform REST calls. */ + private PrivateEndpointConnectionsService service; + /** The service client containing this operation class. */ + private AppConfigurationManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PrivateEndpointConnectionsInner(Retrofit retrofit, AppConfigurationManagementClientImpl client) { + this.service = retrofit.create(PrivateEndpointConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for PrivateEndpointConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface PrivateEndpointConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.PrivateEndpointConnections listByConfigurationStore" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections") + Observable> listByConfigurationStore(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("configStoreName") String configStoreName, @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.appconfiguration.v2020_07_01_preview.PrivateEndpointConnections get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("configStoreName") String configStoreName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @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.appconfiguration.v2020_07_01_preview.PrivateEndpointConnections createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("configStoreName") String configStoreName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Query("api-version") String apiVersion, @Body PrivateEndpointConnectionInner privateEndpointConnection, @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.appconfiguration.v2020_07_01_preview.PrivateEndpointConnections beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("configStoreName") String configStoreName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Query("api-version") String apiVersion, @Body PrivateEndpointConnectionInner privateEndpointConnection, @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.appconfiguration.v2020_07_01_preview.PrivateEndpointConnections delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("configStoreName") String configStoreName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @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.appconfiguration.v2020_07_01_preview.PrivateEndpointConnections beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("configStoreName") String configStoreName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @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.appconfiguration.v2020_07_01_preview.PrivateEndpointConnections listByConfigurationStoreNext" }) + @GET + Observable> listByConfigurationStoreNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all private endpoint connections for a configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PrivateEndpointConnectionInner> object if successful. + */ + public PagedList listByConfigurationStore(final String resourceGroupName, final String configStoreName) { + ServiceResponse> response = listByConfigurationStoreSinglePageAsync(resourceGroupName, configStoreName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByConfigurationStoreNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all private endpoint connections for a configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @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> listByConfigurationStoreAsync(final String resourceGroupName, final String configStoreName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByConfigurationStoreSinglePageAsync(resourceGroupName, configStoreName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByConfigurationStoreNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all private endpoint connections for a configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateEndpointConnectionInner> object + */ + public Observable> listByConfigurationStoreAsync(final String resourceGroupName, final String configStoreName) { + return listByConfigurationStoreWithServiceResponseAsync(resourceGroupName, configStoreName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all private endpoint connections for a configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateEndpointConnectionInner> object + */ + public Observable>> listByConfigurationStoreWithServiceResponseAsync(final String resourceGroupName, final String configStoreName) { + return listByConfigurationStoreSinglePageAsync(resourceGroupName, configStoreName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByConfigurationStoreNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all private endpoint connections for a configuration store. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the container registry belongs. + ServiceResponse> * @param configStoreName The name of the configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PrivateEndpointConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByConfigurationStoreSinglePageAsync(final String resourceGroupName, final String configStoreName) { + 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 (configStoreName == null) { + throw new IllegalArgumentException("Parameter configStoreName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByConfigurationStore(this.client.subscriptionId(), resourceGroupName, configStoreName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByConfigurationStoreDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByConfigurationStoreDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the specified private endpoint connection associated with the configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param privateEndpointConnectionName Private endpoint connection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner get(String resourceGroupName, String configStoreName, String privateEndpointConnectionName) { + return getWithServiceResponseAsync(resourceGroupName, configStoreName, privateEndpointConnectionName).toBlocking().single().body(); + } + + /** + * Gets the specified private endpoint connection associated with the configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param privateEndpointConnectionName Private endpoint connection 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 getAsync(String resourceGroupName, String configStoreName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, configStoreName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Gets the specified private endpoint connection associated with the configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param privateEndpointConnectionName Private endpoint connection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable getAsync(String resourceGroupName, String configStoreName, String privateEndpointConnectionName) { + return getWithServiceResponseAsync(resourceGroupName, configStoreName, privateEndpointConnectionName).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified private endpoint connection associated with the configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param privateEndpointConnectionName Private endpoint connection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String configStoreName, String privateEndpointConnectionName) { + 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 (configStoreName == null) { + throw new IllegalArgumentException("Parameter configStoreName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, configStoreName, privateEndpointConnectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Update the state of the specified private endpoint connection associated with the configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param privateEndpointConnectionName Private endpoint connection name + * @param privateEndpointConnection The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String configStoreName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, configStoreName, privateEndpointConnectionName, privateEndpointConnection).toBlocking().last().body(); + } + + /** + * Update the state of the specified private endpoint connection associated with the configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param privateEndpointConnectionName Private endpoint connection name + * @param privateEndpointConnection The private endpoint connection properties. + * @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 createOrUpdateAsync(String resourceGroupName, String configStoreName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, configStoreName, privateEndpointConnectionName, privateEndpointConnection), serviceCallback); + } + + /** + * Update the state of the specified private endpoint connection associated with the configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param privateEndpointConnectionName Private endpoint connection name + * @param privateEndpointConnection The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String configStoreName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, configStoreName, privateEndpointConnectionName, privateEndpointConnection).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the state of the specified private endpoint connection associated with the configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param privateEndpointConnectionName Private endpoint connection name + * @param privateEndpointConnection The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String configStoreName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { + 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 (configStoreName == null) { + throw new IllegalArgumentException("Parameter configStoreName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (privateEndpointConnection == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnection is required and cannot be null."); + } + Validator.validate(privateEndpointConnection); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, configStoreName, privateEndpointConnectionName, this.client.apiVersion(), privateEndpointConnection, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update the state of the specified private endpoint connection associated with the configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param privateEndpointConnectionName Private endpoint connection name + * @param privateEndpointConnection The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner beginCreateOrUpdate(String resourceGroupName, String configStoreName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, configStoreName, privateEndpointConnectionName, privateEndpointConnection).toBlocking().single().body(); + } + + /** + * Update the state of the specified private endpoint connection associated with the configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param privateEndpointConnectionName Private endpoint connection name + * @param privateEndpointConnection The private endpoint connection properties. + * @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 beginCreateOrUpdateAsync(String resourceGroupName, String configStoreName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, configStoreName, privateEndpointConnectionName, privateEndpointConnection), serviceCallback); + } + + /** + * Update the state of the specified private endpoint connection associated with the configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param privateEndpointConnectionName Private endpoint connection name + * @param privateEndpointConnection The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String configStoreName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, configStoreName, privateEndpointConnectionName, privateEndpointConnection).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the state of the specified private endpoint connection associated with the configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param privateEndpointConnectionName Private endpoint connection name + * @param privateEndpointConnection The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String configStoreName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { + 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 (configStoreName == null) { + throw new IllegalArgumentException("Parameter configStoreName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (privateEndpointConnection == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnection is required and cannot be null."); + } + Validator.validate(privateEndpointConnection); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, configStoreName, privateEndpointConnectionName, this.client.apiVersion(), privateEndpointConnection, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param privateEndpointConnectionName Private endpoint connection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String configStoreName, String privateEndpointConnectionName) { + deleteWithServiceResponseAsync(resourceGroupName, configStoreName, privateEndpointConnectionName).toBlocking().last().body(); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param privateEndpointConnectionName Private endpoint connection 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 deleteAsync(String resourceGroupName, String configStoreName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, configStoreName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param privateEndpointConnectionName Private endpoint connection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String configStoreName, String privateEndpointConnectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, configStoreName, privateEndpointConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param privateEndpointConnectionName Private endpoint connection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String configStoreName, String privateEndpointConnectionName) { + 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 (configStoreName == null) { + throw new IllegalArgumentException("Parameter configStoreName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, configStoreName, privateEndpointConnectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param privateEndpointConnectionName Private endpoint connection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String configStoreName, String privateEndpointConnectionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, configStoreName, privateEndpointConnectionName).toBlocking().single().body(); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param privateEndpointConnectionName Private endpoint connection 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 beginDeleteAsync(String resourceGroupName, String configStoreName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, configStoreName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param privateEndpointConnectionName Private endpoint connection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String configStoreName, String privateEndpointConnectionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, configStoreName, privateEndpointConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param privateEndpointConnectionName Private endpoint connection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String configStoreName, String privateEndpointConnectionName) { + 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 (configStoreName == null) { + throw new IllegalArgumentException("Parameter configStoreName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, configStoreName, privateEndpointConnectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, 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(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all private endpoint connections for a configuration store. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PrivateEndpointConnectionInner> object if successful. + */ + public PagedList listByConfigurationStoreNext(final String nextPageLink) { + ServiceResponse> response = listByConfigurationStoreNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByConfigurationStoreNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all private endpoint connections for a configuration store. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listByConfigurationStoreNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByConfigurationStoreNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByConfigurationStoreNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all private endpoint connections for a configuration store. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateEndpointConnectionInner> object + */ + public Observable> listByConfigurationStoreNextAsync(final String nextPageLink) { + return listByConfigurationStoreNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all private endpoint connections for a configuration store. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateEndpointConnectionInner> object + */ + public Observable>> listByConfigurationStoreNextWithServiceResponseAsync(final String nextPageLink) { + return listByConfigurationStoreNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByConfigurationStoreNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all private endpoint connections for a configuration store. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PrivateEndpointConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByConfigurationStoreNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByConfigurationStoreNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByConfigurationStoreNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByConfigurationStoreNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/PrivateLinkResourceImpl.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/PrivateLinkResourceImpl.java new file mode 100644 index 000000000000..5c7d9de09250 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/PrivateLinkResourceImpl.java @@ -0,0 +1,74 @@ +/** + * 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.appconfiguration.v2020_07_01_preview.implementation; + +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.PrivateLinkResource; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import java.util.List; + +class PrivateLinkResourceImpl extends IndexableRefreshableWrapperImpl implements PrivateLinkResource { + private final AppConfigurationManager manager; + private String resourceGroupName; + private String configStoreName; + private String groupName; + + PrivateLinkResourceImpl(PrivateLinkResourceInner inner, AppConfigurationManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.configStoreName = IdParsingUtils.getValueFromIdByName(inner.id(), "configurationStores"); + this.groupName = IdParsingUtils.getValueFromIdByName(inner.id(), "privateLinkResources"); + } + + @Override + public AppConfigurationManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + PrivateLinkResourcesInner client = this.manager().inner().privateLinkResources(); + return client.getAsync(this.resourceGroupName, this.configStoreName, this.groupName); + } + + + + @Override + public String groupId() { + return this.inner().groupId(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List requiredMembers() { + return this.inner().requiredMembers(); + } + + @Override + public List requiredZoneNames() { + return this.inner().requiredZoneNames(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/PrivateLinkResourceInner.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/PrivateLinkResourceInner.java new file mode 100644 index 000000000000..64c7bafa30f8 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/PrivateLinkResourceInner.java @@ -0,0 +1,110 @@ +/** + * 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.appconfiguration.v2020_07_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * A resource that supports private link capabilities. + */ +@JsonFlatten +public class PrivateLinkResourceInner { + /** + * The resource ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The name of the resource. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * The private link resource group id. + */ + @JsonProperty(value = "properties.groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /** + * The private link resource required member names. + */ + @JsonProperty(value = "properties.requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /** + * The list of required DNS zone names of the private link resource. + */ + @JsonProperty(value = "properties.requiredZoneNames", access = JsonProperty.Access.WRITE_ONLY) + private List requiredZoneNames; + + /** + * Get the resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the name of the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get the private link resource group id. + * + * @return the groupId value + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the private link resource required member names. + * + * @return the requiredMembers value + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get the list of required DNS zone names of the private link resource. + * + * @return the requiredZoneNames value + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/PrivateLinkResourcesImpl.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 000000000000..c5d60011ee6d --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,69 @@ +/** + * 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.appconfiguration.v2020_07_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.PrivateLinkResources; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.PrivateLinkResource; + +class PrivateLinkResourcesImpl extends WrapperImpl implements PrivateLinkResources { + private final AppConfigurationManager manager; + + PrivateLinkResourcesImpl(AppConfigurationManager manager) { + super(manager.inner().privateLinkResources()); + this.manager = manager; + } + + public AppConfigurationManager manager() { + return this.manager; + } + + private PrivateLinkResourceImpl wrapModel(PrivateLinkResourceInner inner) { + return new PrivateLinkResourceImpl(inner, manager()); + } + + @Override + public Observable listByConfigurationStoreAsync(final String resourceGroupName, final String configStoreName) { + PrivateLinkResourcesInner client = this.inner(); + return client.listByConfigurationStoreAsync(resourceGroupName, configStoreName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PrivateLinkResource call(PrivateLinkResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String configStoreName, String groupName) { + PrivateLinkResourcesInner client = this.inner(); + return client.getAsync(resourceGroupName, configStoreName, groupName) + .flatMap(new Func1>() { + @Override + public Observable call(PrivateLinkResourceInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((PrivateLinkResource)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/PrivateLinkResourcesInner.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/PrivateLinkResourcesInner.java new file mode 100644 index 000000000000..0f0abe722e86 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/PrivateLinkResourcesInner.java @@ -0,0 +1,401 @@ +/** + * 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.appconfiguration.v2020_07_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PrivateLinkResources. + */ +public class PrivateLinkResourcesInner { + /** The Retrofit service to perform REST calls. */ + private PrivateLinkResourcesService service; + /** The service client containing this operation class. */ + private AppConfigurationManagementClientImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PrivateLinkResourcesInner(Retrofit retrofit, AppConfigurationManagementClientImpl client) { + this.service = retrofit.create(PrivateLinkResourcesService.class); + this.client = client; + } + + /** + * The interface defining all the services for PrivateLinkResources to be + * used by Retrofit to perform actually REST calls. + */ + interface PrivateLinkResourcesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.PrivateLinkResources listByConfigurationStore" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateLinkResources") + Observable> listByConfigurationStore(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("configStoreName") String configStoreName, @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.appconfiguration.v2020_07_01_preview.PrivateLinkResources get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateLinkResources/{groupName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("configStoreName") String configStoreName, @Path("groupName") String groupName, @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.appconfiguration.v2020_07_01_preview.PrivateLinkResources listByConfigurationStoreNext" }) + @GET + Observable> listByConfigurationStoreNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the private link resources that need to be created for a configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PrivateLinkResourceInner> object if successful. + */ + public PagedList listByConfigurationStore(final String resourceGroupName, final String configStoreName) { + ServiceResponse> response = listByConfigurationStoreSinglePageAsync(resourceGroupName, configStoreName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByConfigurationStoreNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the private link resources that need to be created for a configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @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> listByConfigurationStoreAsync(final String resourceGroupName, final String configStoreName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByConfigurationStoreSinglePageAsync(resourceGroupName, configStoreName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByConfigurationStoreNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the private link resources that need to be created for a configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateLinkResourceInner> object + */ + public Observable> listByConfigurationStoreAsync(final String resourceGroupName, final String configStoreName) { + return listByConfigurationStoreWithServiceResponseAsync(resourceGroupName, configStoreName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the private link resources that need to be created for a configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateLinkResourceInner> object + */ + public Observable>> listByConfigurationStoreWithServiceResponseAsync(final String resourceGroupName, final String configStoreName) { + return listByConfigurationStoreSinglePageAsync(resourceGroupName, configStoreName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByConfigurationStoreNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the private link resources that need to be created for a configuration store. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the container registry belongs. + ServiceResponse> * @param configStoreName The name of the configuration store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PrivateLinkResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByConfigurationStoreSinglePageAsync(final String resourceGroupName, final String configStoreName) { + 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 (configStoreName == null) { + throw new IllegalArgumentException("Parameter configStoreName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByConfigurationStore(this.client.subscriptionId(), resourceGroupName, configStoreName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByConfigurationStoreDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByConfigurationStoreDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets a private link resource that need to be created for a configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param groupName The name of the private link resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateLinkResourceInner object if successful. + */ + public PrivateLinkResourceInner get(String resourceGroupName, String configStoreName, String groupName) { + return getWithServiceResponseAsync(resourceGroupName, configStoreName, groupName).toBlocking().single().body(); + } + + /** + * Gets a private link resource that need to be created for a configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param groupName The name of the private link resource group. + * @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 getAsync(String resourceGroupName, String configStoreName, String groupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, configStoreName, groupName), serviceCallback); + } + + /** + * Gets a private link resource that need to be created for a configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param groupName The name of the private link resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateLinkResourceInner object + */ + public Observable getAsync(String resourceGroupName, String configStoreName, String groupName) { + return getWithServiceResponseAsync(resourceGroupName, configStoreName, groupName).map(new Func1, PrivateLinkResourceInner>() { + @Override + public PrivateLinkResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a private link resource that need to be created for a configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param groupName The name of the private link resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateLinkResourceInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String configStoreName, String groupName) { + 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 (configStoreName == null) { + throw new IllegalArgumentException("Parameter configStoreName is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, configStoreName, groupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the private link resources that need to be created for a configuration store. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PrivateLinkResourceInner> object if successful. + */ + public PagedList listByConfigurationStoreNext(final String nextPageLink) { + ServiceResponse> response = listByConfigurationStoreNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByConfigurationStoreNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the private link resources that need to be created for a configuration store. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listByConfigurationStoreNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByConfigurationStoreNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByConfigurationStoreNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the private link resources that need to be created for a configuration store. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateLinkResourceInner> object + */ + public Observable> listByConfigurationStoreNextAsync(final String nextPageLink) { + return listByConfigurationStoreNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the private link resources that need to be created for a configuration store. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateLinkResourceInner> object + */ + public Observable>> listByConfigurationStoreNextWithServiceResponseAsync(final String nextPageLink) { + return listByConfigurationStoreNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByConfigurationStoreNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the private link resources that need to be created for a configuration store. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PrivateLinkResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByConfigurationStoreNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByConfigurationStoreNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByConfigurationStoreNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByConfigurationStoreNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/package-info.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/package-info.java new file mode 100644 index 000000000000..bd099d67a665 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/implementation/package-info.java @@ -0,0 +1,10 @@ +// 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. + +/** + * This package contains the implementation classes for AppConfigurationManagementClient. + */ +package com.microsoft.azure.management.appconfiguration.v2020_07_01_preview.implementation; diff --git a/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/package-info.java b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/package-info.java new file mode 100644 index 000000000000..aa47e667e97b --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2020_07_01_preview/package-info.java @@ -0,0 +1,10 @@ +// 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. + +/** + * This package contains the classes for AppConfigurationManagementClient. + */ +package com.microsoft.azure.management.appconfiguration.v2020_07_01_preview;