diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/pom.xml b/sdk/cognitiveservices/mgmt-v2017_04_18/pom.xml index 27fd6e406f65..9c2ba0914aab 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/pom.xml +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/pom.xml @@ -11,11 +11,11 @@ com.microsoft.azure azure-arm-parent - 1.3.2 - ../../parents/azure-arm-parent/pom.xml + 1.1.0 + ../../../pom.management.xml azure-mgmt-cognitiveservices - 1.0.0 + 1.0.0-beta jar Microsoft Azure SDK for CognitiveServices Management This package contains Microsoft CognitiveServices Management SDK. diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/CognitiveServicesAccountApiProperties.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/CognitiveServicesAccountApiProperties.java index ae7e19c59759..9fb077539633 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/CognitiveServicesAccountApiProperties.java +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/CognitiveServicesAccountApiProperties.java @@ -38,6 +38,30 @@ public class CognitiveServicesAccountApiProperties { @JsonProperty(value = "storageAccountConnectionString") private String storageAccountConnectionString; + /** + * (Metrics Advisor Only) The Azure AD Client Id (Application Id). + */ + @JsonProperty(value = "aadClientId") + private String aadClientId; + + /** + * (Metrics Advisor Only) The Azure AD Tenant Id. + */ + @JsonProperty(value = "aadTenantId") + private String aadTenantId; + + /** + * (Metrics Advisor Only) The super user of Metrics Advisor. + */ + @JsonProperty(value = "superUser") + private String superUser; + + /** + * (Metrics Advisor Only) The website name of Metrics Advisor. + */ + @JsonProperty(value = "websiteName") + private String websiteName; + /** * Get (QnAMaker Only) The runtime endpoint of QnAMaker. * @@ -118,4 +142,84 @@ public CognitiveServicesAccountApiProperties withStorageAccountConnectionString( return this; } + /** + * Get (Metrics Advisor Only) The Azure AD Client Id (Application Id). + * + * @return the aadClientId value + */ + public String aadClientId() { + return this.aadClientId; + } + + /** + * Set (Metrics Advisor Only) The Azure AD Client Id (Application Id). + * + * @param aadClientId the aadClientId value to set + * @return the CognitiveServicesAccountApiProperties object itself. + */ + public CognitiveServicesAccountApiProperties withAadClientId(String aadClientId) { + this.aadClientId = aadClientId; + return this; + } + + /** + * Get (Metrics Advisor Only) The Azure AD Tenant Id. + * + * @return the aadTenantId value + */ + public String aadTenantId() { + return this.aadTenantId; + } + + /** + * Set (Metrics Advisor Only) The Azure AD Tenant Id. + * + * @param aadTenantId the aadTenantId value to set + * @return the CognitiveServicesAccountApiProperties object itself. + */ + public CognitiveServicesAccountApiProperties withAadTenantId(String aadTenantId) { + this.aadTenantId = aadTenantId; + return this; + } + + /** + * Get (Metrics Advisor Only) The super user of Metrics Advisor. + * + * @return the superUser value + */ + public String superUser() { + return this.superUser; + } + + /** + * Set (Metrics Advisor Only) The super user of Metrics Advisor. + * + * @param superUser the superUser value to set + * @return the CognitiveServicesAccountApiProperties object itself. + */ + public CognitiveServicesAccountApiProperties withSuperUser(String superUser) { + this.superUser = superUser; + return this; + } + + /** + * Get (Metrics Advisor Only) The website name of Metrics Advisor. + * + * @return the websiteName value + */ + public String websiteName() { + return this.websiteName; + } + + /** + * Set (Metrics Advisor Only) The website name of Metrics Advisor. + * + * @param websiteName the websiteName value to set + * @return the CognitiveServicesAccountApiProperties object itself. + */ + public CognitiveServicesAccountApiProperties withWebsiteName(String websiteName) { + this.websiteName = websiteName; + return this; + } + } diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/PrivateEndpointConnectionListResult.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/PrivateEndpointConnectionListResult.java new file mode 100644 index 000000000000..4d84253b80eb --- /dev/null +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/PrivateEndpointConnectionListResult.java @@ -0,0 +1,27 @@ +/** + * 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.cognitiveservices.v2017_04_18; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.cognitiveservices.v2017_04_18.implementation.CognitiveServicesManager; +import com.microsoft.azure.management.cognitiveservices.v2017_04_18.implementation.PrivateEndpointConnectionListResultInner; +import com.microsoft.azure.management.cognitiveservices.v2017_04_18.implementation.PrivateEndpointConnectionInner; +import java.util.List; + +/** + * Type representing PrivateEndpointConnectionListResult. + */ +public interface PrivateEndpointConnectionListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/PrivateEndpointConnections.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/PrivateEndpointConnections.java index ed3ea424e1fb..171cd5b17840 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/PrivateEndpointConnections.java +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/PrivateEndpointConnections.java @@ -18,6 +18,16 @@ * Type representing PrivateEndpointConnections. */ public interface PrivateEndpointConnections extends SupportsCreating, HasInner { + /** + * Gets the private endpoint connections associated with the Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String accountName); + /** * Gets the specified private endpoint connection associated with the Cognitive Services account. * diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/PrivateEndpointConnectionListResultImpl.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/PrivateEndpointConnectionListResultImpl.java new file mode 100644 index 000000000000..f379c08ebbcd --- /dev/null +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/PrivateEndpointConnectionListResultImpl.java @@ -0,0 +1,32 @@ +/** + * 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.cognitiveservices.v2017_04_18.implementation; + +import com.microsoft.azure.management.cognitiveservices.v2017_04_18.PrivateEndpointConnectionListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class PrivateEndpointConnectionListResultImpl extends WrapperImpl implements PrivateEndpointConnectionListResult { + private final CognitiveServicesManager manager; + PrivateEndpointConnectionListResultImpl(PrivateEndpointConnectionListResultInner inner, CognitiveServicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public CognitiveServicesManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/PrivateEndpointConnectionListResultInner.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/PrivateEndpointConnectionListResultInner.java new file mode 100644 index 000000000000..68a226ab104b --- /dev/null +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/PrivateEndpointConnectionListResultInner.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.cognitiveservices.v2017_04_18.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A list of private endpoint connections. + */ +public class PrivateEndpointConnectionListResultInner { + /** + * Array of private endpoint connections. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get array of private endpoint connections. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set array of private endpoint connections. + * + * @param value the value value to set + * @return the PrivateEndpointConnectionListResultInner object itself. + */ + public PrivateEndpointConnectionListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/PrivateEndpointConnectionsImpl.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/PrivateEndpointConnectionsImpl.java index f904a6855252..cf489e4d14f3 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/PrivateEndpointConnectionsImpl.java +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/PrivateEndpointConnectionsImpl.java @@ -14,6 +14,7 @@ import rx.Completable; import rx.Observable; import rx.functions.Func1; +import com.microsoft.azure.management.cognitiveservices.v2017_04_18.PrivateEndpointConnectionListResult; import com.microsoft.azure.management.cognitiveservices.v2017_04_18.PrivateEndpointConnection; class PrivateEndpointConnectionsImpl extends WrapperImpl implements PrivateEndpointConnections { @@ -41,6 +42,18 @@ private PrivateEndpointConnectionImpl wrapModel(String name) { return new PrivateEndpointConnectionImpl(name, this.manager()); } + @Override + public Observable listAsync(String resourceGroupName, String accountName) { + PrivateEndpointConnectionsInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .map(new Func1() { + @Override + public PrivateEndpointConnectionListResult call(PrivateEndpointConnectionListResultInner inner) { + return new PrivateEndpointConnectionListResultImpl(inner, manager()); + } + }); + } + @Override public Observable getAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName) { PrivateEndpointConnectionsInner client = this.inner(); diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/PrivateEndpointConnectionsInner.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/PrivateEndpointConnectionsInner.java index c1183e1aa2cf..5fa31af0d42b 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/PrivateEndpointConnectionsInner.java +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/PrivateEndpointConnectionsInner.java @@ -11,6 +11,7 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.cognitiveservices.v2017_04_18.ErrorException; import com.microsoft.azure.management.cognitiveservices.v2017_04_18.PrivateEndpointConnectionProperties; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; @@ -56,6 +57,10 @@ public PrivateEndpointConnectionsInner(Retrofit retrofit, CognitiveServicesManag * 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.cognitiveservices.v2017_04_18.PrivateEndpointConnections list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @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.cognitiveservices.v2017_04_18.PrivateEndpointConnections get" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -70,6 +75,92 @@ interface PrivateEndpointConnectionsService { } + /** + * Gets the private endpoint connections associated with the Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @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 PrivateEndpointConnectionListResultInner object if successful. + */ + public PrivateEndpointConnectionListResultInner list(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Gets the private endpoint connections associated with the Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @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(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Gets the private endpoint connections associated with the Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionListResultInner object + */ + public Observable listAsync(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, PrivateEndpointConnectionListResultInner>() { + @Override + public PrivateEndpointConnectionListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the private endpoint connections associated with the Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionListResultInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (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(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(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); + } + /** * Gets the specified private endpoint connection associated with the Cognitive Services account. *