Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR sdk/appconfiguration/mgmt-v2019_02_01_preview] Added event grid filters read APIs for Microsoft.AppConfiguration. #5463

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sdk/appconfiguration/mgmt-v2019_02_01_preview/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<parent>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-arm-parent</artifactId>
<version>1.2.0</version>
<relativePath>../../parents/azure-arm-parent</relativePath>
<version>1.1.0</version>
<relativePath>../../../pom.management.xml</relativePath>
</parent>
<artifactId>azure-mgmt-appconfiguration</artifactId>
<version>1.0.0-beta</version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,15 @@ public interface ConfigurationStores extends SupportsCreating<ConfigurationStore
*/
Observable<ApiKey> 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<KeyValue> listKeyValueAsync(String resourceGroupName, String configStoreName, ListKeyValueParameters listKeyValueParameters);

}
Original file line number Diff line number Diff line change
@@ -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<KeyValueInner>, HasManager<AppConfigurationManager> {
/**
* @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<String, String> tags();

/**
* @return the value value.
*/
String value();

}
Original file line number Diff line number Diff line change
@@ -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;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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<ConfigurationStore, ConfigurationStoreImpl, ConfigurationStoreInner, ConfigurationStoresInner, AppConfigurationManager> implements ConfigurationStores {
protected ConfigurationStoresImpl(AppConfigurationManager manager) {
Expand Down Expand Up @@ -156,6 +158,18 @@ public ApiKey call(ApiKeyInner inner) {
});
}

@Override
public Observable<KeyValue> listKeyValueAsync(String resourceGroupName, String configStoreName, ListKeyValueParameters listKeyValueParameters) {
ConfigurationStoresInner client = this.inner();
return client.listKeyValueAsync(resourceGroupName, configStoreName, listKeyValueParameters)
.map(new Func1<KeyValueInner, KeyValue>() {
@Override
public KeyValue call(KeyValueInner inner) {
return new KeyValueImpl(inner, manager());
}
});
}

@Override
protected ConfigurationStoreImpl wrapModel(ConfigurationStoreInner inner) {
return new ConfigurationStoreImpl(inner.name(), inner, manager());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -112,6 +113,10 @@ interface ConfigurationStoresService {
@POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/RegenerateKey")
Observable<Response<ResponseBody>> 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<Response<ResponseBody>> 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<Response<ResponseBody>> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
Expand Down Expand Up @@ -1572,6 +1577,100 @@ private ServiceResponse<ApiKeyInner> regenerateKeyDelegate(Response<ResponseBody
.build(response);
}

/**
* 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
* @throws ErrorException 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 listKeyValue(String resourceGroupName, String configStoreName, ListKeyValueParameters listKeyValueParameters) {
return listKeyValueWithServiceResponseAsync(resourceGroupName, configStoreName, listKeyValueParameters).toBlocking().single().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.
* @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<KeyValueInner> listKeyValueAsync(String resourceGroupName, String configStoreName, ListKeyValueParameters listKeyValueParameters, final ServiceCallback<KeyValueInner> 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<KeyValueInner> listKeyValueAsync(String resourceGroupName, String configStoreName, ListKeyValueParameters listKeyValueParameters) {
return listKeyValueWithServiceResponseAsync(resourceGroupName, configStoreName, listKeyValueParameters).map(new Func1<ServiceResponse<KeyValueInner>, KeyValueInner>() {
@Override
public KeyValueInner call(ServiceResponse<KeyValueInner> 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<ServiceResponse<KeyValueInner>> 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<Response<ResponseBody>, Observable<ServiceResponse<KeyValueInner>>>() {
@Override
public Observable<ServiceResponse<KeyValueInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<KeyValueInner> clientResponse = listKeyValueDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}

private ServiceResponse<KeyValueInner> listKeyValueDelegate(Response<ResponseBody> response) throws ErrorException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<KeyValueInner, ErrorException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<KeyValueInner>() { }.getType())
.registerError(ErrorException.class)
.build(response);
}

/**
* Lists the configuration stores for a given subscription.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -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<KeyValueInner> 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<String, String> tags() {
return this.inner().tags();
}

@Override
public String value() {
return this.inner().value();
}

}
Loading