Skip to content

Commit

Permalink
Generated from 60de4c8e4df2bd90b44ed70a90d48385e6f6971a
Browse files Browse the repository at this point in the history
Add Metrics Advisor API Properties.
  • Loading branch information
SDK Automation committed Sep 8, 2020
1 parent 51b0378 commit c1c1385
Show file tree
Hide file tree
Showing 8 changed files with 324 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sdk/cognitiveservices/mgmt-v2017_04_18/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
<parent>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-arm-parent</artifactId>
<version>1.3.2</version>
<relativePath>../../parents/azure-arm-parent/pom.xml</relativePath>
<version>1.1.0</version>
<relativePath>../../../pom.management.xml</relativePath>
</parent>
<artifactId>azure-mgmt-cognitiveservices</artifactId>
<version>1.0.0</version>
<version>1.0.0-beta</version>
<packaging>jar</packaging>
<name>Microsoft Azure SDK for CognitiveServices Management</name>
<description>This package contains Microsoft CognitiveServices Management SDK.</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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;
}

}
Original file line number Diff line number Diff line change
@@ -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<PrivateEndpointConnectionListResultInner>, HasManager<CognitiveServicesManager> {
/**
* @return the value value.
*/
List<PrivateEndpointConnectionInner> value();

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@
* Type representing PrivateEndpointConnections.
*/
public interface PrivateEndpointConnections extends SupportsCreating<PrivateEndpointConnection.DefinitionStages.Blank>, HasInner<PrivateEndpointConnectionsInner> {
/**
* 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<PrivateEndpointConnectionListResult> listAsync(String resourceGroupName, String accountName);

/**
* Gets the specified private endpoint connection associated with the Cognitive Services account.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -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<PrivateEndpointConnectionListResultInner> 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<PrivateEndpointConnectionInner> value() {
return this.inner().value();
}

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

/**
* Get array of private endpoint connections.
*
* @return the value value
*/
public List<PrivateEndpointConnectionInner> 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<PrivateEndpointConnectionInner> value) {
this.value = value;
return this;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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<PrivateEndpointConnectionsInner> implements PrivateEndpointConnections {
Expand Down Expand Up @@ -41,6 +42,18 @@ private PrivateEndpointConnectionImpl wrapModel(String name) {
return new PrivateEndpointConnectionImpl(name, this.manager());
}

@Override
public Observable<PrivateEndpointConnectionListResult> listAsync(String resourceGroupName, String accountName) {
PrivateEndpointConnectionsInner client = this.inner();
return client.listAsync(resourceGroupName, accountName)
.map(new Func1<PrivateEndpointConnectionListResultInner, PrivateEndpointConnectionListResult>() {
@Override
public PrivateEndpointConnectionListResult call(PrivateEndpointConnectionListResultInner inner) {
return new PrivateEndpointConnectionListResultImpl(inner, manager());
}
});
}

@Override
public Observable<PrivateEndpointConnection> getAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName) {
PrivateEndpointConnectionsInner client = this.inner();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<Response<ResponseBody>> 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<Response<ResponseBody>> 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);
Expand All @@ -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<PrivateEndpointConnectionListResultInner> listAsync(String resourceGroupName, String accountName, final ServiceCallback<PrivateEndpointConnectionListResultInner> 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<PrivateEndpointConnectionListResultInner> listAsync(String resourceGroupName, String accountName) {
return listWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1<ServiceResponse<PrivateEndpointConnectionListResultInner>, PrivateEndpointConnectionListResultInner>() {
@Override
public PrivateEndpointConnectionListResultInner call(ServiceResponse<PrivateEndpointConnectionListResultInner> 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<ServiceResponse<PrivateEndpointConnectionListResultInner>> 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<Response<ResponseBody>, Observable<ServiceResponse<PrivateEndpointConnectionListResultInner>>>() {
@Override
public Observable<ServiceResponse<PrivateEndpointConnectionListResultInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PrivateEndpointConnectionListResultInner> clientResponse = listDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}

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

/**
* Gets the specified private endpoint connection associated with the Cognitive Services account.
*
Expand Down

0 comments on commit c1c1385

Please sign in to comment.