diff --git a/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/AccountPatch.java b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/AccountPatch.java new file mode 100644 index 000000000000..bc87a6fe03de --- /dev/null +++ b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/AccountPatch.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.engagementfabric; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The patch of EngagementFabric account. + */ +public class AccountPatch { + /** + * The tags of the resource. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the tags of the resource. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags of the resource. + * + * @param tags the tags value to set + * @return the AccountPatch object itself. + */ + public AccountPatch withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/ChannelTypeDescription.java b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/ChannelTypeDescription.java new file mode 100644 index 000000000000..b4548023664f --- /dev/null +++ b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/ChannelTypeDescription.java @@ -0,0 +1,96 @@ +/** + * 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.engagementfabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * EngagementFabric channel description. + */ +public class ChannelTypeDescription { + /** + * Channel type. + */ + @JsonProperty(value = "channelType") + private String channelType; + + /** + * Text description for the channel. + */ + @JsonProperty(value = "channelDescription") + private String channelDescription; + + /** + * All the available functions for the channel. + */ + @JsonProperty(value = "channelFunctions") + private List channelFunctions; + + /** + * Get channel type. + * + * @return the channelType value + */ + public String channelType() { + return this.channelType; + } + + /** + * Set channel type. + * + * @param channelType the channelType value to set + * @return the ChannelTypeDescription object itself. + */ + public ChannelTypeDescription withChannelType(String channelType) { + this.channelType = channelType; + return this; + } + + /** + * Get text description for the channel. + * + * @return the channelDescription value + */ + public String channelDescription() { + return this.channelDescription; + } + + /** + * Set text description for the channel. + * + * @param channelDescription the channelDescription value to set + * @return the ChannelTypeDescription object itself. + */ + public ChannelTypeDescription withChannelDescription(String channelDescription) { + this.channelDescription = channelDescription; + return this; + } + + /** + * Get all the available functions for the channel. + * + * @return the channelFunctions value + */ + public List channelFunctions() { + return this.channelFunctions; + } + + /** + * Set all the available functions for the channel. + * + * @param channelFunctions the channelFunctions value to set + * @return the ChannelTypeDescription object itself. + */ + public ChannelTypeDescription withChannelFunctions(List channelFunctions) { + this.channelFunctions = channelFunctions; + return this; + } + +} diff --git a/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/CheckNameAvailabilityParameter.java b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/CheckNameAvailabilityParameter.java new file mode 100644 index 000000000000..8ce58f62379f --- /dev/null +++ b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/CheckNameAvailabilityParameter.java @@ -0,0 +1,69 @@ +/** + * 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.engagementfabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameter for name availability check. + */ +public class CheckNameAvailabilityParameter { + /** + * The name to be checked. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The fully qualified resource type for the name to be checked. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Get the name to be checked. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name to be checked. + * + * @param name the name value to set + * @return the CheckNameAvailabilityParameter object itself. + */ + public CheckNameAvailabilityParameter withName(String name) { + this.name = name; + return this; + } + + /** + * Get the fully qualified resource type for the name to be checked. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the fully qualified resource type for the name to be checked. + * + * @param type the type value to set + * @return the CheckNameAvailabilityParameter object itself. + */ + public CheckNameAvailabilityParameter withType(String type) { + this.type = type; + return this; + } + +} diff --git a/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/CheckNameUnavailableReason.java b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/CheckNameUnavailableReason.java new file mode 100644 index 000000000000..88a4db0f5d2c --- /dev/null +++ b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/CheckNameUnavailableReason.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.engagementfabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for CheckNameUnavailableReason. + */ +public final class CheckNameUnavailableReason extends ExpandableStringEnum { + /** Static value Invalid for CheckNameUnavailableReason. */ + public static final CheckNameUnavailableReason INVALID = fromString("Invalid"); + + /** Static value AlreadyExists for CheckNameUnavailableReason. */ + public static final CheckNameUnavailableReason ALREADY_EXISTS = fromString("AlreadyExists"); + + /** + * Creates or finds a CheckNameUnavailableReason from its string representation. + * @param name a name to look for + * @return the corresponding CheckNameUnavailableReason + */ + @JsonCreator + public static CheckNameUnavailableReason fromString(String name) { + return fromString(name, CheckNameUnavailableReason.class); + } + + /** + * @return known CheckNameUnavailableReason values + */ + public static Collection values() { + return values(CheckNameUnavailableReason.class); + } +} diff --git a/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/KeyRank.java b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/KeyRank.java new file mode 100644 index 000000000000..61aac39ed5af --- /dev/null +++ b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/KeyRank.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.engagementfabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for KeyRank. + */ +public final class KeyRank extends ExpandableStringEnum { + /** Static value PrimaryKey for KeyRank. */ + public static final KeyRank PRIMARY_KEY = fromString("PrimaryKey"); + + /** Static value SecondaryKey for KeyRank. */ + public static final KeyRank SECONDARY_KEY = fromString("SecondaryKey"); + + /** + * Creates or finds a KeyRank from its string representation. + * @param name a name to look for + * @return the corresponding KeyRank + */ + @JsonCreator + public static KeyRank fromString(String name) { + return fromString(name, KeyRank.class); + } + + /** + * @return known KeyRank values + */ + public static Collection values() { + return values(KeyRank.class); + } +} diff --git a/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/OperationDisplay.java b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/OperationDisplay.java new file mode 100644 index 000000000000..c79cb9882d06 --- /dev/null +++ b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/OperationDisplay.java @@ -0,0 +1,77 @@ +/** + * 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.engagementfabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The display information of the EngagementFabric operation. + */ +public class OperationDisplay { + /** + * The resource provider namespace of the EngagementFabric operation. + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** + * The resource type of the EngagementFabric operation. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /** + * The name of the EngagementFabric operation. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * The description of the EngagementFabric operation. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get the resource provider namespace of the EngagementFabric operation. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource type of the EngagementFabric operation. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Get the name of the EngagementFabric operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Get the description of the EngagementFabric operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + +} diff --git a/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/ProxyOnlyResource.java b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/ProxyOnlyResource.java new file mode 100644 index 000000000000..db9893749973 --- /dev/null +++ b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/ProxyOnlyResource.java @@ -0,0 +1,17 @@ +/** + * 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.engagementfabric; + +import com.microsoft.azure.ProxyResource; + +/** + * The base model for the proxy-only Azure resource. + */ +public class ProxyOnlyResource extends ProxyResource { +} diff --git a/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/RegenerateKeyParameter.java b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/RegenerateKeyParameter.java new file mode 100644 index 000000000000..cd97c6c8492a --- /dev/null +++ b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/RegenerateKeyParameter.java @@ -0,0 +1,70 @@ +/** + * 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.engagementfabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameter to regenerate single EngagementFabric account key. + */ +public class RegenerateKeyParameter { + /** + * The name of key to be regenerated. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The rank of the key to be regenerated. Possible values include: + * 'PrimaryKey', 'SecondaryKey'. + */ + @JsonProperty(value = "rank", required = true) + private KeyRank rank; + + /** + * Get the name of key to be regenerated. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of key to be regenerated. + * + * @param name the name value to set + * @return the RegenerateKeyParameter object itself. + */ + public RegenerateKeyParameter withName(String name) { + this.name = name; + return this; + } + + /** + * Get the rank of the key to be regenerated. Possible values include: 'PrimaryKey', 'SecondaryKey'. + * + * @return the rank value + */ + public KeyRank rank() { + return this.rank; + } + + /** + * Set the rank of the key to be regenerated. Possible values include: 'PrimaryKey', 'SecondaryKey'. + * + * @param rank the rank value to set + * @return the RegenerateKeyParameter object itself. + */ + public RegenerateKeyParameter withRank(KeyRank rank) { + this.rank = rank; + return this; + } + +} diff --git a/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/SkuLocationInfoItem.java b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/SkuLocationInfoItem.java new file mode 100644 index 000000000000..0792ae894798 --- /dev/null +++ b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/SkuLocationInfoItem.java @@ -0,0 +1,70 @@ +/** + * 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.engagementfabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Locations and zones info for SKU. + */ +public class SkuLocationInfoItem { + /** + * The available location of the SKU. + */ + @JsonProperty(value = "location") + private String location; + + /** + * The available zone of the SKU. + */ + @JsonProperty(value = "zones") + private List zones; + + /** + * Get the available location of the SKU. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the available location of the SKU. + * + * @param location the location value to set + * @return the SkuLocationInfoItem object itself. + */ + public SkuLocationInfoItem withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the available zone of the SKU. + * + * @return the zones value + */ + public List zones() { + return this.zones; + } + + /** + * Set the available zone of the SKU. + * + * @param zones the zones value to set + * @return the SkuLocationInfoItem object itself. + */ + public SkuLocationInfoItem withZones(List zones) { + this.zones = zones; + return this; + } + +} diff --git a/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/AccountInner.java b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/AccountInner.java new file mode 100644 index 000000000000..2015cc64d1bc --- /dev/null +++ b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/AccountInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.engagementfabric.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Resource; + +/** + * The EngagementFabric account. + */ +public class AccountInner extends Resource { + /** + * The SKU of the resource. + */ + @JsonProperty(value = "sku", required = true) + private SKUInner sku; + + /** + * Get the SKU of the resource. + * + * @return the sku value + */ + public SKUInner sku() { + return this.sku; + } + + /** + * Set the SKU of the resource. + * + * @param sku the sku value to set + * @return the AccountInner object itself. + */ + public AccountInner withSku(SKUInner sku) { + this.sku = sku; + return this; + } + +} diff --git a/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/AccountsInner.java b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/AccountsInner.java new file mode 100644 index 000000000000..4e531553b87a --- /dev/null +++ b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/AccountsInner.java @@ -0,0 +1,988 @@ +/** + * 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.engagementfabric.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.engagementfabric.AccountPatch; +import com.microsoft.azure.management.engagementfabric.RegenerateKeyParameter; +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 com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +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.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Accounts. + */ +public class AccountsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private AccountsService service; + /** The service client containing this operation class. */ + private EngagementFabricImpl client; + + /** + * Initializes an instance of AccountsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AccountsInner(Retrofit retrofit, EngagementFabricImpl client) { + this.service = retrofit.create(AccountsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Accounts to be + * used by Retrofit to perform actually REST calls. + */ + interface AccountsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.engagementfabric.Accounts getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EngagementFabric/Accounts/{accountName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.engagementfabric.Accounts createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EngagementFabric/Accounts/{accountName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Body AccountInner account, @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.engagementfabric.Accounts delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EngagementFabric/Accounts/{accountName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.engagementfabric.Accounts update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EngagementFabric/Accounts/{accountName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body AccountPatch accountPatch, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.engagementfabric.Accounts list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.EngagementFabric/Accounts") + Observable> list(@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.engagementfabric.Accounts listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EngagementFabric/Accounts") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @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.engagementfabric.Accounts listKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EngagementFabric/Accounts/{accountName}/listKeys") + Observable> listKeys(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.engagementfabric.Accounts regenerateKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EngagementFabric/Accounts/{accountName}/regenerateKey") + Observable> regenerateKey(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Body RegenerateKeyParameter parameter, @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.engagementfabric.Accounts listChannelTypes" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EngagementFabric/Accounts/{accountName}/listChannelTypes") + Observable> listChannelTypes(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @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 AccountInner object if successful. + */ + public AccountInner getByResourceGroup(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Get the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @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 getByResourceGroupAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Get the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccountInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, AccountInner>() { + @Override + public AccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccountInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(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); + } + + /** + * Create or Update the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @param account The EngagementFabric account description + * @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 AccountInner object if successful. + */ + public AccountInner createOrUpdate(String resourceGroupName, String accountName, AccountInner account) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, account).toBlocking().single().body(); + } + + /** + * Create or Update the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @param account The EngagementFabric account description + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, AccountInner account, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, account), serviceCallback); + } + + /** + * Create or Update the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @param account The EngagementFabric account description + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccountInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, AccountInner account) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, account).map(new Func1, AccountInner>() { + @Override + public AccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or Update the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @param account The EngagementFabric account description + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccountInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, AccountInner account) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (account == null) { + throw new IllegalArgumentException("Parameter account 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(account); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, account, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Delete the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Delete the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update EngagementFabric account. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @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 AccountInner object if successful. + */ + public AccountInner update(String resourceGroupName, String accountName) { + return updateWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Update EngagementFabric account. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @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 accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Update EngagementFabric account. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccountInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName) { + return updateWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, AccountInner>() { + @Override + public AccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update EngagementFabric account. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccountInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Map tags = null; + AccountPatch accountPatch = new AccountPatch(); + accountPatch.withTags(null); + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), accountPatch, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Update EngagementFabric account. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @param tags The tags of the resource + * @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 AccountInner object if successful. + */ + public AccountInner update(String resourceGroupName, String accountName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, tags).toBlocking().single().body(); + } + + /** + * Update EngagementFabric account. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @param tags The tags of the resource + * @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 accountName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, tags), serviceCallback); + } + + /** + * Update EngagementFabric account. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @param tags The tags of the resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccountInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, tags).map(new Func1, AccountInner>() { + @Override + public AccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update EngagementFabric account. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @param tags The tags of the resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccountInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(tags); + AccountPatch accountPatch = new AccountPatch(); + accountPatch.withTags(tags); + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), accountPatch, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(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); + } + + /** + * List the EngagementFabric accounts in given subscription. + * + * @return the PagedList object if successful. + */ + public PagedList list() { + PageImpl page = new PageImpl<>(); + page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * List the EngagementFabric accounts in given subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * List the EngagementFabric accounts in given subscription. + * + * @return the observable to the List<AccountInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * List the EngagementFabric accounts in given subscription. + * + * @return the observable to the List<AccountInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(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 = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List EngagementFabric accounts in given resource group. + * + * @param resourceGroupName Resource Group Name + * @return the PagedList object if successful. + */ + public PagedList listByResourceGroup(String resourceGroupName) { + PageImpl page = new PageImpl<>(); + page.setItems(listByResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * List EngagementFabric accounts in given resource group. + * + * @param resourceGroupName Resource Group Name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName), serviceCallback); + } + + /** + * List EngagementFabric accounts in given resource group. + * + * @param resourceGroupName Resource Group Name + * @return the observable to the List<AccountInner> object + */ + public Observable> listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * List EngagementFabric accounts in given resource group. + * + * @param resourceGroupName Resource Group Name + * @return the observable to the List<AccountInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName 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.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(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); + } + + /** + * List keys of the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @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 List<KeyDescriptionInner> object if successful. + */ + public List listKeys(String resourceGroupName, String accountName) { + return listKeysWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * List keys of the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @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> listKeysAsync(String resourceGroupName, String accountName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * List keys of the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<KeyDescriptionInner> object + */ + public Observable> listKeysAsync(String resourceGroupName, String accountName) { + return listKeysWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List keys of the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<KeyDescriptionInner> object + */ + public Observable>> listKeysWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listKeys(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listKeysDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listKeysDelegate(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); + } + + /** + * Regenerate key of the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @param parameter Parameters specifying the key to be regenerated + * @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 KeyDescriptionInner object if successful. + */ + public KeyDescriptionInner regenerateKey(String resourceGroupName, String accountName, RegenerateKeyParameter parameter) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, parameter).toBlocking().single().body(); + } + + /** + * Regenerate key of the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @param parameter Parameters specifying the key to be regenerated + * @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 regenerateKeyAsync(String resourceGroupName, String accountName, RegenerateKeyParameter parameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, parameter), serviceCallback); + } + + /** + * Regenerate key of the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @param parameter Parameters specifying the key to be regenerated + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyDescriptionInner object + */ + public Observable regenerateKeyAsync(String resourceGroupName, String accountName, RegenerateKeyParameter parameter) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, parameter).map(new Func1, KeyDescriptionInner>() { + @Override + public KeyDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerate key of the EngagementFabric account. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @param parameter Parameters specifying the key to be regenerated + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyDescriptionInner object + */ + public Observable> regenerateKeyWithServiceResponseAsync(String resourceGroupName, String accountName, RegenerateKeyParameter parameter) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (parameter == null) { + throw new IllegalArgumentException("Parameter parameter 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(parameter); + return service.regenerateKey(this.client.subscriptionId(), resourceGroupName, accountName, parameter, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateKeyDelegate(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); + } + + /** + * List available EngagementFabric channel types and functions. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @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 ChannelTypeDescriptionListInner object if successful. + */ + public ChannelTypeDescriptionListInner listChannelTypes(String resourceGroupName, String accountName) { + return listChannelTypesWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * List available EngagementFabric channel types and functions. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @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 listChannelTypesAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listChannelTypesWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * List available EngagementFabric channel types and functions. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ChannelTypeDescriptionListInner object + */ + public Observable listChannelTypesAsync(String resourceGroupName, String accountName) { + return listChannelTypesWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, ChannelTypeDescriptionListInner>() { + @Override + public ChannelTypeDescriptionListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List available EngagementFabric channel types and functions. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ChannelTypeDescriptionListInner object + */ + public Observable> listChannelTypesWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listChannelTypes(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listChannelTypesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listChannelTypesDelegate(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); + } + +} diff --git a/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/ChannelInner.java b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/ChannelInner.java new file mode 100644 index 000000000000..fd998867a199 --- /dev/null +++ b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/ChannelInner.java @@ -0,0 +1,100 @@ +/** + * 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.engagementfabric.implementation; + +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.engagementfabric.ProxyOnlyResource; + +/** + * The EngagementFabric channel. + */ +@JsonFlatten +public class ChannelInner extends ProxyOnlyResource { + /** + * The channel type. + */ + @JsonProperty(value = "properties.channelType", required = true) + private String channelType; + + /** + * The functions to be enabled for the channel. + */ + @JsonProperty(value = "properties.channelFunctions") + private List channelFunctions; + + /** + * The channel credentials. + */ + @JsonProperty(value = "properties.credentials") + private Map credentials; + + /** + * Get the channel type. + * + * @return the channelType value + */ + public String channelType() { + return this.channelType; + } + + /** + * Set the channel type. + * + * @param channelType the channelType value to set + * @return the ChannelInner object itself. + */ + public ChannelInner withChannelType(String channelType) { + this.channelType = channelType; + return this; + } + + /** + * Get the functions to be enabled for the channel. + * + * @return the channelFunctions value + */ + public List channelFunctions() { + return this.channelFunctions; + } + + /** + * Set the functions to be enabled for the channel. + * + * @param channelFunctions the channelFunctions value to set + * @return the ChannelInner object itself. + */ + public ChannelInner withChannelFunctions(List channelFunctions) { + this.channelFunctions = channelFunctions; + return this; + } + + /** + * Get the channel credentials. + * + * @return the credentials value + */ + public Map credentials() { + return this.credentials; + } + + /** + * Set the channel credentials. + * + * @param credentials the credentials value to set + * @return the ChannelInner object itself. + */ + public ChannelInner withCredentials(Map credentials) { + this.credentials = credentials; + return this; + } + +} diff --git a/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/ChannelTypeDescriptionListInner.java b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/ChannelTypeDescriptionListInner.java new file mode 100644 index 000000000000..b6897ca151d4 --- /dev/null +++ b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/ChannelTypeDescriptionListInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.engagementfabric.implementation; + +import java.util.List; +import com.microsoft.azure.management.engagementfabric.ChannelTypeDescription; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * List of the EngagementFabric channel descriptions. + */ +public class ChannelTypeDescriptionListInner { + /** + * Channel descriptions. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get channel descriptions. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set channel descriptions. + * + * @param value the value value to set + * @return the ChannelTypeDescriptionListInner object itself. + */ + public ChannelTypeDescriptionListInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/ChannelsInner.java b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/ChannelsInner.java new file mode 100644 index 000000000000..74a87df50220 --- /dev/null +++ b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/ChannelsInner.java @@ -0,0 +1,455 @@ +/** + * 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.engagementfabric.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +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.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Channels. + */ +public class ChannelsInner { + /** The Retrofit service to perform REST calls. */ + private ChannelsService service; + /** The service client containing this operation class. */ + private EngagementFabricImpl client; + + /** + * Initializes an instance of ChannelsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ChannelsInner(Retrofit retrofit, EngagementFabricImpl client) { + this.service = retrofit.create(ChannelsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Channels to be + * used by Retrofit to perform actually REST calls. + */ + interface ChannelsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.engagementfabric.Channels get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EngagementFabric/Accounts/{accountName}/Channels/{channelName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("channelName") String channelName, @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.engagementfabric.Channels createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EngagementFabric/Accounts/{accountName}/Channels/{channelName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("channelName") String channelName, @Body ChannelInner channel, @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.engagementfabric.Channels delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EngagementFabric/Accounts/{accountName}/Channels/{channelName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("channelName") String channelName, @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.engagementfabric.Channels listByAccount" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EngagementFabric/Accounts/{accountName}/Channels") + Observable> listByAccount(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @param channelName Channel Name + * @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 ChannelInner object if successful. + */ + public ChannelInner get(String resourceGroupName, String accountName, String channelName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, channelName).toBlocking().single().body(); + } + + /** + * Get the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @param channelName Channel Name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String channelName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, channelName), serviceCallback); + } + + /** + * Get the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @param channelName Channel Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ChannelInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String channelName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, channelName).map(new Func1, ChannelInner>() { + @Override + public ChannelInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @param channelName Channel Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ChannelInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String channelName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (channelName == null) { + throw new IllegalArgumentException("Parameter channelName 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(this.client.subscriptionId(), resourceGroupName, accountName, channelName, 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); + } + + /** + * Create or Update the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @param channelName Channel Name + * @param channel The EngagementFabric channel description + * @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 ChannelInner object if successful. + */ + public ChannelInner createOrUpdate(String resourceGroupName, String accountName, String channelName, ChannelInner channel) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, channelName, channel).toBlocking().single().body(); + } + + /** + * Create or Update the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @param channelName Channel Name + * @param channel The EngagementFabric channel description + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, String channelName, ChannelInner channel, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, channelName, channel), serviceCallback); + } + + /** + * Create or Update the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @param channelName Channel Name + * @param channel The EngagementFabric channel description + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ChannelInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, String channelName, ChannelInner channel) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, channelName, channel).map(new Func1, ChannelInner>() { + @Override + public ChannelInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or Update the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @param channelName Channel Name + * @param channel The EngagementFabric channel description + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ChannelInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String channelName, ChannelInner channel) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (channelName == null) { + throw new IllegalArgumentException("Parameter channelName is required and cannot be null."); + } + if (channel == null) { + throw new IllegalArgumentException("Parameter channel 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(channel); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, channelName, channel, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @param channelName The EngagementFabric channel name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String channelName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, channelName).toBlocking().single().body(); + } + + /** + * Delete the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @param channelName The EngagementFabric channel name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String channelName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, channelName), serviceCallback); + } + + /** + * Delete the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @param channelName The EngagementFabric channel name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String channelName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, channelName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete the EngagementFabric channel. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @param channelName The EngagementFabric channel name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String channelName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (channelName == null) { + throw new IllegalArgumentException("Parameter channelName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, channelName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List the EngagementFabric channels. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @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 List<ChannelInner> object if successful. + */ + public List listByAccount(String resourceGroupName, String accountName) { + return listByAccountWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * List the EngagementFabric channels. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @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> listByAccountAsync(String resourceGroupName, String accountName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByAccountWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * List the EngagementFabric channels. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ChannelInner> object + */ + public Observable> listByAccountAsync(String resourceGroupName, String accountName) { + return listByAccountWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List the EngagementFabric channels. + * + * @param resourceGroupName Resource Group Name + * @param accountName Account Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ChannelInner> object + */ + public Observable>> listByAccountWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByAccount(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByAccountDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByAccountDelegate(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/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/CheckNameAvailabilityResultInner.java b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/CheckNameAvailabilityResultInner.java new file mode 100644 index 000000000000..330d2fdc16fe --- /dev/null +++ b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/CheckNameAvailabilityResultInner.java @@ -0,0 +1,64 @@ +/** + * 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.engagementfabric.implementation; + +import com.microsoft.azure.management.engagementfabric.CheckNameUnavailableReason; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result of name availability check. + */ +public class CheckNameAvailabilityResultInner { + /** + * The name to be checked. + */ + @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean nameAvailable; + + /** + * The reason if name is unavailable. Possible values include: 'Invalid', + * 'AlreadyExists'. + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private CheckNameUnavailableReason reason; + + /** + * The message if name is unavailable. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get the name to be checked. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Get the reason if name is unavailable. Possible values include: 'Invalid', 'AlreadyExists'. + * + * @return the reason value + */ + public CheckNameUnavailableReason reason() { + return this.reason; + } + + /** + * Get the message if name is unavailable. + * + * @return the message value + */ + public String message() { + return this.message; + } + +} diff --git a/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/EngagementFabricImpl.java b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/EngagementFabricImpl.java new file mode 100644 index 000000000000..54ab4d654e8f --- /dev/null +++ b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/EngagementFabricImpl.java @@ -0,0 +1,362 @@ +/** + * 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.engagementfabric.implementation; + +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.engagementfabric.CheckNameAvailabilityParameter; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * Initializes a new instance of the EngagementFabricImpl class. + */ +public class EngagementFabricImpl extends AzureServiceClient { + /** The Retrofit service to perform REST calls. */ + private EngagementFabricService service; + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Subscription ID. */ + private String subscriptionId; + + /** + * Gets Subscription ID. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Subscription ID. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public EngagementFabricImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** API version. */ + private String apiVersion; + + /** + * Gets API version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public EngagementFabricImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public EngagementFabricImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public EngagementFabricImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The AccountsInner object to access its operations. + */ + private AccountsInner accounts; + + /** + * Gets the AccountsInner object to access its operations. + * @return the AccountsInner object. + */ + public AccountsInner accounts() { + return this.accounts; + } + + /** + * The ChannelsInner object to access its operations. + */ + private ChannelsInner channels; + + /** + * Gets the ChannelsInner object to access its operations. + * @return the ChannelsInner object. + */ + public ChannelsInner channels() { + return this.channels; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The SKUsInner object to access its operations. + */ + private SKUsInner sKUs; + + /** + * Gets the SKUsInner object to access its operations. + * @return the SKUsInner object. + */ + public SKUsInner sKUs() { + return this.sKUs; + } + + /** + * Initializes an instance of EngagementFabric client. + * + * @param credentials the management credentials for Azure + */ + public EngagementFabricImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of EngagementFabric client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public EngagementFabricImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of EngagementFabric client. + * + * @param restClient the REST client to connect to Azure. + */ + public EngagementFabricImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2018-09-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.accounts = new AccountsInner(restClient().retrofit(), this); + this.channels = new ChannelsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.sKUs = new SKUsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + initializeService(); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "EngagementFabric", "2018-09-01-preview"); + } + + private void initializeService() { + service = restClient().retrofit().create(EngagementFabricService.class); + } + + /** + * The interface defining all the services for EngagementFabric to be + * used by Retrofit to perform actually REST calls. + */ + interface EngagementFabricService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.engagementfabric.EngagementFabric checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EngagementFabric/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Body CheckNameAvailabilityParameter parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Check availability of EngagementFabric resource. + * + * @param resourceGroupName Resource Group Name + * @param parameters Parameter describing the name to be checked + * @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 CheckNameAvailabilityResultInner object if successful. + */ + public CheckNameAvailabilityResultInner checkNameAvailability(String resourceGroupName, CheckNameAvailabilityParameter parameters) { + return checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, parameters).toBlocking().single().body(); + } + + /** + * Check availability of EngagementFabric resource. + * + * @param resourceGroupName Resource Group Name + * @param parameters Parameter describing the name to be checked + * @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 checkNameAvailabilityAsync(String resourceGroupName, CheckNameAvailabilityParameter parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, parameters), serviceCallback); + } + + /** + * Check availability of EngagementFabric resource. + * + * @param resourceGroupName Resource Group Name + * @param parameters Parameter describing the name to be checked + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityResultInner object + */ + public Observable checkNameAvailabilityAsync(String resourceGroupName, CheckNameAvailabilityParameter parameters) { + return checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, parameters).map(new Func1, CheckNameAvailabilityResultInner>() { + @Override + public CheckNameAvailabilityResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check availability of EngagementFabric resource. + * + * @param resourceGroupName Resource Group Name + * @param parameters Parameter describing the name to be checked + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityResultInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String resourceGroupName, CheckNameAvailabilityParameter parameters) { + if (this.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.checkNameAvailability(this.subscriptionId(), resourceGroupName, parameters, this.apiVersion(), this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/KeyDescriptionInner.java b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/KeyDescriptionInner.java new file mode 100644 index 000000000000..23ceba8b4324 --- /dev/null +++ b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/KeyDescriptionInner.java @@ -0,0 +1,64 @@ +/** + * 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.engagementfabric.implementation; + +import com.microsoft.azure.management.engagementfabric.KeyRank; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The description of the EngagementFabric account key. + */ +public class KeyDescriptionInner { + /** + * The name of the key. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The rank of the key. Possible values include: 'PrimaryKey', + * 'SecondaryKey'. + */ + @JsonProperty(value = "rank", access = JsonProperty.Access.WRITE_ONLY) + private KeyRank rank; + + /** + * The value of the key. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Get the name of the key. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the rank of the key. Possible values include: 'PrimaryKey', 'SecondaryKey'. + * + * @return the rank value + */ + public KeyRank rank() { + return this.rank; + } + + /** + * Get the value of the key. + * + * @return the value value + */ + public String value() { + return this.value; + } + +} diff --git a/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/OperationInner.java b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/OperationInner.java new file mode 100644 index 000000000000..ae1002c57a91 --- /dev/null +++ b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/OperationInner.java @@ -0,0 +1,48 @@ +/** + * 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.engagementfabric.implementation; + +import com.microsoft.azure.management.engagementfabric.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The EngagementFabric operation. + */ +public class OperationInner { + /** + * The name of the EngagementFabric operation. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The display content of the EngagementFabric operation. + */ + @JsonProperty(value = "display", access = JsonProperty.Access.WRITE_ONLY) + private OperationDisplay display; + + /** + * Get the name of the EngagementFabric operation. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the display content of the EngagementFabric operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + +} diff --git a/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/OperationsInner.java b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/OperationsInner.java new file mode 100644 index 000000000000..600149a0de8d --- /dev/null +++ b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/OperationsInner.java @@ -0,0 +1,134 @@ +/** + * 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.engagementfabric.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private EngagementFabricImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, EngagementFabricImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.engagementfabric.Operations list" }) + @GET("providers/Microsoft.EngagementFabric/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List operation of EngagementFabric resources. + * + * @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 List<OperationInner> object if successful. + */ + public List list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * List operation of EngagementFabric resources. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * List operation of EngagementFabric resources. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List operation of EngagementFabric resources. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/PageImpl.java b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/PageImpl.java new file mode 100644 index 000000000000..16b1d3cfb648 --- /dev/null +++ b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * 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.engagementfabric.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/SKUInner.java b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/SKUInner.java new file mode 100644 index 000000000000..14bea35c582e --- /dev/null +++ b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/SKUInner.java @@ -0,0 +1,69 @@ +/** + * 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.engagementfabric.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The EngagementFabric SKU. + */ +public class SKUInner { + /** + * The name of the SKU. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The price tier of the SKU. + */ + @JsonProperty(value = "tier") + private String tier; + + /** + * Get the name of the SKU. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the SKU. + * + * @param name the name value to set + * @return the SKUInner object itself. + */ + public SKUInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the price tier of the SKU. + * + * @return the tier value + */ + public String tier() { + return this.tier; + } + + /** + * Set the price tier of the SKU. + * + * @param tier the tier value to set + * @return the SKUInner object itself. + */ + public SKUInner withTier(String tier) { + this.tier = tier; + return this; + } + +} diff --git a/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/SKUsInner.java b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/SKUsInner.java new file mode 100644 index 000000000000..5fc905d36069 --- /dev/null +++ b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/SKUsInner.java @@ -0,0 +1,144 @@ +/** + * 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.engagementfabric.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +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.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in SKUs. + */ +public class SKUsInner { + /** The Retrofit service to perform REST calls. */ + private SKUsService service; + /** The service client containing this operation class. */ + private EngagementFabricImpl client; + + /** + * Initializes an instance of SKUsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SKUsInner(Retrofit retrofit, EngagementFabricImpl client) { + this.service = retrofit.create(SKUsService.class); + this.client = client; + } + + /** + * The interface defining all the services for SKUs to be + * used by Retrofit to perform actually REST calls. + */ + interface SKUsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.engagementfabric.SKUs list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.EngagementFabric/skus") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List available SKUs of EngagementFabric resource. + * + * @return the PagedList object if successful. + */ + public PagedList list() { + PageImpl page = new PageImpl<>(); + page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * List available SKUs of EngagementFabric resource. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * List available SKUs of EngagementFabric resource. + * + * @return the observable to the List<SkuDescriptionInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * List available SKUs of EngagementFabric resource. + * + * @return the observable to the List<SkuDescriptionInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(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 = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/SkuDescriptionInner.java b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/SkuDescriptionInner.java new file mode 100644 index 000000000000..b2af825aabb7 --- /dev/null +++ b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/SkuDescriptionInner.java @@ -0,0 +1,109 @@ +/** + * 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.engagementfabric.implementation; + +import java.util.List; +import com.microsoft.azure.management.engagementfabric.SkuLocationInfoItem; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The EngagementFabric SKU description of given resource type. + */ +public class SkuDescriptionInner { + /** + * The fully qualified resource type. + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /** + * The name of the SKU. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The price tier of the SKU. + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private String tier; + + /** + * The set of locations that the SKU is available. + */ + @JsonProperty(value = "locations", access = JsonProperty.Access.WRITE_ONLY) + private List locations; + + /** + * Locations and zones. + */ + @JsonProperty(value = "locationInfo", access = JsonProperty.Access.WRITE_ONLY) + private List locationInfo; + + /** + * The restrictions because of which SKU cannot be used. + */ + @JsonProperty(value = "restrictions", access = JsonProperty.Access.WRITE_ONLY) + private List restrictions; + + /** + * Get the fully qualified resource type. + * + * @return the resourceType value + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the name of the SKU. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the price tier of the SKU. + * + * @return the tier value + */ + public String tier() { + return this.tier; + } + + /** + * Get the set of locations that the SKU is available. + * + * @return the locations value + */ + public List locations() { + return this.locations; + } + + /** + * Get locations and zones. + * + * @return the locationInfo value + */ + public List locationInfo() { + return this.locationInfo; + } + + /** + * Get the restrictions because of which SKU cannot be used. + * + * @return the restrictions value + */ + public List restrictions() { + return this.restrictions; + } + +} diff --git a/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/package-info.java b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/package-info.java new file mode 100644 index 000000000000..e76122ef39df --- /dev/null +++ b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/implementation/package-info.java @@ -0,0 +1,11 @@ +// 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. + +/** + * This package contains the implementation classes for EngagementFabric. + * Microsoft Customer Engagement Fabric. + */ +package com.microsoft.azure.management.engagementfabric.implementation; diff --git a/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/package-info.java b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/package-info.java new file mode 100644 index 000000000000..c0502c823887 --- /dev/null +++ b/azure-mgmt-engagementfabric/src/main/java/com/microsoft/azure/management/engagementfabric/package-info.java @@ -0,0 +1,11 @@ +// 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. + +/** + * This package contains the classes for EngagementFabric. + * Microsoft Customer Engagement Fabric. + */ +package com.microsoft.azure.management.engagementfabric;