diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/pom.xml b/sdk/cognitiveservices/mgmt-v2017_04_18/pom.xml index bb2a939e32d8..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.0 + 1.1.0 ../../../pom.management.xml azure-mgmt-cognitiveservices - 1.0.0-beta-3 + 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/Accounts.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/Accounts.java index 26e659d0c6b7..b78f3396353a 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/Accounts.java +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/Accounts.java @@ -25,7 +25,7 @@ public interface Accounts extends SupportsCreating userOwnedStorage; + /** + * The private endpoint connection associated with the Cognitive Services + * account. + */ + @JsonProperty(value = "privateEndpointConnections") + private List privateEndpointConnections; + + /** + * Whether or not public endpoint access is allowed for this account. Value + * is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible + * values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + /** * The api properties for special APIs. */ @@ -173,6 +189,46 @@ public CognitiveServicesAccountProperties withUserOwnedStorage(List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Set the private endpoint connection associated with the Cognitive Services account. + * + * @param privateEndpointConnections the privateEndpointConnections value to set + * @return the CognitiveServicesAccountProperties object itself. + */ + public CognitiveServicesAccountProperties withPrivateEndpointConnections(List privateEndpointConnections) { + this.privateEndpointConnections = privateEndpointConnections; + return this; + } + + /** + * Get whether or not public endpoint access is allowed for this account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'Enabled', 'Disabled'. + * + * @return the publicNetworkAccess value + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set whether or not public endpoint access is allowed for this account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'Enabled', 'Disabled'. + * + * @param publicNetworkAccess the publicNetworkAccess value to set + * @return the CognitiveServicesAccountProperties object itself. + */ + public CognitiveServicesAccountProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + /** * Get the api properties for special APIs. * diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/PrivateEndpoint.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/PrivateEndpoint.java new file mode 100644 index 000000000000..adc1c7d687f9 --- /dev/null +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/PrivateEndpoint.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; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Private Endpoint resource. + */ +public class PrivateEndpoint { + /** + * The ARM identifier for Private Endpoint. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the ARM identifier for Private Endpoint. + * + * @return the id value + */ + public String id() { + return this.id; + } + +} diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/PrivateEndpointConnection.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/PrivateEndpointConnection.java new file mode 100644 index 000000000000..4a4bac007472 --- /dev/null +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/PrivateEndpointConnection.java @@ -0,0 +1,118 @@ +/** + * 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.management.cognitiveservices.v2017_04_18.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.cognitiveservices.v2017_04_18.implementation.CognitiveServicesManager; +import java.util.List; + +/** + * 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 properties value. + */ + PrivateEndpointConnectionProperties properties(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the PrivateEndpointConnection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithAccount, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * Grouping of PrivateEndpointConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a PrivateEndpointConnection definition. + */ + interface Blank extends WithAccount { + } + + /** + * The stage of the privateendpointconnection definition allowing to specify Account. + */ + interface WithAccount { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group. The name is case insensitive + * @param accountName The name of Cognitive Services account + * @return the next definition stage + */ + WithProperties withExistingAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the privateendpointconnection definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Resource properties + * @return the next definition stage + */ + WithCreate withProperties(PrivateEndpointConnectionProperties properties); + } + + /** + * 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 { + } + } + /** + * The template for a PrivateEndpointConnection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithProperties { + } + + /** + * Grouping of PrivateEndpointConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the privateendpointconnection update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Resource properties + * @return the next update stage + */ + Update withProperties(PrivateEndpointConnectionProperties properties); + } + + } +} diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/PrivateEndpointConnectionProperties.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/PrivateEndpointConnectionProperties.java new file mode 100644 index 000000000000..2e1287693feb --- /dev/null +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/PrivateEndpointConnectionProperties.java @@ -0,0 +1,97 @@ +/** + * 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 java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the PrivateEndpointConnectProperties. + */ +public class PrivateEndpointConnectionProperties { + /** + * The resource of private end point. + */ + @JsonProperty(value = "privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /** + * A collection of information about the state of the connection between + * service consumer and provider. + */ + @JsonProperty(value = "privateLinkServiceConnectionState", required = true) + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /** + * The private link resource group ids. + */ + @JsonProperty(value = "groupIds") + private List groupIds; + + /** + * Get the resource of private end point. + * + * @return the privateEndpoint value + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the resource of private end point. + * + * @param privateEndpoint the privateEndpoint value to set + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties 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 PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the private link resource group ids. + * + * @return the groupIds value + */ + public List groupIds() { + return this.groupIds; + } + + /** + * Set the private link resource group ids. + * + * @param groupIds the groupIds value to set + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withGroupIds(List groupIds) { + this.groupIds = groupIds; + return this; + } + +} 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 new file mode 100644 index 000000000000..ed3ea424e1fb --- /dev/null +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/PrivateEndpointConnections.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.cognitiveservices.v2017_04_18; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.cognitiveservices.v2017_04_18.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 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive Services Account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive Services Account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName); + +} diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/PrivateEndpointServiceConnectionStatus.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/PrivateEndpointServiceConnectionStatus.java new file mode 100644 index 000000000000..c5797d2ee4c5 --- /dev/null +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/PrivateEndpointServiceConnectionStatus.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.cognitiveservices.v2017_04_18; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PrivateEndpointServiceConnectionStatus. + */ +public final class PrivateEndpointServiceConnectionStatus extends ExpandableStringEnum { + /** Static value Pending for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); + + /** Static value Approved for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); + + /** Static value Rejected for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); + + /** Static value Disconnected for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** + * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. + * @param name a name to look for + * @return the corresponding PrivateEndpointServiceConnectionStatus + */ + @JsonCreator + public static PrivateEndpointServiceConnectionStatus fromString(String name) { + return fromString(name, PrivateEndpointServiceConnectionStatus.class); + } + + /** + * @return known PrivateEndpointServiceConnectionStatus values + */ + public static Collection values() { + return values(PrivateEndpointServiceConnectionStatus.class); + } +} diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/PrivateLinkResourceListResult.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/PrivateLinkResourceListResult.java new file mode 100644 index 000000000000..f65304232aca --- /dev/null +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/PrivateLinkResourceListResult.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.PrivateLinkResourceListResultInner; +import com.microsoft.azure.management.cognitiveservices.v2017_04_18.implementation.PrivateLinkResourceInner; +import java.util.List; + +/** + * Type representing PrivateLinkResourceListResult. + */ +public interface PrivateLinkResourceListResult 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/PrivateLinkResourceProperties.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/PrivateLinkResourceProperties.java new file mode 100644 index 000000000000..6a68768a9d6d --- /dev/null +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/PrivateLinkResourceProperties.java @@ -0,0 +1,89 @@ +/** + * 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 java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of a private link resource. + */ +public class PrivateLinkResourceProperties { + /** + * The private link resource group id. + */ + @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /** + * The private link resource display name. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /** + * The private link resource required member names. + */ + @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /** + * The private link resource Private link DNS zone name. + */ + @JsonProperty(value = "requiredZoneNames") + private List requiredZoneNames; + + /** + * Get the private link resource group id. + * + * @return the groupId value + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the private link resource display name. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the private link resource required member names. + * + * @return the requiredMembers value + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get the private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the private link resource Private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set + * @return the PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + +} diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/PrivateLinkResources.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/PrivateLinkResources.java new file mode 100644 index 000000000000..5f20c12bc0e4 --- /dev/null +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/PrivateLinkResources.java @@ -0,0 +1,29 @@ +/** + * 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 rx.Observable; +import com.microsoft.azure.management.cognitiveservices.v2017_04_18.implementation.PrivateLinkResourcesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PrivateLinkResources. + */ +public interface PrivateLinkResources extends HasInner { + /** + * Gets the private link resources that need to be created for a 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); + +} diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/PrivateLinkServiceConnectionState.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/PrivateLinkServiceConnectionState.java new file mode 100644 index 000000000000..a8dfe3ee1ad2 --- /dev/null +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/PrivateLinkServiceConnectionState.java @@ -0,0 +1,99 @@ +/** + * 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.fasterxml.jackson.annotation.JsonProperty; + +/** + * A collection of information about the state of the connection between + * service consumer and provider. + */ +public class PrivateLinkServiceConnectionState { + /** + * Indicates whether the connection has been Approved/Rejected/Removed by + * the owner of the service. Possible values include: 'Pending', + * 'Approved', 'Rejected', 'Disconnected'. + */ + @JsonProperty(value = "status") + private PrivateEndpointServiceConnectionStatus status; + + /** + * The reason for approval/rejection of the connection. + */ + @JsonProperty(value = "description") + private String description; + + /** + * A message indicating if changes on the service provider require any + * updates on the consumer. + */ + @JsonProperty(value = "actionRequired") + private String actionRequired; + + /** + * Get indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected'. + * + * @return the status value + */ + public PrivateEndpointServiceConnectionStatus status() { + return this.status; + } + + /** + * Set indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected'. + * + * @param status the status value to set + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the reason for approval/rejection of the connection. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the reason for approval/rejection of the connection. + * + * @param description the description value to set + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get a message indicating if changes on the service provider require any updates on the consumer. + * + * @return the actionRequired value + */ + public String actionRequired() { + return this.actionRequired; + } + + /** + * Set a message indicating if changes on the service provider require any updates on the consumer. + * + * @param actionRequired the actionRequired value to set + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withActionRequired(String actionRequired) { + this.actionRequired = actionRequired; + return this; + } + +} diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/PublicNetworkAccess.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/PublicNetworkAccess.java new file mode 100644 index 000000000000..5bc13caa2851 --- /dev/null +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/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.cognitiveservices.v2017_04_18; + +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/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/AccountsInner.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/AccountsInner.java index 445794e8569a..e22e3e1b8e8e 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/AccountsInner.java +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/AccountsInner.java @@ -121,7 +121,7 @@ interface AccountsService { /** * Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the keys for developer to access intelligent APIs. It's also the resource type for billing. * - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param account The parameters to provide for the created account. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -136,7 +136,7 @@ public CognitiveServicesAccountInner create(String resourceGroupName, String acc /** * Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the keys for developer to access intelligent APIs. It's also the resource type for billing. * - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param account The parameters to provide for the created account. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -150,7 +150,7 @@ public ServiceFuture createAsync(String resourceG /** * Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the keys for developer to access intelligent APIs. It's also the resource type for billing. * - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param account The parameters to provide for the created account. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -168,7 +168,7 @@ public CognitiveServicesAccountInner call(ServiceResponse createDelegate(Response updateAsync(String resourceG /** * Updates a Cognitive Services account. * - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param account The parameters to provide for the created account. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -264,7 +264,7 @@ public CognitiveServicesAccountInner call(ServiceResponse updateDelegate(Response deleteAsync(String resourceGroupName, String accountN /** * Deletes a Cognitive Services account from the resource group. * - * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 {@link ServiceResponse} object if successful. @@ -355,7 +355,7 @@ public Void call(ServiceResponse response) { /** * Deletes a Cognitive Services account from the resource group. * - * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 {@link ServiceResponse} object if successful. @@ -399,7 +399,7 @@ private ServiceResponse deleteDelegate(Response response) th /** * Returns a Cognitive Services account specified by the parameters. * - * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 @@ -413,7 +413,7 @@ public CognitiveServicesAccountInner getByResourceGroup(String resourceGroupName /** * Returns a Cognitive Services account specified by the parameters. * - * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 @@ -426,7 +426,7 @@ public ServiceFuture getByResourceGroupAsync(Stri /** * Returns a Cognitive Services account specified by the parameters. * - * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 CognitiveServicesAccountInner object @@ -443,7 +443,7 @@ public CognitiveServicesAccountInner call(ServiceResponse getByResourceGroupDelegat /** * Returns all the resources of a particular type belonging to a resource group. * - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -504,7 +504,7 @@ public Page nextPage(String nextPageLink) { /** * Returns all the resources of a particular type belonging to a resource group. * - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object @@ -524,7 +524,7 @@ public Observable>> call(Str /** * Returns all the resources of a particular type belonging to a resource group. * - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<CognitiveServicesAccountInner> object */ @@ -541,7 +541,7 @@ public Page call(ServiceResponse>> call(Ser /** * Returns all the resources of a particular type belonging to a resource group. * - ServiceResponse> * @param resourceGroupName The name of the resource group within the user's subscription. + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<CognitiveServicesAccountInner> object wrapped in {@link ServiceResponse} if successful. */ @@ -707,7 +707,7 @@ private ServiceResponse> listDelegate(Re /** * Lists the account keys for the specified Cognitive Services account. * - * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 @@ -721,7 +721,7 @@ public CognitiveServicesAccountKeysInner listKeys(String resourceGroupName, Stri /** * Lists the account keys for the specified Cognitive Services account. * - * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 @@ -734,7 +734,7 @@ public ServiceFuture listKeysAsync(String res /** * Lists the account keys for the specified Cognitive Services account. * - * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 CognitiveServicesAccountKeysInner object @@ -751,7 +751,7 @@ public CognitiveServicesAccountKeysInner call(ServiceResponse listKeysDelegate(Resp /** * Regenerates the specified account key for the specified Cognitive Services account. * - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param keyName key name to generate (Key1|Key2). Possible values include: 'Key1', 'Key2' * @throws IllegalArgumentException thrown if parameters fail the validation @@ -808,7 +808,7 @@ public CognitiveServicesAccountKeysInner regenerateKey(String resourceGroupName, /** * Regenerates the specified account key for the specified Cognitive Services account. * - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param keyName key name to generate (Key1|Key2). Possible values include: 'Key1', 'Key2' * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -822,7 +822,7 @@ public ServiceFuture regenerateKeyAsync(Strin /** * Regenerates the specified account key for the specified Cognitive Services account. * - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param keyName key name to generate (Key1|Key2). Possible values include: 'Key1', 'Key2' * @throws IllegalArgumentException thrown if parameters fail the validation @@ -840,7 +840,7 @@ public CognitiveServicesAccountKeysInner call(ServiceResponse regenerateKeyDelegate /** * List available SKUs for the requested Cognitive Services account. * - * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 @@ -902,7 +902,7 @@ public CognitiveServicesAccountEnumerateSkusResultInner listSkus(String resource /** * List available SKUs for the requested Cognitive Services account. * - * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 @@ -915,7 +915,7 @@ public ServiceFuture listSkusA /** * List available SKUs for the requested Cognitive Services account. * - * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 CognitiveServicesAccountEnumerateSkusResultInner object @@ -932,7 +932,7 @@ public CognitiveServicesAccountEnumerateSkusResultInner call(ServiceResponse listSk /** * Get usages for the requested Cognitive Services account. * - * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 @@ -988,7 +988,7 @@ public UsagesResultInner getUsages(String resourceGroupName, String accountName) /** * Get usages for the requested Cognitive Services account. * - * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 @@ -1001,7 +1001,7 @@ public ServiceFuture getUsagesAsync(String resourceGroupName, /** * Get usages for the requested Cognitive Services account. * - * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 UsagesResultInner object @@ -1018,7 +1018,7 @@ public UsagesResultInner call(ServiceResponse response) { /** * Get usages for the requested Cognitive Services account. * - * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 UsagesResultInner object @@ -1054,7 +1054,7 @@ public Observable> call(Response getUsagesAsync(String resourceGroupName, /** * Get usages for the requested Cognitive Services account. * - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1101,7 +1101,7 @@ public UsagesResultInner call(ServiceResponse response) { /** * Get usages for the requested Cognitive Services account. * - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). * @throws IllegalArgumentException thrown if parameters fail the validation diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CognitiveServicesManagementClientImpl.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CognitiveServicesManagementClientImpl.java index 5da4953e335c..fe0d86ed21bf 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CognitiveServicesManagementClientImpl.java +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CognitiveServicesManagementClientImpl.java @@ -50,11 +50,11 @@ public AzureClient getAzureClient() { return this.azureClient; } - /** Azure Subscription ID. */ + /** The ID of the target subscription. */ private String subscriptionId; /** - * Gets Azure Subscription ID. + * Gets The ID of the target subscription. * * @return the subscriptionId value. */ @@ -63,7 +63,7 @@ public String subscriptionId() { } /** - * Sets Azure Subscription ID. + * Sets The ID of the target subscription. * * @param subscriptionId the subscriptionId value. * @return the service client itself @@ -73,11 +73,11 @@ public CognitiveServicesManagementClientImpl withSubscriptionId(String subscript return this; } - /** Version of the API to be used with the client request. Current version is 2017-04-18. */ + /** The API version to use for this operation. */ private String apiVersion; /** - * Gets Version of the API to be used with the client request. Current version is 2017-04-18. + * Gets The API version to use for this operation. * * @return the apiVersion value. */ @@ -193,6 +193,32 @@ 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; + } + /** * Initializes an instance of CognitiveServicesManagementClient client. * @@ -231,6 +257,8 @@ protected void initialize() { this.accounts = new AccountsInner(restClient().retrofit(), this); this.resourceSkus = new ResourceSkusInner(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.azureClient = new AzureClient(this); initializeService(); } diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CognitiveServicesManager.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CognitiveServicesManager.java index ae833c978ac3..efffb0db817a 100644 --- a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CognitiveServicesManager.java +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CognitiveServicesManager.java @@ -19,6 +19,8 @@ import com.microsoft.azure.management.cognitiveservices.v2017_04_18.Accounts; import com.microsoft.azure.management.cognitiveservices.v2017_04_18.ResourceSkus; import com.microsoft.azure.management.cognitiveservices.v2017_04_18.Operations; +import com.microsoft.azure.management.cognitiveservices.v2017_04_18.PrivateEndpointConnections; +import com.microsoft.azure.management.cognitiveservices.v2017_04_18.PrivateLinkResources; import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; import com.microsoft.azure.arm.resources.implementation.ManagerCore; @@ -29,6 +31,8 @@ public final class CognitiveServicesManager extends ManagerCore implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { + private final CognitiveServicesManager manager; + private String resourceGroupName; + private String accountName; + private String privateEndpointConnectionName; + private PrivateEndpointConnectionProperties cproperties; + private PrivateEndpointConnectionProperties uproperties; + + PrivateEndpointConnectionImpl(String name, CognitiveServicesManager manager) { + super(name, new PrivateEndpointConnectionInner()); + this.manager = manager; + // Set resource name + this.privateEndpointConnectionName = name; + // + this.cproperties = new PrivateEndpointConnectionProperties(); + this.uproperties = new PrivateEndpointConnectionProperties(); + } + + PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner inner, CognitiveServicesManager 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.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "accounts"); + this.privateEndpointConnectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "privateEndpointConnections"); + // + this.cproperties = new PrivateEndpointConnectionProperties(); + this.uproperties = new PrivateEndpointConnectionProperties(); + } + + @Override + public CognitiveServicesManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.privateEndpointConnectionName, this.cproperties) + .map(new Func1() { + @Override + public PrivateEndpointConnectionInner call(PrivateEndpointConnectionInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.privateEndpointConnectionName, this.uproperties) + .map(new Func1() { + @Override + public PrivateEndpointConnectionInner call(PrivateEndpointConnectionInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); + return client.getAsync(this.resourceGroupName, this.accountName, this.privateEndpointConnectionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.cproperties = new PrivateEndpointConnectionProperties(); + this.uproperties = new PrivateEndpointConnectionProperties(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public PrivateEndpointConnectionProperties properties() { + return this.inner().properties(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public PrivateEndpointConnectionImpl withExistingAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public PrivateEndpointConnectionImpl withProperties(PrivateEndpointConnectionProperties properties) { + if (isInCreateMode()) { + this.cproperties = properties; + } else { + this.uproperties = properties; + } + return this; + } + +} diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/PrivateEndpointConnectionInner.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/PrivateEndpointConnectionInner.java new file mode 100644 index 000000000000..3f42b93709e0 --- /dev/null +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/PrivateEndpointConnectionInner.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.cognitiveservices.v2017_04_18.implementation; + +import com.microsoft.azure.management.cognitiveservices.v2017_04_18.PrivateEndpointConnectionProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * The Private Endpoint Connection resource. + */ +public class PrivateEndpointConnectionInner extends ProxyResource { + /** + * Resource properties. + */ + @JsonProperty(value = "properties") + private PrivateEndpointConnectionProperties properties; + + /** + * Get resource properties. + * + * @return the properties value + */ + public PrivateEndpointConnectionProperties properties() { + return this.properties; + } + + /** + * Set resource properties. + * + * @param properties the properties value to set + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withProperties(PrivateEndpointConnectionProperties properties) { + this.properties = properties; + 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 new file mode 100644 index 000000000000..f904a6855252 --- /dev/null +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,66 @@ +/** + * 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.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.cognitiveservices.v2017_04_18.PrivateEndpointConnections; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.cognitiveservices.v2017_04_18.PrivateEndpointConnection; + +class PrivateEndpointConnectionsImpl extends WrapperImpl implements PrivateEndpointConnections { + private final CognitiveServicesManager manager; + + PrivateEndpointConnectionsImpl(CognitiveServicesManager manager) { + super(manager.inner().privateEndpointConnections()); + this.manager = manager; + } + + public CognitiveServicesManager 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 getAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName) { + PrivateEndpointConnectionsInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, 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 accountName, String privateEndpointConnectionName) { + PrivateEndpointConnectionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, privateEndpointConnectionName).toCompletable(); + } + +} 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 new file mode 100644 index 000000000000..c1183e1aa2cf --- /dev/null +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/PrivateEndpointConnectionsInner.java @@ -0,0 +1,448 @@ +/** + * 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 retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.cognitiveservices.v2017_04_18.PrivateEndpointConnectionProperties; +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 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.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 CognitiveServicesManagementClientImpl 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, CognitiveServicesManagementClientImpl 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.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); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cognitiveservices.v2017_04_18.PrivateEndpointConnections createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> createOrUpdate(@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, @Body PrivateEndpointConnectionInner properties, @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 delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", method = "DELETE", hasBody = true) + Observable> delete(@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); + + } + + /** + * Gets the specified private endpoint connection 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive Services Account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 accountName, String privateEndpointConnectionName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName).toBlocking().single().body(); + } + + /** + * Gets the specified private endpoint connection 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 privateEndpointConnectionName The name of the private endpoint connection associated with the 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 getAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Gets the specified private endpoint connection 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive Services Account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified private endpoint connection 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive Services Account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName) { + 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 (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(resourceGroupName, accountName, this.client.subscriptionId(), 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update the state of specified private endpoint connection 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive Services Account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 accountName, String privateEndpointConnectionName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName).toBlocking().single().body(); + } + + /** + * Update the state of specified private endpoint connection 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 privateEndpointConnectionName The name of the private endpoint connection associated with the 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 createOrUpdateAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Update the state of specified private endpoint connection 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive Services Account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the state of specified private endpoint connection 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive Services Account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName) { + 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 (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."); + } + final PrivateEndpointConnectionProperties properties = null; + PrivateEndpointConnectionInner properties1 = new PrivateEndpointConnectionInner(); + properties1.withProperties(null); + return service.createOrUpdate(resourceGroupName, accountName, this.client.subscriptionId(), privateEndpointConnectionName, this.client.apiVersion(), this.client.acceptLanguage(), properties1, 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); + } + } + }); + } + + /** + * Update the state of specified private endpoint connection 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive Services Account + * @param properties Resource properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 accountName, String privateEndpointConnectionName, PrivateEndpointConnectionProperties properties) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName, properties).toBlocking().single().body(); + } + + /** + * Update the state of specified private endpoint connection 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive Services Account + * @param properties Resource 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 accountName, String privateEndpointConnectionName, PrivateEndpointConnectionProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName, properties), serviceCallback); + } + + /** + * Update the state of specified private endpoint connection 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive Services Account + * @param properties Resource properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName, PrivateEndpointConnectionProperties properties) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName, properties).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the state of specified private endpoint connection 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive Services Account + * @param properties Resource properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName, PrivateEndpointConnectionProperties properties) { + 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 (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."); + } + Validator.validate(properties); + PrivateEndpointConnectionInner properties1 = new PrivateEndpointConnectionInner(); + properties1.withProperties(properties); + return service.createOrUpdate(resourceGroupName, accountName, this.client.subscriptionId(), privateEndpointConnectionName, this.client.apiVersion(), this.client.acceptLanguage(), properties1, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the specified private endpoint connection 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive Services Account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 accountName, String privateEndpointConnectionName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName).toBlocking().single().body(); + } + + /** + * Deletes the specified private endpoint connection 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 privateEndpointConnectionName The name of the private endpoint connection associated with the 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 deleteAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Deletes the specified private endpoint connection 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive Services Account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified private endpoint connection 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive Services Account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName) { + 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 (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.delete(resourceGroupName, accountName, this.client.subscriptionId(), privateEndpointConnectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/PrivateLinkResourceInner.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/PrivateLinkResourceInner.java new file mode 100644 index 000000000000..f86deee4ad14 --- /dev/null +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/PrivateLinkResourceInner.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.cognitiveservices.v2017_04_18.implementation; + +import com.microsoft.azure.management.cognitiveservices.v2017_04_18.PrivateLinkResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * A private link resource. + */ +public class PrivateLinkResourceInner extends ProxyResource { + /** + * Resource properties. + */ + @JsonProperty(value = "properties") + private PrivateLinkResourceProperties properties; + + /** + * Get resource properties. + * + * @return the properties value + */ + public PrivateLinkResourceProperties properties() { + return this.properties; + } + + /** + * Set resource properties. + * + * @param properties the properties value to set + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withProperties(PrivateLinkResourceProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/PrivateLinkResourceListResultImpl.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/PrivateLinkResourceListResultImpl.java new file mode 100644 index 000000000000..5477b8202eb2 --- /dev/null +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/PrivateLinkResourceListResultImpl.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.PrivateLinkResourceListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class PrivateLinkResourceListResultImpl extends WrapperImpl implements PrivateLinkResourceListResult { + private final CognitiveServicesManager manager; + PrivateLinkResourceListResultImpl(PrivateLinkResourceListResultInner 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/PrivateLinkResourceListResultInner.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/PrivateLinkResourceListResultInner.java new file mode 100644 index 000000000000..37a08b24031c --- /dev/null +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/PrivateLinkResourceListResultInner.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 link resources. + */ +public class PrivateLinkResourceListResultInner { + /** + * Array of private link resources. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get array of private link resources. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set array of private link resources. + * + * @param value the value value to set + * @return the PrivateLinkResourceListResultInner object itself. + */ + public PrivateLinkResourceListResultInner 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/PrivateLinkResourcesImpl.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 000000000000..281e0ccd4893 --- /dev/null +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,42 @@ +/** + * 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.cognitiveservices.v2017_04_18.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.cognitiveservices.v2017_04_18.PrivateLinkResources; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.cognitiveservices.v2017_04_18.PrivateLinkResourceListResult; + +class PrivateLinkResourcesImpl extends WrapperImpl implements PrivateLinkResources { + private final CognitiveServicesManager manager; + + PrivateLinkResourcesImpl(CognitiveServicesManager manager) { + super(manager.inner().privateLinkResources()); + this.manager = manager; + } + + public CognitiveServicesManager manager() { + return this.manager; + } + + @Override + public Observable listAsync(String resourceGroupName, String accountName) { + PrivateLinkResourcesInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .map(new Func1() { + @Override + public PrivateLinkResourceListResult call(PrivateLinkResourceListResultInner inner) { + return new PrivateLinkResourceListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/PrivateLinkResourcesInner.java b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/PrivateLinkResourcesInner.java new file mode 100644 index 000000000000..0c4c954e74c1 --- /dev/null +++ b/sdk/cognitiveservices/mgmt-v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/PrivateLinkResourcesInner.java @@ -0,0 +1,146 @@ +/** + * 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 retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +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.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 CognitiveServicesManagementClientImpl 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, CognitiveServicesManagementClientImpl 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.cognitiveservices.v2017_04_18.PrivateLinkResources list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateLinkResources") + 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); + + } + + /** + * Gets the private link resources that need to be created for a 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateLinkResourceListResultInner object if successful. + */ + public PrivateLinkResourceListResultInner list(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Gets the private link resources that need to be created for a 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 link resources that need to be created for a 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 PrivateLinkResourceListResultInner object + */ + public Observable listAsync(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, PrivateLinkResourceListResultInner>() { + @Override + public PrivateLinkResourceListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the private link resources that need to be created for a 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 PrivateLinkResourceListResultInner 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +}