diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateEndpointConnection.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateEndpointConnection.java index 5acc3989eb306..556def5c8f4bb 100644 --- a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateEndpointConnection.java +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateEndpointConnection.java @@ -45,7 +45,7 @@ public interface PrivateEndpointConnection extends HasInner, UpdateStages.WithSearchManagementRequestOptions, UpdateStages.WithId, UpdateStages.WithProperties { + interface Update extends Appliable, UpdateStages.WithProperties, UpdateStages.WithSearchManagementRequestOptions { } /** @@ -53,39 +53,27 @@ interface Update extends Appliable, UpdateStages.With */ interface UpdateStages { /** - * The stage of the privateendpointconnection update allowing to specify SearchManagementRequestOptions. - */ - interface WithSearchManagementRequestOptions { - /** - * Specifies searchManagementRequestOptions. - * @param searchManagementRequestOptions Additional parameters for the operation - * @return the next update stage - */ - Update withSearchManagementRequestOptions(SearchManagementRequestOptions searchManagementRequestOptions); - } - - /** - * The stage of the privateendpointconnection update allowing to specify Id. + * The stage of the privateendpointconnection update allowing to specify Properties. */ - interface WithId { + interface WithProperties { /** - * Specifies id. - * @param id The ID of the private endpoint connection. This can be used with the Azure Resource Manager to link resources together + * Specifies properties. + * @param properties Describes the properties of an existing Private Endpoint connection to the Azure Cognitive Search service * @return the next update stage */ - Update withId(String id); + Update withProperties(PrivateEndpointConnectionProperties properties); } /** - * The stage of the privateendpointconnection update allowing to specify Properties. + * The stage of the privateendpointconnection update allowing to specify SearchManagementRequestOptions. */ - interface WithProperties { + interface WithSearchManagementRequestOptions { /** - * Specifies properties. - * @param properties Describes the properties of an existing Private Endpoint connection to the Azure Cognitive Search service + * Specifies searchManagementRequestOptions. + * @param searchManagementRequestOptions Additional parameters for the operation * @return the next update stage */ - Update withProperties(PrivateEndpointConnectionProperties properties); + Update withSearchManagementRequestOptions(SearchManagementRequestOptions searchManagementRequestOptions); } } diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SharedPrivateLinkResource.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SharedPrivateLinkResource.java index 31e478ba31619..62908521301ab 100644 --- a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SharedPrivateLinkResource.java +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SharedPrivateLinkResource.java @@ -11,6 +11,9 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.management.search.v2020_03_13.implementation.SharedPrivateLinkResourceInner; 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.search.v2020_03_13.implementation.SearchManager; @@ -19,7 +22,12 @@ /** * Type representing SharedPrivateLinkResource. */ -public interface SharedPrivateLinkResource extends HasInner, Indexable, HasManager { +public interface SharedPrivateLinkResource extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + /** * @return the name value. */ @@ -30,10 +38,15 @@ public interface SharedPrivateLinkResource extends HasInner { } + } + /** + * The template for a SharedPrivateLinkResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithProperties, UpdateStages.WithSearchManagementRequestOptions { + } + /** + * Grouping of SharedPrivateLinkResource update stages. + */ + interface UpdateStages { /** - * The stage of the sharedprivatelinkresource definition allowing to specify Properties. + * The stage of the sharedprivatelinkresource update allowing to specify Properties. */ interface WithProperties { /** * Specifies properties. * @param properties Describes the properties of a Shared Private Link Resource managed by the Azure Cognitive Search service - * @return the next definition stage + * @return the next update stage */ - WithCreate withProperties(SharedPrivateLinkResourceProperties properties); + Update withProperties(SharedPrivateLinkResourceProperties 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. + * The stage of the sharedprivatelinkresource update allowing to specify SearchManagementRequestOptions. */ - interface WithCreate extends Creatable, DefinitionStages.WithName, DefinitionStages.WithProperties { + interface WithSearchManagementRequestOptions { + /** + * Specifies searchManagementRequestOptions. + * @param searchManagementRequestOptions Additional parameters for the operation + * @return the next update stage + */ + Update withSearchManagementRequestOptions(SearchManagementRequestOptions searchManagementRequestOptions); } + } } diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateEndpointConnectionImpl.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateEndpointConnectionImpl.java index a56b479a66135..cd9ac443bbb84 100644 --- a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateEndpointConnectionImpl.java +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateEndpointConnectionImpl.java @@ -11,9 +11,9 @@ import com.microsoft.azure.management.search.v2020_03_13.PrivateEndpointConnection; import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; import rx.Observable; +import com.microsoft.azure.management.search.v2020_03_13.PrivateEndpointConnectionProperties; import com.microsoft.azure.management.search.v2020_03_13.SearchManagementRequestOptions; import java.util.UUID; -import com.microsoft.azure.management.search.v2020_03_13.PrivateEndpointConnectionProperties; import rx.functions.Func1; class PrivateEndpointConnectionImpl extends CreatableUpdatableImpl implements PrivateEndpointConnection, PrivateEndpointConnection.Update { @@ -21,6 +21,7 @@ class PrivateEndpointConnectionImpl extends CreatableUpdatableImpl createResourceAsync() { @Override public Observable updateResourceAsync() { PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); - return client.updateAsync(this.resourceGroupName, this.searchServiceName, this.privateEndpointConnectionName, this.inner(), this.usearchManagementRequestOptions) + return client.updateAsync(this.resourceGroupName, this.searchServiceName, this.privateEndpointConnectionName, this.uproperties, this.usearchManagementRequestOptions) .map(new Func1() { @Override public PrivateEndpointConnectionInner call(PrivateEndpointConnectionInner resource) { @@ -82,6 +85,7 @@ public boolean isInCreateMode() { } private void resetCreateUpdateParameters() { + this.uproperties = new PrivateEndpointConnectionProperties(); this.usearchManagementRequestOptions = new SearchManagementRequestOptions(); } @@ -106,20 +110,14 @@ public String type() { } @Override - public PrivateEndpointConnectionImpl withSearchManagementRequestOptions(SearchManagementRequestOptions searchManagementRequestOptions) { - this.usearchManagementRequestOptions = searchManagementRequestOptions; - return this; - } - - @Override - public PrivateEndpointConnectionImpl withId(String id) { - this.inner().withId(id); + public PrivateEndpointConnectionImpl withProperties(PrivateEndpointConnectionProperties properties) { + this.uproperties = properties; return this; } @Override - public PrivateEndpointConnectionImpl withProperties(PrivateEndpointConnectionProperties properties) { - this.inner().withProperties(properties); + public PrivateEndpointConnectionImpl withSearchManagementRequestOptions(SearchManagementRequestOptions searchManagementRequestOptions) { + this.usearchManagementRequestOptions = searchManagementRequestOptions; return this; } diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateEndpointConnectionInner.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateEndpointConnectionInner.java index 1d4ead1e06675..e241533373450 100644 --- a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateEndpointConnectionInner.java +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateEndpointConnectionInner.java @@ -10,31 +10,13 @@ import com.microsoft.azure.management.search.v2020_03_13.PrivateEndpointConnectionProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; /** * Describes an existing Private Endpoint connection to the Azure Cognitive * Search service. */ -public class PrivateEndpointConnectionInner { - /** - * The ID of the private endpoint connection. This can be used with the - * Azure Resource Manager to link resources together. - */ - @JsonProperty(value = "id") - private String id; - - /** - * The name of the private endpoint connection. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /** - * The resource type. - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - +public class PrivateEndpointConnectionInner extends ProxyResource { /** * Describes the properties of an existing Private Endpoint connection to * the Azure Cognitive Search service. @@ -42,44 +24,6 @@ public class PrivateEndpointConnectionInner { @JsonProperty(value = "properties") private PrivateEndpointConnectionProperties properties; - /** - * Get the ID of the private endpoint connection. This can be used with the Azure Resource Manager to link resources together. - * - * @return the id value - */ - public String id() { - return this.id; - } - - /** - * Set the ID of the private endpoint connection. This can be used with the Azure Resource Manager to link resources together. - * - * @param id the id value to set - * @return the PrivateEndpointConnectionInner object itself. - */ - public PrivateEndpointConnectionInner withId(String id) { - this.id = id; - return this; - } - - /** - * Get the name of the private endpoint connection. - * - * @return the name value - */ - public String name() { - return this.name; - } - - /** - * Get the resource type. - * - * @return the type value - */ - public String type() { - return this.type; - } - /** * Get describes the properties of an existing Private Endpoint connection to the Azure Cognitive Search service. * diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateEndpointConnectionsInner.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateEndpointConnectionsInner.java index 82fc411c41139..e3bdd4f595aed 100644 --- a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateEndpointConnectionsInner.java +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateEndpointConnectionsInner.java @@ -13,6 +13,7 @@ import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.search.v2020_03_13.PrivateEndpointConnectionProperties; import com.microsoft.azure.management.search.v2020_03_13.SearchManagementRequestOptions; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; @@ -65,7 +66,7 @@ public PrivateEndpointConnectionsInner(Retrofit retrofit, SearchManagementClient interface PrivateEndpointConnectionsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.search.v2020_03_13.PrivateEndpointConnections update" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateEndpointConnections/{privateEndpointConnectionName}") - Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("searchServiceName") String searchServiceName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Path("subscriptionId") String subscriptionId, @Body PrivateEndpointConnectionInner privateEndpointConnection, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-client-request-id") UUID clientRequestId, @Header("User-Agent") String userAgent); + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("searchServiceName") String searchServiceName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-client-request-id") UUID clientRequestId, @Body PrivateEndpointConnectionInner privateEndpointConnection, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.search.v2020_03_13.PrivateEndpointConnections get" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateEndpointConnections/{privateEndpointConnectionName}") @@ -91,14 +92,13 @@ interface PrivateEndpointConnectionsService { * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. - * @param privateEndpointConnection The definition of the private endpoint connection to update. * @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 update(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { - return updateWithServiceResponseAsync(resourceGroupName, searchServiceName, privateEndpointConnectionName, privateEndpointConnection).toBlocking().single().body(); + public PrivateEndpointConnectionInner update(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName) { + return updateWithServiceResponseAsync(resourceGroupName, searchServiceName, privateEndpointConnectionName).toBlocking().single().body(); } /** @@ -107,13 +107,12 @@ public PrivateEndpointConnectionInner update(String resourceGroupName, String se * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. - * @param privateEndpointConnection The definition of the private endpoint connection to update. * @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 updateAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, searchServiceName, privateEndpointConnectionName, privateEndpointConnection), serviceCallback); + public ServiceFuture updateAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, searchServiceName, privateEndpointConnectionName), serviceCallback); } /** @@ -122,12 +121,11 @@ public ServiceFuture updateAsync(String resource * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. - * @param privateEndpointConnection The definition of the private endpoint connection to update. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PrivateEndpointConnectionInner object */ - public Observable updateAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { - return updateWithServiceResponseAsync(resourceGroupName, searchServiceName, privateEndpointConnectionName, privateEndpointConnection).map(new Func1, PrivateEndpointConnectionInner>() { + public Observable updateAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName) { + return updateWithServiceResponseAsync(resourceGroupName, searchServiceName, privateEndpointConnectionName).map(new Func1, PrivateEndpointConnectionInner>() { @Override public PrivateEndpointConnectionInner call(ServiceResponse response) { return response.body(); @@ -141,11 +139,10 @@ public PrivateEndpointConnectionInner call(ServiceResponse> updateWithServiceResponseAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -158,16 +155,15 @@ public Observable> updateWithSer if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (privateEndpointConnection == null) { - throw new IllegalArgumentException("Parameter privateEndpointConnection 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(privateEndpointConnection); + final PrivateEndpointConnectionProperties properties = null; final SearchManagementRequestOptions searchManagementRequestOptions = null; UUID clientRequestId = null; - return service.update(resourceGroupName, searchServiceName, privateEndpointConnectionName, this.client.subscriptionId(), privateEndpointConnection, this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + PrivateEndpointConnectionInner privateEndpointConnection = new PrivateEndpointConnectionInner(); + privateEndpointConnection.withProperties(null); + return service.update(resourceGroupName, searchServiceName, privateEndpointConnectionName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, privateEndpointConnection, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -187,15 +183,15 @@ public Observable> call(Response * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. - * @param privateEndpointConnection The definition of the private endpoint connection to update. + * @param properties Describes the properties of an existing Private Endpoint connection to the Azure Cognitive Search service. * @param searchManagementRequestOptions Additional parameters for the operation * @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 update(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection, SearchManagementRequestOptions searchManagementRequestOptions) { - return updateWithServiceResponseAsync(resourceGroupName, searchServiceName, privateEndpointConnectionName, privateEndpointConnection, searchManagementRequestOptions).toBlocking().single().body(); + public PrivateEndpointConnectionInner update(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName, PrivateEndpointConnectionProperties properties, SearchManagementRequestOptions searchManagementRequestOptions) { + return updateWithServiceResponseAsync(resourceGroupName, searchServiceName, privateEndpointConnectionName, properties, searchManagementRequestOptions).toBlocking().single().body(); } /** @@ -204,14 +200,14 @@ public PrivateEndpointConnectionInner update(String resourceGroupName, String se * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. - * @param privateEndpointConnection The definition of the private endpoint connection to update. + * @param properties Describes the properties of an existing Private Endpoint connection to the Azure Cognitive Search service. * @param searchManagementRequestOptions Additional parameters for the operation * @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 updateAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection, SearchManagementRequestOptions searchManagementRequestOptions, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, searchServiceName, privateEndpointConnectionName, privateEndpointConnection, searchManagementRequestOptions), serviceCallback); + public ServiceFuture updateAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName, PrivateEndpointConnectionProperties properties, SearchManagementRequestOptions searchManagementRequestOptions, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, searchServiceName, privateEndpointConnectionName, properties, searchManagementRequestOptions), serviceCallback); } /** @@ -220,13 +216,13 @@ public ServiceFuture updateAsync(String resource * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. - * @param privateEndpointConnection The definition of the private endpoint connection to update. + * @param properties Describes the properties of an existing Private Endpoint connection to the Azure Cognitive Search service. * @param searchManagementRequestOptions Additional parameters for the operation * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PrivateEndpointConnectionInner object */ - public Observable updateAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection, SearchManagementRequestOptions searchManagementRequestOptions) { - return updateWithServiceResponseAsync(resourceGroupName, searchServiceName, privateEndpointConnectionName, privateEndpointConnection, searchManagementRequestOptions).map(new Func1, PrivateEndpointConnectionInner>() { + public Observable updateAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName, PrivateEndpointConnectionProperties properties, SearchManagementRequestOptions searchManagementRequestOptions) { + return updateWithServiceResponseAsync(resourceGroupName, searchServiceName, privateEndpointConnectionName, properties, searchManagementRequestOptions).map(new Func1, PrivateEndpointConnectionInner>() { @Override public PrivateEndpointConnectionInner call(ServiceResponse response) { return response.body(); @@ -240,12 +236,12 @@ public PrivateEndpointConnectionInner call(ServiceResponse> updateWithServiceResponseAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection, SearchManagementRequestOptions searchManagementRequestOptions) { + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName, PrivateEndpointConnectionProperties properties, SearchManagementRequestOptions searchManagementRequestOptions) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -258,19 +254,18 @@ public Observable> updateWithSer if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (privateEndpointConnection == null) { - throw new IllegalArgumentException("Parameter privateEndpointConnection 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(privateEndpointConnection); + Validator.validate(properties); Validator.validate(searchManagementRequestOptions); UUID clientRequestId = null; if (searchManagementRequestOptions != null) { clientRequestId = searchManagementRequestOptions.clientRequestId(); } - return service.update(resourceGroupName, searchServiceName, privateEndpointConnectionName, this.client.subscriptionId(), privateEndpointConnection, this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + PrivateEndpointConnectionInner privateEndpointConnection = new PrivateEndpointConnectionInner(); + privateEndpointConnection.withProperties(properties); + return service.update(resourceGroupName, searchServiceName, privateEndpointConnectionName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, privateEndpointConnection, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SharedPrivateLinkResourceImpl.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SharedPrivateLinkResourceImpl.java index ce9f098ee460d..520130f822a2a 100644 --- a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SharedPrivateLinkResourceImpl.java +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SharedPrivateLinkResourceImpl.java @@ -11,17 +11,19 @@ import com.microsoft.azure.management.search.v2020_03_13.SharedPrivateLinkResource; import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; import rx.Observable; +import com.microsoft.azure.management.search.v2020_03_13.SharedPrivateLinkResourceProperties; import com.microsoft.azure.management.search.v2020_03_13.SearchManagementRequestOptions; import java.util.UUID; -import com.microsoft.azure.management.search.v2020_03_13.SharedPrivateLinkResourceProperties; import rx.functions.Func1; -class SharedPrivateLinkResourceImpl extends CreatableUpdatableImpl implements SharedPrivateLinkResource, SharedPrivateLinkResource.Definition { +class SharedPrivateLinkResourceImpl extends CreatableUpdatableImpl implements SharedPrivateLinkResource, SharedPrivateLinkResource.Definition, SharedPrivateLinkResource.Update { private final SearchManager manager; private String resourceGroupName; private String searchServiceName; private String sharedPrivateLinkResourceName; + private SharedPrivateLinkResourceProperties cproperties; private SearchManagementRequestOptions csearchManagementRequestOptions; + private SharedPrivateLinkResourceProperties uproperties; private SearchManagementRequestOptions usearchManagementRequestOptions; SharedPrivateLinkResourceImpl(String name, SearchManager manager) { @@ -30,7 +32,9 @@ class SharedPrivateLinkResourceImpl extends CreatableUpdatableImpl createResourceAsync() { SharedPrivateLinkResourcesInner client = this.manager().inner().sharedPrivateLinkResources(); - return client.createOrUpdateAsync(this.resourceGroupName, this.searchServiceName, this.sharedPrivateLinkResourceName, this.inner(), this.csearchManagementRequestOptions) + return client.createOrUpdateAsync(this.resourceGroupName, this.searchServiceName, this.sharedPrivateLinkResourceName, this.cproperties, this.csearchManagementRequestOptions) .map(new Func1() { @Override public SharedPrivateLinkResourceInner call(SharedPrivateLinkResourceInner resource) { @@ -66,26 +76,40 @@ public SharedPrivateLinkResourceInner call(SharedPrivateLinkResourceInner resour @Override public Observable updateResourceAsync() { SharedPrivateLinkResourcesInner client = this.manager().inner().sharedPrivateLinkResources(); - return null; // NOP updateResourceAsync implementation as update is not supported + return client.createOrUpdateAsync(this.resourceGroupName, this.searchServiceName, this.sharedPrivateLinkResourceName, this.uproperties, this.usearchManagementRequestOptions) + .map(new Func1() { + @Override + public SharedPrivateLinkResourceInner call(SharedPrivateLinkResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); } @Override protected Observable getInnerAsync() { SharedPrivateLinkResourcesInner client = this.manager().inner().sharedPrivateLinkResources(); - return null; // NOP getInnerAsync implementation as get is not supported + return client.getAsync(this.resourceGroupName, this.searchServiceName, this.sharedPrivateLinkResourceName); } @Override public boolean isInCreateMode() { - // This is a create-only resource - return true; + return this.inner().id() == null; } private void resetCreateUpdateParameters() { + this.cproperties = new SharedPrivateLinkResourceProperties(); this.csearchManagementRequestOptions = new SearchManagementRequestOptions(); + this.uproperties = new SharedPrivateLinkResourceProperties(); this.usearchManagementRequestOptions = new SearchManagementRequestOptions(); } + @Override + public String id() { + return this.inner().id(); + } + @Override public String name() { return this.inner().name(); @@ -97,27 +121,34 @@ public SharedPrivateLinkResourceProperties properties() { } @Override - public SharedPrivateLinkResourceImpl withExistingSearchService(String resourceGroupName, String searchServiceName) { - this.resourceGroupName = resourceGroupName; - this.searchServiceName = searchServiceName; - return this; + public String type() { + return this.inner().type(); } @Override - public SharedPrivateLinkResourceImpl withSearchManagementRequestOptions(SearchManagementRequestOptions searchManagementRequestOptions) { - this.csearchManagementRequestOptions = searchManagementRequestOptions; + public SharedPrivateLinkResourceImpl withExistingSearchService(String resourceGroupName, String searchServiceName) { + this.resourceGroupName = resourceGroupName; + this.searchServiceName = searchServiceName; return this; } @Override - public SharedPrivateLinkResourceImpl withName(String name) { - this.inner().withName(name); + public SharedPrivateLinkResourceImpl withProperties(SharedPrivateLinkResourceProperties properties) { + if (isInCreateMode()) { + this.cproperties = properties; + } else { + this.uproperties = properties; + } return this; } @Override - public SharedPrivateLinkResourceImpl withProperties(SharedPrivateLinkResourceProperties properties) { - this.inner().withProperties(properties); + public SharedPrivateLinkResourceImpl withSearchManagementRequestOptions(SearchManagementRequestOptions searchManagementRequestOptions) { + if (isInCreateMode()) { + this.csearchManagementRequestOptions = searchManagementRequestOptions; + } else { + this.usearchManagementRequestOptions = searchManagementRequestOptions; + } return this; } diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SharedPrivateLinkResourceInner.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SharedPrivateLinkResourceInner.java index e33f211abd6cd..e02e9b6abedd0 100644 --- a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SharedPrivateLinkResourceInner.java +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SharedPrivateLinkResourceInner.java @@ -10,18 +10,13 @@ import com.microsoft.azure.management.search.v2020_03_13.SharedPrivateLinkResourceProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; /** * Describes a Shared Private Link Resource managed by the Azure Cognitive * Search service. */ -public class SharedPrivateLinkResourceInner { - /** - * The name of the shared private link resource. - */ - @JsonProperty(value = "name") - private String name; - +public class SharedPrivateLinkResourceInner extends ProxyResource { /** * Describes the properties of a Shared Private Link Resource managed by * the Azure Cognitive Search service. @@ -29,26 +24,6 @@ public class SharedPrivateLinkResourceInner { @JsonProperty(value = "properties") private SharedPrivateLinkResourceProperties properties; - /** - * Get the name of the shared private link resource. - * - * @return the name value - */ - public String name() { - return this.name; - } - - /** - * Set the name of the shared private link resource. - * - * @param name the name value to set - * @return the SharedPrivateLinkResourceInner object itself. - */ - public SharedPrivateLinkResourceInner withName(String name) { - this.name = name; - return this; - } - /** * Get describes the properties of a Shared Private Link Resource managed by the Azure Cognitive Search service. * diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SharedPrivateLinkResourcesInner.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SharedPrivateLinkResourcesInner.java index d9084fec320b8..ebed20b28a74c 100644 --- a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SharedPrivateLinkResourcesInner.java +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SharedPrivateLinkResourcesInner.java @@ -14,6 +14,7 @@ import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; import com.microsoft.azure.management.search.v2020_03_13.SearchManagementRequestOptions; +import com.microsoft.azure.management.search.v2020_03_13.SharedPrivateLinkResourceProperties; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -65,7 +66,7 @@ public SharedPrivateLinkResourcesInner(Retrofit retrofit, SearchManagementClient interface SharedPrivateLinkResourcesService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.search.v2020_03_13.SharedPrivateLinkResources createOrUpdate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}") - Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("searchServiceName") String searchServiceName, @Path("sharedPrivateLinkResourceName") String sharedPrivateLinkResourceName, @Path("subscriptionId") String subscriptionId, @Body SharedPrivateLinkResourceInner sharedPrivateLinkResource, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-client-request-id") UUID clientRequestId, @Header("User-Agent") String userAgent); + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("searchServiceName") String searchServiceName, @Path("sharedPrivateLinkResourceName") String sharedPrivateLinkResourceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-client-request-id") UUID clientRequestId, @Body SharedPrivateLinkResourceInner sharedPrivateLinkResource, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.search.v2020_03_13.SharedPrivateLinkResources get" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}") @@ -91,14 +92,13 @@ interface SharedPrivateLinkResourcesService { * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. - * @param sharedPrivateLinkResource The definition of the shared private link resource to create or update. * @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 SharedPrivateLinkResourceInner object if successful. */ - public SharedPrivateLinkResourceInner createOrUpdate(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner sharedPrivateLinkResource) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, sharedPrivateLinkResource).toBlocking().single().body(); + public SharedPrivateLinkResourceInner createOrUpdate(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName).toBlocking().single().body(); } /** @@ -107,13 +107,12 @@ public SharedPrivateLinkResourceInner createOrUpdate(String resourceGroupName, S * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. - * @param sharedPrivateLinkResource The definition of the shared private link resource to create or update. * @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 searchServiceName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner sharedPrivateLinkResource, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, sharedPrivateLinkResource), serviceCallback); + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName), serviceCallback); } /** @@ -122,12 +121,11 @@ public ServiceFuture createOrUpdateAsync(String * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. - * @param sharedPrivateLinkResource The definition of the shared private link resource to create or update. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the SharedPrivateLinkResourceInner object */ - public Observable createOrUpdateAsync(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner sharedPrivateLinkResource) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, sharedPrivateLinkResource).map(new Func1, SharedPrivateLinkResourceInner>() { + public Observable createOrUpdateAsync(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName).map(new Func1, SharedPrivateLinkResourceInner>() { @Override public SharedPrivateLinkResourceInner call(ServiceResponse response) { return response.body(); @@ -141,11 +139,10 @@ public SharedPrivateLinkResourceInner call(ServiceResponse> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner sharedPrivateLinkResource) { + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -158,16 +155,15 @@ public Observable> createOrUpdat if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (sharedPrivateLinkResource == null) { - throw new IllegalArgumentException("Parameter sharedPrivateLinkResource 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(sharedPrivateLinkResource); + final SharedPrivateLinkResourceProperties properties = null; final SearchManagementRequestOptions searchManagementRequestOptions = null; UUID clientRequestId = null; - return service.createOrUpdate(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, this.client.subscriptionId(), sharedPrivateLinkResource, this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + SharedPrivateLinkResourceInner sharedPrivateLinkResource = new SharedPrivateLinkResourceInner(); + sharedPrivateLinkResource.withProperties(null); + return service.createOrUpdate(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, sharedPrivateLinkResource, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -187,15 +183,15 @@ public Observable> call(Response * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. - * @param sharedPrivateLinkResource The definition of the shared private link resource to create or update. + * @param properties Describes the properties of a Shared Private Link Resource managed by the Azure Cognitive Search service. * @param searchManagementRequestOptions Additional parameters for the operation * @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 SharedPrivateLinkResourceInner object if successful. */ - public SharedPrivateLinkResourceInner createOrUpdate(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner sharedPrivateLinkResource, SearchManagementRequestOptions searchManagementRequestOptions) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, sharedPrivateLinkResource, searchManagementRequestOptions).toBlocking().single().body(); + public SharedPrivateLinkResourceInner createOrUpdate(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceProperties properties, SearchManagementRequestOptions searchManagementRequestOptions) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, properties, searchManagementRequestOptions).toBlocking().single().body(); } /** @@ -204,14 +200,14 @@ public SharedPrivateLinkResourceInner createOrUpdate(String resourceGroupName, S * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. - * @param sharedPrivateLinkResource The definition of the shared private link resource to create or update. + * @param properties Describes the properties of a Shared Private Link Resource managed by the Azure Cognitive Search service. * @param searchManagementRequestOptions Additional parameters for the operation * @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 searchServiceName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner sharedPrivateLinkResource, SearchManagementRequestOptions searchManagementRequestOptions, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, sharedPrivateLinkResource, searchManagementRequestOptions), serviceCallback); + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceProperties properties, SearchManagementRequestOptions searchManagementRequestOptions, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, properties, searchManagementRequestOptions), serviceCallback); } /** @@ -220,13 +216,13 @@ public ServiceFuture createOrUpdateAsync(String * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. - * @param sharedPrivateLinkResource The definition of the shared private link resource to create or update. + * @param properties Describes the properties of a Shared Private Link Resource managed by the Azure Cognitive Search service. * @param searchManagementRequestOptions Additional parameters for the operation * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the SharedPrivateLinkResourceInner object */ - public Observable createOrUpdateAsync(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner sharedPrivateLinkResource, SearchManagementRequestOptions searchManagementRequestOptions) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, sharedPrivateLinkResource, searchManagementRequestOptions).map(new Func1, SharedPrivateLinkResourceInner>() { + public Observable createOrUpdateAsync(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceProperties properties, SearchManagementRequestOptions searchManagementRequestOptions) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, properties, searchManagementRequestOptions).map(new Func1, SharedPrivateLinkResourceInner>() { @Override public SharedPrivateLinkResourceInner call(ServiceResponse response) { return response.body(); @@ -240,12 +236,12 @@ public SharedPrivateLinkResourceInner call(ServiceResponse> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner sharedPrivateLinkResource, SearchManagementRequestOptions searchManagementRequestOptions) { + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceProperties properties, SearchManagementRequestOptions searchManagementRequestOptions) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -258,19 +254,18 @@ public Observable> createOrUpdat if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (sharedPrivateLinkResource == null) { - throw new IllegalArgumentException("Parameter sharedPrivateLinkResource 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(sharedPrivateLinkResource); + Validator.validate(properties); Validator.validate(searchManagementRequestOptions); UUID clientRequestId = null; if (searchManagementRequestOptions != null) { clientRequestId = searchManagementRequestOptions.clientRequestId(); } - return service.createOrUpdate(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, this.client.subscriptionId(), sharedPrivateLinkResource, this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + SharedPrivateLinkResourceInner sharedPrivateLinkResource = new SharedPrivateLinkResourceInner(); + sharedPrivateLinkResource.withProperties(properties); + return service.createOrUpdate(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, sharedPrivateLinkResource, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) {