From ca75af0c49f3486c36cc1212b4df0ed3e6563933 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 11 Sep 2018 07:59:16 +0000 Subject: [PATCH 1/2] Generated from f464a78317bb2bc7a42d679417195a68059bf075 Merge branch 'master' into private_preview5 --- .../InterfaceEndpointProfile.java | 120 +++ .../InterfaceEndpointProfileStateType.java | 53 ++ .../InterfaceEndpointProfiles.java | 53 ++ .../InterfaceEndpointProfileImpl.java | 122 +++ .../InterfaceEndpointProfileInner.java | 78 ++ .../InterfaceEndpointProfilesImpl.java | 81 ++ .../InterfaceEndpointProfilesInner.java | 778 ++++++++++++++++++ .../SqlManagementClientImpl.java | 14 + .../implementation/SqlManager.java | 12 + 9 files changed, 1311 insertions(+) create mode 100644 sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/InterfaceEndpointProfile.java create mode 100644 sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/InterfaceEndpointProfileStateType.java create mode 100644 sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/InterfaceEndpointProfiles.java create mode 100644 sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InterfaceEndpointProfileImpl.java create mode 100644 sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InterfaceEndpointProfileInner.java create mode 100644 sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InterfaceEndpointProfilesImpl.java create mode 100644 sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InterfaceEndpointProfilesInner.java diff --git a/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/InterfaceEndpointProfile.java b/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/InterfaceEndpointProfile.java new file mode 100644 index 000000000000..460e291c52ce --- /dev/null +++ b/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/InterfaceEndpointProfile.java @@ -0,0 +1,120 @@ +/** + * 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.sql.v2017_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.sql.v2017_10_01_preview.implementation.InterfaceEndpointProfileInner; +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.sql.v2017_10_01_preview.implementation.SqlManager; + +/** + * Type representing InterfaceEndpointProfile. + */ +public interface InterfaceEndpointProfile extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the privateIp value. + */ + String privateIp(); + + /** + * @return the state value. + */ + InterfaceEndpointProfileStateType state(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the virtualNetworkSubnetId value. + */ + String virtualNetworkSubnetId(); + + /** + * The entirety of the InterfaceEndpointProfile definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithServer, DefinitionStages.WithVirtualNetworkSubnetId, DefinitionStages.WithCreate { + } + + /** + * Grouping of InterfaceEndpointProfile definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a InterfaceEndpointProfile definition. + */ + interface Blank extends WithServer { + } + + /** + * The stage of the interfaceendpointprofile definition allowing to specify Server. + */ + interface WithServer { + /** + * Specifies resourceGroupName, serverName. + */ + WithVirtualNetworkSubnetId withExistingServer(String resourceGroupName, String serverName); + } + + /** + * The stage of the interfaceendpointprofile definition allowing to specify VirtualNetworkSubnetId. + */ + interface WithVirtualNetworkSubnetId { + /** + * Specifies virtualNetworkSubnetId. + */ + WithCreate withVirtualNetworkSubnetId(String virtualNetworkSubnetId); + } + + /** + * 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 InterfaceEndpointProfile update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithVirtualNetworkSubnetId { + } + + /** + * Grouping of InterfaceEndpointProfile update stages. + */ + interface UpdateStages { + /** + * The stage of the interfaceendpointprofile update allowing to specify VirtualNetworkSubnetId. + */ + interface WithVirtualNetworkSubnetId { + /** + * Specifies virtualNetworkSubnetId. + */ + Update withVirtualNetworkSubnetId(String virtualNetworkSubnetId); + } + + } +} diff --git a/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/InterfaceEndpointProfileStateType.java b/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/InterfaceEndpointProfileStateType.java new file mode 100644 index 000000000000..d29b8ea95728 --- /dev/null +++ b/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/InterfaceEndpointProfileStateType.java @@ -0,0 +1,53 @@ +/** + * 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.sql.v2017_10_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for InterfaceEndpointProfileStateType. + */ +public final class InterfaceEndpointProfileStateType extends ExpandableStringEnum { + /** Static value Initializing for InterfaceEndpointProfileStateType. */ + public static final InterfaceEndpointProfileStateType INITIALIZING = fromString("Initializing"); + + /** Static value InProgress for InterfaceEndpointProfileStateType. */ + public static final InterfaceEndpointProfileStateType IN_PROGRESS = fromString("InProgress"); + + /** Static value Ready for InterfaceEndpointProfileStateType. */ + public static final InterfaceEndpointProfileStateType READY = fromString("Ready"); + + /** Static value Failed for InterfaceEndpointProfileStateType. */ + public static final InterfaceEndpointProfileStateType FAILED = fromString("Failed"); + + /** Static value Deleting for InterfaceEndpointProfileStateType. */ + public static final InterfaceEndpointProfileStateType DELETING = fromString("Deleting"); + + /** Static value Unknown for InterfaceEndpointProfileStateType. */ + public static final InterfaceEndpointProfileStateType UNKNOWN = fromString("Unknown"); + + /** + * Creates or finds a InterfaceEndpointProfileStateType from its string representation. + * @param name a name to look for + * @return the corresponding InterfaceEndpointProfileStateType + */ + @JsonCreator + public static InterfaceEndpointProfileStateType fromString(String name) { + return fromString(name, InterfaceEndpointProfileStateType.class); + } + + /** + * @return known InterfaceEndpointProfileStateType values + */ + public static Collection values() { + return values(InterfaceEndpointProfileStateType.class); + } +} diff --git a/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/InterfaceEndpointProfiles.java b/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/InterfaceEndpointProfiles.java new file mode 100644 index 000000000000..112d9ab716ba --- /dev/null +++ b/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/InterfaceEndpointProfiles.java @@ -0,0 +1,53 @@ +/** + * 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.sql.v2017_10_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.sql.v2017_10_01_preview.implementation.InterfaceEndpointProfilesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing InterfaceEndpointProfiles. + */ +public interface InterfaceEndpointProfiles extends SupportsCreating, HasInner { + /** + * Gets a interface endpoint profile. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param interfaceEndpointProfileName The name of the interface endpoint profile. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String serverName, String interfaceEndpointProfileName); + + /** + * Gets a list of interface endpoint profiles attached to a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByServerAsync(final String resourceGroupName, final String serverName); + + /** + * Deletes the interface endpoint profile with the given name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param interfaceEndpointProfileName the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String serverName, String interfaceEndpointProfileName); + +} diff --git a/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InterfaceEndpointProfileImpl.java b/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InterfaceEndpointProfileImpl.java new file mode 100644 index 000000000000..ed37038771cd --- /dev/null +++ b/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InterfaceEndpointProfileImpl.java @@ -0,0 +1,122 @@ +/** + * 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.sql.v2017_10_01_preview.implementation; + +import com.microsoft.azure.management.sql.v2017_10_01_preview.InterfaceEndpointProfile; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.sql.v2017_10_01_preview.InterfaceEndpointProfileStateType; + +class InterfaceEndpointProfileImpl extends CreatableUpdatableImpl implements InterfaceEndpointProfile, InterfaceEndpointProfile.Definition, InterfaceEndpointProfile.Update { + private final SqlManager manager; + private String resourceGroupName; + private String serverName; + private String interfaceEndpointProfileName; + private String cvirtualNetworkSubnetId; + private String uvirtualNetworkSubnetId; + + InterfaceEndpointProfileImpl(String name, SqlManager manager) { + super(name, new InterfaceEndpointProfileInner()); + this.manager = manager; + // Set resource name + this.interfaceEndpointProfileName = name; + // + } + + InterfaceEndpointProfileImpl(InterfaceEndpointProfileInner inner, SqlManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.interfaceEndpointProfileName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.serverName = IdParsingUtils.getValueFromIdByName(inner.id(), "servers"); + this.interfaceEndpointProfileName = IdParsingUtils.getValueFromIdByName(inner.id(), "interfaceEndpointProfiles"); + // + } + + @Override + public SqlManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + InterfaceEndpointProfilesInner client = this.manager().inner().interfaceEndpointProfiles(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serverName, this.interfaceEndpointProfileName, this.cvirtualNetworkSubnetId) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + InterfaceEndpointProfilesInner client = this.manager().inner().interfaceEndpointProfiles(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serverName, this.interfaceEndpointProfileName, this.uvirtualNetworkSubnetId) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + InterfaceEndpointProfilesInner client = this.manager().inner().interfaceEndpointProfiles(); + return client.getAsync(this.resourceGroupName, this.serverName, this.interfaceEndpointProfileName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String privateIp() { + return this.inner().privateIp(); + } + + @Override + public InterfaceEndpointProfileStateType state() { + return this.inner().state(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String virtualNetworkSubnetId() { + return this.inner().virtualNetworkSubnetId(); + } + + @Override + public InterfaceEndpointProfileImpl withExistingServer(String resourceGroupName, String serverName) { + this.resourceGroupName = resourceGroupName; + this.serverName = serverName; + return this; + } + + @Override + public InterfaceEndpointProfileImpl withVirtualNetworkSubnetId(String virtualNetworkSubnetId) { + if (isInCreateMode()) { + this.cvirtualNetworkSubnetId = virtualNetworkSubnetId; + } else { + this.uvirtualNetworkSubnetId = virtualNetworkSubnetId; + } + return this; + } + +} diff --git a/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InterfaceEndpointProfileInner.java b/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InterfaceEndpointProfileInner.java new file mode 100644 index 000000000000..cc3522acdea7 --- /dev/null +++ b/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InterfaceEndpointProfileInner.java @@ -0,0 +1,78 @@ +/** + * 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.sql.v2017_10_01_preview.implementation; + +import com.microsoft.azure.management.sql.v2017_10_01_preview.InterfaceEndpointProfileStateType; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A interface endpoint profile resource. + */ +@JsonFlatten +public class InterfaceEndpointProfileInner extends ProxyResource { + /** + * The ARM resource id of the virtual network subnet. + */ + @JsonProperty(value = "properties.virtualNetworkSubnetId", required = true) + private String virtualNetworkSubnetId; + + /** + * The Private ip associated with the interface endpoint profile. + */ + @JsonProperty(value = "properties.privateIp", access = JsonProperty.Access.WRITE_ONLY) + private String privateIp; + + /** + * State of the interface endpoint profile. Possible values include: + * 'Initializing', 'InProgress', 'Ready', 'Failed', 'Deleting', 'Unknown'. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private InterfaceEndpointProfileStateType state; + + /** + * Get the ARM resource id of the virtual network subnet. + * + * @return the virtualNetworkSubnetId value + */ + public String virtualNetworkSubnetId() { + return this.virtualNetworkSubnetId; + } + + /** + * Set the ARM resource id of the virtual network subnet. + * + * @param virtualNetworkSubnetId the virtualNetworkSubnetId value to set + * @return the InterfaceEndpointProfileInner object itself. + */ + public InterfaceEndpointProfileInner withVirtualNetworkSubnetId(String virtualNetworkSubnetId) { + this.virtualNetworkSubnetId = virtualNetworkSubnetId; + return this; + } + + /** + * Get the Private ip associated with the interface endpoint profile. + * + * @return the privateIp value + */ + public String privateIp() { + return this.privateIp; + } + + /** + * Get state of the interface endpoint profile. Possible values include: 'Initializing', 'InProgress', 'Ready', 'Failed', 'Deleting', 'Unknown'. + * + * @return the state value + */ + public InterfaceEndpointProfileStateType state() { + return this.state; + } + +} diff --git a/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InterfaceEndpointProfilesImpl.java b/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InterfaceEndpointProfilesImpl.java new file mode 100644 index 000000000000..3cca2a4cb09e --- /dev/null +++ b/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InterfaceEndpointProfilesImpl.java @@ -0,0 +1,81 @@ +/** + * 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.sql.v2017_10_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.sql.v2017_10_01_preview.InterfaceEndpointProfiles; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.sql.v2017_10_01_preview.InterfaceEndpointProfile; + +class InterfaceEndpointProfilesImpl extends WrapperImpl implements InterfaceEndpointProfiles { + private final SqlManager manager; + + InterfaceEndpointProfilesImpl(SqlManager manager) { + super(manager.inner().interfaceEndpointProfiles()); + this.manager = manager; + } + + public SqlManager manager() { + return this.manager; + } + + @Override + public InterfaceEndpointProfileImpl define(String name) { + return wrapModel(name); + } + + private InterfaceEndpointProfileImpl wrapModel(InterfaceEndpointProfileInner inner) { + return new InterfaceEndpointProfileImpl(inner, manager()); + } + + private InterfaceEndpointProfileImpl wrapModel(String name) { + return new InterfaceEndpointProfileImpl(name, this.manager()); + } + + @Override + public Observable listByServerAsync(final String resourceGroupName, final String serverName) { + InterfaceEndpointProfilesInner client = this.inner(); + return client.listByServerAsync(resourceGroupName, serverName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public InterfaceEndpointProfile call(InterfaceEndpointProfileInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String serverName, String interfaceEndpointProfileName) { + InterfaceEndpointProfilesInner client = this.inner(); + return client.getAsync(resourceGroupName, serverName, interfaceEndpointProfileName) + .map(new Func1() { + @Override + public InterfaceEndpointProfile call(InterfaceEndpointProfileInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String serverName, String interfaceEndpointProfileName) { + InterfaceEndpointProfilesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, serverName, interfaceEndpointProfileName).toCompletable(); + } + +} diff --git a/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InterfaceEndpointProfilesInner.java b/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InterfaceEndpointProfilesInner.java new file mode 100644 index 000000000000..696b686dd449 --- /dev/null +++ b/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InterfaceEndpointProfilesInner.java @@ -0,0 +1,778 @@ +/** + * 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.sql.v2017_10_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +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.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in InterfaceEndpointProfiles. + */ +public class InterfaceEndpointProfilesInner { + /** The Retrofit service to perform REST calls. */ + private InterfaceEndpointProfilesService service; + /** The service client containing this operation class. */ + private SqlManagementClientImpl client; + + /** + * Initializes an instance of InterfaceEndpointProfilesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public InterfaceEndpointProfilesInner(Retrofit retrofit, SqlManagementClientImpl client) { + this.service = retrofit.create(InterfaceEndpointProfilesService.class); + this.client = client; + } + + /** + * The interface defining all the services for InterfaceEndpointProfiles to be + * used by Retrofit to perform actually REST calls. + */ + interface InterfaceEndpointProfilesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2017_10_01_preview.InterfaceEndpointProfiles get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/interfaceEndpointProfiles/{interfaceEndpointProfileName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("interfaceEndpointProfileName") String interfaceEndpointProfileName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2017_10_01_preview.InterfaceEndpointProfiles createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/interfaceEndpointProfiles/{interfaceEndpointProfileName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("interfaceEndpointProfileName") String interfaceEndpointProfileName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body InterfaceEndpointProfileInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2017_10_01_preview.InterfaceEndpointProfiles beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/interfaceEndpointProfiles/{interfaceEndpointProfileName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("interfaceEndpointProfileName") String interfaceEndpointProfileName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body InterfaceEndpointProfileInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2017_10_01_preview.InterfaceEndpointProfiles delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/interfaceEndpointProfiles/{interfaceEndpointProfileName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("interfaceEndpointProfileName") String interfaceEndpointProfileName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2017_10_01_preview.InterfaceEndpointProfiles beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/interfaceEndpointProfiles/{interfaceEndpointProfileName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("interfaceEndpointProfileName") String interfaceEndpointProfileName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2017_10_01_preview.InterfaceEndpointProfiles listByServer" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/interfaceEndpointProfiles") + Observable> listByServer(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2017_10_01_preview.InterfaceEndpointProfiles listByServerNext" }) + @GET + Observable> listByServerNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a interface endpoint profile. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param interfaceEndpointProfileName The name of the interface endpoint profile. + * @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 InterfaceEndpointProfileInner object if successful. + */ + public InterfaceEndpointProfileInner get(String resourceGroupName, String serverName, String interfaceEndpointProfileName) { + return getWithServiceResponseAsync(resourceGroupName, serverName, interfaceEndpointProfileName).toBlocking().single().body(); + } + + /** + * Gets a interface endpoint profile. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param interfaceEndpointProfileName The name of the interface endpoint profile. + * @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 serverName, String interfaceEndpointProfileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serverName, interfaceEndpointProfileName), serviceCallback); + } + + /** + * Gets a interface endpoint profile. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param interfaceEndpointProfileName The name of the interface endpoint profile. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InterfaceEndpointProfileInner object + */ + public Observable getAsync(String resourceGroupName, String serverName, String interfaceEndpointProfileName) { + return getWithServiceResponseAsync(resourceGroupName, serverName, interfaceEndpointProfileName).map(new Func1, InterfaceEndpointProfileInner>() { + @Override + public InterfaceEndpointProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a interface endpoint profile. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param interfaceEndpointProfileName The name of the interface endpoint profile. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InterfaceEndpointProfileInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String serverName, String interfaceEndpointProfileName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (interfaceEndpointProfileName == null) { + throw new IllegalArgumentException("Parameter interfaceEndpointProfileName 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.get(resourceGroupName, serverName, interfaceEndpointProfileName, 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 = 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); + } + + /** + * Creates or updates a interface endpoint profile. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param interfaceEndpointProfileName the String value + * @param virtualNetworkSubnetId The ARM resource id of the virtual network subnet. + * @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 InterfaceEndpointProfileInner object if successful. + */ + public InterfaceEndpointProfileInner createOrUpdate(String resourceGroupName, String serverName, String interfaceEndpointProfileName, String virtualNetworkSubnetId) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, interfaceEndpointProfileName, virtualNetworkSubnetId).toBlocking().last().body(); + } + + /** + * Creates or updates a interface endpoint profile. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param interfaceEndpointProfileName the String value + * @param virtualNetworkSubnetId The ARM resource id of the virtual network subnet. + * @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 serverName, String interfaceEndpointProfileName, String virtualNetworkSubnetId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, interfaceEndpointProfileName, virtualNetworkSubnetId), serviceCallback); + } + + /** + * Creates or updates a interface endpoint profile. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param interfaceEndpointProfileName the String value + * @param virtualNetworkSubnetId The ARM resource id of the virtual network subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String serverName, String interfaceEndpointProfileName, String virtualNetworkSubnetId) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, interfaceEndpointProfileName, virtualNetworkSubnetId).map(new Func1, InterfaceEndpointProfileInner>() { + @Override + public InterfaceEndpointProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a interface endpoint profile. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param interfaceEndpointProfileName the String value + * @param virtualNetworkSubnetId The ARM resource id of the virtual network subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String interfaceEndpointProfileName, String virtualNetworkSubnetId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (interfaceEndpointProfileName == null) { + throw new IllegalArgumentException("Parameter interfaceEndpointProfileName 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."); + } + if (virtualNetworkSubnetId == null) { + throw new IllegalArgumentException("Parameter virtualNetworkSubnetId is required and cannot be null."); + } + InterfaceEndpointProfileInner parameters = new InterfaceEndpointProfileInner(); + parameters.withVirtualNetworkSubnetId(virtualNetworkSubnetId); + Observable> observable = service.createOrUpdate(resourceGroupName, serverName, interfaceEndpointProfileName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a interface endpoint profile. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param interfaceEndpointProfileName the String value + * @param virtualNetworkSubnetId The ARM resource id of the virtual network subnet. + * @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 InterfaceEndpointProfileInner object if successful. + */ + public InterfaceEndpointProfileInner beginCreateOrUpdate(String resourceGroupName, String serverName, String interfaceEndpointProfileName, String virtualNetworkSubnetId) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, interfaceEndpointProfileName, virtualNetworkSubnetId).toBlocking().single().body(); + } + + /** + * Creates or updates a interface endpoint profile. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param interfaceEndpointProfileName the String value + * @param virtualNetworkSubnetId The ARM resource id of the virtual network subnet. + * @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 beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String interfaceEndpointProfileName, String virtualNetworkSubnetId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, interfaceEndpointProfileName, virtualNetworkSubnetId), serviceCallback); + } + + /** + * Creates or updates a interface endpoint profile. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param interfaceEndpointProfileName the String value + * @param virtualNetworkSubnetId The ARM resource id of the virtual network subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InterfaceEndpointProfileInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String interfaceEndpointProfileName, String virtualNetworkSubnetId) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, interfaceEndpointProfileName, virtualNetworkSubnetId).map(new Func1, InterfaceEndpointProfileInner>() { + @Override + public InterfaceEndpointProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a interface endpoint profile. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param interfaceEndpointProfileName the String value + * @param virtualNetworkSubnetId The ARM resource id of the virtual network subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InterfaceEndpointProfileInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String interfaceEndpointProfileName, String virtualNetworkSubnetId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (interfaceEndpointProfileName == null) { + throw new IllegalArgumentException("Parameter interfaceEndpointProfileName 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."); + } + if (virtualNetworkSubnetId == null) { + throw new IllegalArgumentException("Parameter virtualNetworkSubnetId is required and cannot be null."); + } + InterfaceEndpointProfileInner parameters = new InterfaceEndpointProfileInner(); + parameters.withVirtualNetworkSubnetId(virtualNetworkSubnetId); + return service.beginCreateOrUpdate(resourceGroupName, serverName, interfaceEndpointProfileName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the interface endpoint profile with the given name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param interfaceEndpointProfileName the String value + * @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 serverName, String interfaceEndpointProfileName) { + deleteWithServiceResponseAsync(resourceGroupName, serverName, interfaceEndpointProfileName).toBlocking().last().body(); + } + + /** + * Deletes the interface endpoint profile with the given name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param interfaceEndpointProfileName the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String serverName, String interfaceEndpointProfileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, serverName, interfaceEndpointProfileName), serviceCallback); + } + + /** + * Deletes the interface endpoint profile with the given name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param interfaceEndpointProfileName the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String serverName, String interfaceEndpointProfileName) { + return deleteWithServiceResponseAsync(resourceGroupName, serverName, interfaceEndpointProfileName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the interface endpoint profile with the given name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param interfaceEndpointProfileName the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String serverName, String interfaceEndpointProfileName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (interfaceEndpointProfileName == null) { + throw new IllegalArgumentException("Parameter interfaceEndpointProfileName 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."); + } + Observable> observable = service.delete(resourceGroupName, serverName, interfaceEndpointProfileName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the interface endpoint profile with the given name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param interfaceEndpointProfileName the String value + * @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 beginDelete(String resourceGroupName, String serverName, String interfaceEndpointProfileName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, serverName, interfaceEndpointProfileName).toBlocking().single().body(); + } + + /** + * Deletes the interface endpoint profile with the given name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param interfaceEndpointProfileName the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String serverName, String interfaceEndpointProfileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, serverName, interfaceEndpointProfileName), serviceCallback); + } + + /** + * Deletes the interface endpoint profile with the given name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param interfaceEndpointProfileName the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String serverName, String interfaceEndpointProfileName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, serverName, interfaceEndpointProfileName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the interface endpoint profile with the given name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param interfaceEndpointProfileName the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String serverName, String interfaceEndpointProfileName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (interfaceEndpointProfileName == null) { + throw new IllegalArgumentException("Parameter interfaceEndpointProfileName 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.beginDelete(resourceGroupName, serverName, interfaceEndpointProfileName, 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 = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of interface endpoint profiles attached to a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @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 PagedList<InterfaceEndpointProfileInner> object if successful. + */ + public PagedList listByServer(final String resourceGroupName, final String serverName) { + ServiceResponse> response = listByServerSinglePageAsync(resourceGroupName, serverName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of interface endpoint profiles attached to a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @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> listByServerAsync(final String resourceGroupName, final String serverName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByServerSinglePageAsync(resourceGroupName, serverName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of interface endpoint profiles attached to a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InterfaceEndpointProfileInner> object + */ + public Observable> listByServerAsync(final String resourceGroupName, final String serverName) { + return listByServerWithServiceResponseAsync(resourceGroupName, serverName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of interface endpoint profiles attached to a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InterfaceEndpointProfileInner> object + */ + public Observable>> listByServerWithServiceResponseAsync(final String resourceGroupName, final String serverName) { + return listByServerSinglePageAsync(resourceGroupName, serverName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByServerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of interface endpoint profiles attached to a server. + * + ServiceResponse> * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + ServiceResponse> * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<InterfaceEndpointProfileInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServerSinglePageAsync(final String resourceGroupName, final String serverName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName 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.listByServer(resourceGroupName, serverName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServerDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByServerDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of interface endpoint profiles attached to a server. + * + * @param nextPageLink The NextLink from the previous successful call to List 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 PagedList<InterfaceEndpointProfileInner> object if successful. + */ + public PagedList listByServerNext(final String nextPageLink) { + ServiceResponse> response = listByServerNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of interface endpoint profiles attached to a server. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listByServerNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByServerNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of interface endpoint profiles attached to a server. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InterfaceEndpointProfileInner> object + */ + public Observable> listByServerNextAsync(final String nextPageLink) { + return listByServerNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of interface endpoint profiles attached to a server. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InterfaceEndpointProfileInner> object + */ + public Observable>> listByServerNextWithServiceResponseAsync(final String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByServerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of interface endpoint profiles attached to a server. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<InterfaceEndpointProfileInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServerNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByServerNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServerNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByServerNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/SqlManagementClientImpl.java b/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/SqlManagementClientImpl.java index 296cf77e0688..579bd4722f8c 100644 --- a/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/SqlManagementClientImpl.java +++ b/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/SqlManagementClientImpl.java @@ -288,6 +288,19 @@ public ManagedInstanceEncryptionProtectorsInner managedInstanceEncryptionProtect return this.managedInstanceEncryptionProtectors; } + /** + * The InterfaceEndpointProfilesInner object to access its operations. + */ + private InterfaceEndpointProfilesInner interfaceEndpointProfiles; + + /** + * Gets the InterfaceEndpointProfilesInner object to access its operations. + * @return the InterfaceEndpointProfilesInner object. + */ + public InterfaceEndpointProfilesInner interfaceEndpointProfiles() { + return this.interfaceEndpointProfiles; + } + /** * Initializes an instance of SqlManagementClient client. * @@ -335,6 +348,7 @@ protected void initialize() { this.managedInstanceTdeCertificates = new ManagedInstanceTdeCertificatesInner(restClient().retrofit(), this); this.managedInstanceKeys = new ManagedInstanceKeysInner(restClient().retrofit(), this); this.managedInstanceEncryptionProtectors = new ManagedInstanceEncryptionProtectorsInner(restClient().retrofit(), this); + this.interfaceEndpointProfiles = new InterfaceEndpointProfilesInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); } diff --git a/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/SqlManager.java b/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/SqlManager.java index 6677354b17e3..ee25a105218d 100644 --- a/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/SqlManager.java +++ b/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/SqlManager.java @@ -28,6 +28,7 @@ import com.microsoft.azure.management.sql.v2017_10_01_preview.ManagedInstanceTdeCertificates; import com.microsoft.azure.management.sql.v2017_10_01_preview.ManagedInstanceKeys; import com.microsoft.azure.management.sql.v2017_10_01_preview.ManagedInstanceEncryptionProtectors; +import com.microsoft.azure.management.sql.v2017_10_01_preview.InterfaceEndpointProfiles; import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; import com.microsoft.azure.arm.resources.implementation.ManagerCore; @@ -47,6 +48,7 @@ public final class SqlManager extends ManagerCore Date: Thu, 4 Oct 2018 06:15:24 +0000 Subject: [PATCH 2/2] Generated from f5074a07cda67de2413f9cbe92cb6c530adb9342 Merge branch 'master' into private_preview5 --- .../implementation/DatabaseSecurityAlertPolicyInner.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabaseSecurityAlertPolicyInner.java b/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabaseSecurityAlertPolicyInner.java index 7a528d7a582e..1e92ff6db0b1 100644 --- a/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabaseSecurityAlertPolicyInner.java +++ b/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabaseSecurityAlertPolicyInner.java @@ -43,7 +43,8 @@ public class DatabaseSecurityAlertPolicyInner extends ProxyResource { /** * Specifies the semicolon-separated list of alerts that are disabled, or * empty string to disable no alerts. Possible values: Sql_Injection; - * Sql_Injection_Vulnerability; Access_Anomaly; Usage_Anomaly. + * Sql_Injection_Vulnerability; Access_Anomaly; Data_Exfiltration; + * Unsafe_Action. */ @JsonProperty(value = "properties.disabledAlerts") private String disabledAlerts; @@ -141,7 +142,7 @@ public DatabaseSecurityAlertPolicyInner withState(SecurityAlertPolicyState state } /** - * Get specifies the semicolon-separated list of alerts that are disabled, or empty string to disable no alerts. Possible values: Sql_Injection; Sql_Injection_Vulnerability; Access_Anomaly; Usage_Anomaly. + * Get specifies the semicolon-separated list of alerts that are disabled, or empty string to disable no alerts. Possible values: Sql_Injection; Sql_Injection_Vulnerability; Access_Anomaly; Data_Exfiltration; Unsafe_Action. * * @return the disabledAlerts value */ @@ -150,7 +151,7 @@ public String disabledAlerts() { } /** - * Set specifies the semicolon-separated list of alerts that are disabled, or empty string to disable no alerts. Possible values: Sql_Injection; Sql_Injection_Vulnerability; Access_Anomaly; Usage_Anomaly. + * Set specifies the semicolon-separated list of alerts that are disabled, or empty string to disable no alerts. Possible values: Sql_Injection; Sql_Injection_Vulnerability; Access_Anomaly; Data_Exfiltration; Unsafe_Action. * * @param disabledAlerts the disabledAlerts value to set * @return the DatabaseSecurityAlertPolicyInner object itself.