From 328d9b9e7ce1bb3ff80596da5e93fac9448bb95d Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Thu, 22 Oct 2020 04:17:39 +0000 Subject: [PATCH] Generated from 0e5a9dba02e521c7f89a7364a3560cfee8c4f9ec --- .../mgmt-v2019_02_01_preview/pom.xml | 4 +- .../ConfigurationStores.java | 11 ++ .../v2019_02_01_preview/KeyValue.java | 62 +++++++ .../ListKeyValueParameters.java | 69 ++++++++ .../ConfigurationStoresImpl.java | 14 ++ .../ConfigurationStoresInner.java | 99 +++++++++++ .../implementation/KeyValueImpl.java | 68 ++++++++ .../implementation/KeyValueInner.java | 154 ++++++++++++++++++ 8 files changed, 479 insertions(+), 2 deletions(-) create mode 100644 sdk/appconfiguration/mgmt-v2019_02_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2019_02_01_preview/KeyValue.java create mode 100644 sdk/appconfiguration/mgmt-v2019_02_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2019_02_01_preview/ListKeyValueParameters.java create mode 100644 sdk/appconfiguration/mgmt-v2019_02_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2019_02_01_preview/implementation/KeyValueImpl.java create mode 100644 sdk/appconfiguration/mgmt-v2019_02_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2019_02_01_preview/implementation/KeyValueInner.java diff --git a/sdk/appconfiguration/mgmt-v2019_02_01_preview/pom.xml b/sdk/appconfiguration/mgmt-v2019_02_01_preview/pom.xml index a6e6321fb5076..b9182f0b2edb1 100644 --- a/sdk/appconfiguration/mgmt-v2019_02_01_preview/pom.xml +++ b/sdk/appconfiguration/mgmt-v2019_02_01_preview/pom.xml @@ -11,8 +11,8 @@ com.microsoft.azure azure-arm-parent - 1.2.0 - ../../parents/azure-arm-parent + 1.1.0 + ../../../pom.management.xml azure-mgmt-appconfiguration 1.0.0-beta diff --git a/sdk/appconfiguration/mgmt-v2019_02_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2019_02_01_preview/ConfigurationStores.java b/sdk/appconfiguration/mgmt-v2019_02_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2019_02_01_preview/ConfigurationStores.java index 06270ccce35ca..c9353b701d777 100644 --- a/sdk/appconfiguration/mgmt-v2019_02_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2019_02_01_preview/ConfigurationStores.java +++ b/sdk/appconfiguration/mgmt-v2019_02_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2019_02_01_preview/ConfigurationStores.java @@ -42,4 +42,15 @@ public interface ConfigurationStores extends SupportsCreating regenerateKeyAsync(String resourceGroupName, String configStoreName); + /** + * Lists a configuration store 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 listKeyValueParameters The parameters for retrieving a key-value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listKeyValueAsync(String resourceGroupName, String configStoreName, ListKeyValueParameters listKeyValueParameters); + } diff --git a/sdk/appconfiguration/mgmt-v2019_02_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2019_02_01_preview/KeyValue.java b/sdk/appconfiguration/mgmt-v2019_02_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2019_02_01_preview/KeyValue.java new file mode 100644 index 0000000000000..0e26678196aba --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2019_02_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2019_02_01_preview/KeyValue.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. + */ + +package com.microsoft.azure.management.appconfiguration.v2019_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.appconfiguration.v2019_02_01_preview.implementation.AppConfigurationManager; +import com.microsoft.azure.management.appconfiguration.v2019_02_01_preview.implementation.KeyValueInner; +import org.joda.time.DateTime; +import java.util.Map; + +/** + * Type representing KeyValue. + */ +public interface KeyValue extends HasInner, HasManager { + /** + * @return the contentType value. + */ + String contentType(); + + /** + * @return the eTag value. + */ + String eTag(); + + /** + * @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 tags value. + */ + Map tags(); + + /** + * @return the value value. + */ + String value(); + +} diff --git a/sdk/appconfiguration/mgmt-v2019_02_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2019_02_01_preview/ListKeyValueParameters.java b/sdk/appconfiguration/mgmt-v2019_02_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2019_02_01_preview/ListKeyValueParameters.java new file mode 100644 index 0000000000000..8b5858daf0c01 --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2019_02_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2019_02_01_preview/ListKeyValueParameters.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.v2019_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters used to list a configuration store key-value. + */ +public class ListKeyValueParameters { + /** + * The key to retrieve. + */ + @JsonProperty(value = "key", required = true) + private String key; + + /** + * The label of the key. + */ + @JsonProperty(value = "label") + private String label; + + /** + * Get the key to retrieve. + * + * @return the key value + */ + public String key() { + return this.key; + } + + /** + * Set the key to retrieve. + * + * @param key the key value to set + * @return the ListKeyValueParameters object itself. + */ + public ListKeyValueParameters withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the label of the key. + * + * @return the label value + */ + public String label() { + return this.label; + } + + /** + * Set the label of the key. + * + * @param label the label value to set + * @return the ListKeyValueParameters object itself. + */ + public ListKeyValueParameters withLabel(String label) { + this.label = label; + return this; + } + +} diff --git a/sdk/appconfiguration/mgmt-v2019_02_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2019_02_01_preview/implementation/ConfigurationStoresImpl.java b/sdk/appconfiguration/mgmt-v2019_02_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2019_02_01_preview/implementation/ConfigurationStoresImpl.java index ed8af28f7b1c7..af4fb58e30789 100644 --- a/sdk/appconfiguration/mgmt-v2019_02_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2019_02_01_preview/implementation/ConfigurationStoresImpl.java +++ b/sdk/appconfiguration/mgmt-v2019_02_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2019_02_01_preview/implementation/ConfigurationStoresImpl.java @@ -23,6 +23,8 @@ import com.microsoft.azure.PagedList; import com.microsoft.azure.Page; import com.microsoft.azure.management.appconfiguration.v2019_02_01_preview.ApiKey; +import com.microsoft.azure.management.appconfiguration.v2019_02_01_preview.KeyValue; +import com.microsoft.azure.management.appconfiguration.v2019_02_01_preview.ListKeyValueParameters; class ConfigurationStoresImpl extends GroupableResourcesCoreImpl implements ConfigurationStores { protected ConfigurationStoresImpl(AppConfigurationManager manager) { @@ -156,6 +158,18 @@ public ApiKey call(ApiKeyInner inner) { }); } + @Override + public Observable listKeyValueAsync(String resourceGroupName, String configStoreName, ListKeyValueParameters listKeyValueParameters) { + ConfigurationStoresInner client = this.inner(); + return client.listKeyValueAsync(resourceGroupName, configStoreName, listKeyValueParameters) + .map(new Func1() { + @Override + public KeyValue call(KeyValueInner inner) { + return new KeyValueImpl(inner, manager()); + } + }); + } + @Override protected ConfigurationStoreImpl wrapModel(ConfigurationStoreInner inner) { return new ConfigurationStoreImpl(inner.name(), inner, manager()); diff --git a/sdk/appconfiguration/mgmt-v2019_02_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2019_02_01_preview/implementation/ConfigurationStoresInner.java b/sdk/appconfiguration/mgmt-v2019_02_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2019_02_01_preview/implementation/ConfigurationStoresInner.java index 68ca4845c6e6f..ef0b6eb48a19a 100644 --- a/sdk/appconfiguration/mgmt-v2019_02_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2019_02_01_preview/implementation/ConfigurationStoresInner.java +++ b/sdk/appconfiguration/mgmt-v2019_02_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2019_02_01_preview/implementation/ConfigurationStoresInner.java @@ -17,6 +17,7 @@ import com.microsoft.azure.ListOperationCallback; import com.microsoft.azure.management.appconfiguration.v2019_02_01_preview.ConfigurationStoreUpdateParameters; import com.microsoft.azure.management.appconfiguration.v2019_02_01_preview.ErrorException; +import com.microsoft.azure.management.appconfiguration.v2019_02_01_preview.ListKeyValueParameters; import com.microsoft.azure.management.appconfiguration.v2019_02_01_preview.RegenerateKeyParameters; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; @@ -112,6 +113,10 @@ interface ConfigurationStoresService { @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.v2019_02_01_preview.ConfigurationStores listKeyValue" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/listKeyValue") + Observable> listKeyValue(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("configStoreName") String configStoreName, @Query("api-version") String apiVersion, @Body ListKeyValueParameters listKeyValueParameters, @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.v2019_02_01_preview.ConfigurationStores listNext" }) @GET Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -1572,6 +1577,100 @@ private ServiceResponse regenerateKeyDelegate(Response listKeyValueAsync(String resourceGroupName, String configStoreName, ListKeyValueParameters listKeyValueParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeyValueWithServiceResponseAsync(resourceGroupName, configStoreName, listKeyValueParameters), serviceCallback); + } + + /** + * Lists a configuration store 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 listKeyValueParameters The parameters for retrieving a key-value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyValueInner object + */ + public Observable listKeyValueAsync(String resourceGroupName, String configStoreName, ListKeyValueParameters listKeyValueParameters) { + return listKeyValueWithServiceResponseAsync(resourceGroupName, configStoreName, listKeyValueParameters).map(new Func1, KeyValueInner>() { + @Override + public KeyValueInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists a configuration store 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 listKeyValueParameters The parameters for retrieving a key-value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyValueInner object + */ + public Observable> listKeyValueWithServiceResponseAsync(String resourceGroupName, String configStoreName, ListKeyValueParameters listKeyValueParameters) { + 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 (listKeyValueParameters == null) { + throw new IllegalArgumentException("Parameter listKeyValueParameters is required and cannot be null."); + } + Validator.validate(listKeyValueParameters); + return service.listKeyValue(this.client.subscriptionId(), resourceGroupName, configStoreName, this.client.apiVersion(), listKeyValueParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listKeyValueDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listKeyValueDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + /** * Lists the configuration stores for a given subscription. * diff --git a/sdk/appconfiguration/mgmt-v2019_02_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2019_02_01_preview/implementation/KeyValueImpl.java b/sdk/appconfiguration/mgmt-v2019_02_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2019_02_01_preview/implementation/KeyValueImpl.java new file mode 100644 index 0000000000000..2ca4d4663126a --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2019_02_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2019_02_01_preview/implementation/KeyValueImpl.java @@ -0,0 +1,68 @@ +/** + * 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.v2019_02_01_preview.implementation; + +import com.microsoft.azure.management.appconfiguration.v2019_02_01_preview.KeyValue; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import org.joda.time.DateTime; +import java.util.Map; + +class KeyValueImpl extends WrapperImpl implements KeyValue { + private final AppConfigurationManager manager; + KeyValueImpl(KeyValueInner inner, AppConfigurationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public AppConfigurationManager manager() { + return this.manager; + } + + @Override + public String contentType() { + return this.inner().contentType(); + } + + @Override + public String eTag() { + return this.inner().eTag(); + } + + @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 Map tags() { + return this.inner().tags(); + } + + @Override + public String value() { + return this.inner().value(); + } + +} diff --git a/sdk/appconfiguration/mgmt-v2019_02_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2019_02_01_preview/implementation/KeyValueInner.java b/sdk/appconfiguration/mgmt-v2019_02_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2019_02_01_preview/implementation/KeyValueInner.java new file mode 100644 index 0000000000000..e22c09d22cbcd --- /dev/null +++ b/sdk/appconfiguration/mgmt-v2019_02_01_preview/src/main/java/com/microsoft/azure/management/appconfiguration/v2019_02_01_preview/implementation/KeyValueInner.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.v2019_02_01_preview.implementation; + +import org.joda.time.DateTime; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result of a request to retrieve a key-value from the specified + * configuration store. + */ +public class KeyValueInner { + /** + * The primary identifier of a key-value. + * The key is used in unison with the label to uniquely identify a + * key-value. + */ + @JsonProperty(value = "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 = "label", access = JsonProperty.Access.WRITE_ONLY) + private String label; + + /** + * The value of the key-value. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + 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 = "contentType", access = JsonProperty.Access.WRITE_ONLY) + private String contentType; + + /** + * An ETag indicating the state of a key-value within a configuration + * store. + */ + @JsonProperty(value = "eTag", access = JsonProperty.Access.WRITE_ONLY) + private String eTag; + + /** + * The last time a modifying operation was performed on the given + * key-value. + */ + @JsonProperty(value = "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 = "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 = "tags", access = JsonProperty.Access.WRITE_ONLY) + 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; + } + + /** + * 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; + } + + /** + * 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; + } + +}