From 578cbfeb15e4947ba5c7765e13d47072550334e2 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 18 Nov 2020 06:51:06 +0000 Subject: [PATCH] CodeGen from PR 11722 in Azure/azure-rest-api-specs Merge 73b40382564909c1714c5ce2aec82d01fc026669 into 76458dd5d43148a171be45c4c404a87292a0bcda --- sdk/datalakestore/mgmt-v2016_11_01/pom.xml | 8 +- .../v2016_11_01/DataLakeStoreAccount.java | 12 +-- .../datalakestore/v2016_11_01/Locations.java | 9 ++ .../datalakestore/v2016_11_01/Usage.java | 45 +++++++++ .../datalakestore/v2016_11_01/UsageName.java | 47 +++++++++ .../datalakestore/v2016_11_01/UsageUnit.java | 65 +++++++++++++ .../DataLakeStoreAccountImpl.java | 12 +-- .../implementation/FirewallRuleImpl.java | 2 +- .../implementation/FirewallRulesImpl.java | 10 +- .../implementation/LocationsImpl.java | 28 +++++- .../implementation/LocationsInner.java | 89 +++++++++++++++++ .../v2016_11_01/implementation/PageImpl1.java | 75 +++++++++++++++ .../implementation/TrustedIdProviderImpl.java | 2 +- .../TrustedIdProvidersImpl.java | 10 +- .../v2016_11_01/implementation/UsageImpl.java | 57 +++++++++++ .../implementation/UsageInner.java | 96 +++++++++++++++++++ .../VirtualNetworkRuleImpl.java | 2 +- .../VirtualNetworkRulesImpl.java | 10 +- 18 files changed, 550 insertions(+), 29 deletions(-) create mode 100644 sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/Usage.java create mode 100644 sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UsageName.java create mode 100644 sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UsageUnit.java create mode 100644 sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/PageImpl1.java create mode 100644 sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/UsageImpl.java create mode 100644 sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/UsageInner.java diff --git a/sdk/datalakestore/mgmt-v2016_11_01/pom.xml b/sdk/datalakestore/mgmt-v2016_11_01/pom.xml index 6ba022a8939ea..dd94093be9262 100644 --- a/sdk/datalakestore/mgmt-v2016_11_01/pom.xml +++ b/sdk/datalakestore/mgmt-v2016_11_01/pom.xml @@ -11,11 +11,11 @@ com.microsoft.azure azure-arm-parent - 1.2.0 - ../../parents/azure-arm-parent + 1.1.0 + ../../../pom.management.xml azure-mgmt-datalakestore - 1.0.0-beta-2 + 1.0.0-beta jar Microsoft Azure SDK for DataLakeStore Management This package contains Microsoft DataLakeStore Management SDK. @@ -71,6 +71,8 @@ azure-arm-client-runtime test-jar test + + 1.6.5 diff --git a/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/DataLakeStoreAccount.java b/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/DataLakeStoreAccount.java index 77f24d3c05e8e..ec3275dd43308 100644 --- a/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/DataLakeStoreAccount.java +++ b/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/DataLakeStoreAccount.java @@ -201,7 +201,7 @@ interface WithFirewallRules { * @param firewallRules The list of firewall rules associated with this Data Lake Store account * @return the next definition stage */ - WithCreate withFirewallRulesForCreate(List firewallRules); + WithCreate withFirewallRules(List firewallRules); } /** @@ -249,7 +249,7 @@ interface WithTrustedIdProviders { * @param trustedIdProviders The list of trusted identity providers associated with this Data Lake Store account * @return the next definition stage */ - WithCreate withTrustedIdProvidersForCreate(List trustedIdProviders); + WithCreate withTrustedIdProviders(List trustedIdProviders); } /** @@ -273,7 +273,7 @@ interface WithVirtualNetworkRules { * @param virtualNetworkRules The list of virtual network rules associated with this Data Lake Store account * @return the next definition stage */ - WithCreate withVirtualNetworkRulesForCreate(List virtualNetworkRules); + WithCreate withVirtualNetworkRules(List virtualNetworkRules); } /** @@ -339,7 +339,7 @@ interface WithFirewallRules { * @param firewallRules The list of firewall rules associated with this Data Lake Store account * @return the next update stage */ - Update withFirewallRulesForUpdate(List firewallRules); + Update withFirewallRules(List firewallRules); } /** @@ -375,7 +375,7 @@ interface WithTrustedIdProviders { * @param trustedIdProviders The list of trusted identity providers associated with this Data Lake Store account * @return the next update stage */ - Update withTrustedIdProvidersForUpdate(List trustedIdProviders); + Update withTrustedIdProviders(List trustedIdProviders); } /** @@ -399,7 +399,7 @@ interface WithVirtualNetworkRules { * @param virtualNetworkRules The list of virtual network rules associated with this Data Lake Store account * @return the next update stage */ - Update withVirtualNetworkRulesForUpdate(List virtualNetworkRules); + Update withVirtualNetworkRules(List virtualNetworkRules); } } diff --git a/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/Locations.java b/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/Locations.java index ca6174e16063c..f68ef2b3872b7 100644 --- a/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/Locations.java +++ b/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/Locations.java @@ -16,6 +16,15 @@ * Type representing Locations. */ public interface Locations extends HasInner { + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The resource location without whitespace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getUsageAsync(String location); + /** * Gets subscription-level properties and limits for Data Lake Store specified by resource location. * diff --git a/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/Usage.java b/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/Usage.java new file mode 100644 index 0000000000000..43b0d60e731ce --- /dev/null +++ b/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/Usage.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.datalakestore.v2016_11_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.datalakestore.v2016_11_01.implementation.UsageInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datalakestore.v2016_11_01.implementation.DataLakeStoreManager; + +/** + * Type representing Usage. + */ +public interface Usage extends HasInner, HasManager { + /** + * @return the currentValue value. + */ + Integer currentValue(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the limit value. + */ + Integer limit(); + + /** + * @return the name value. + */ + UsageName name(); + + /** + * @return the unit value. + */ + UsageUnit unit(); + +} diff --git a/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UsageName.java b/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UsageName.java new file mode 100644 index 0000000000000..faa4d6f9748c3 --- /dev/null +++ b/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UsageName.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datalakestore.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The usage names that can be used. + */ +public class UsageName { + /** + * Gets a string describing the resource name. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Gets a localized string describing the resource name. + */ + @JsonProperty(value = "localizedValue", access = JsonProperty.Access.WRITE_ONLY) + private String localizedValue; + + /** + * Get gets a string describing the resource name. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Get gets a localized string describing the resource name. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + +} diff --git a/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UsageUnit.java b/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UsageUnit.java new file mode 100644 index 0000000000000..db7423240201a --- /dev/null +++ b/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/UsageUnit.java @@ -0,0 +1,65 @@ +/** + * 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.datalakestore.v2016_11_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for UsageUnit. + */ +public enum UsageUnit { + /** Enum value Count. */ + COUNT("Count"), + + /** Enum value Bytes. */ + BYTES("Bytes"), + + /** Enum value Seconds. */ + SECONDS("Seconds"), + + /** Enum value Percent. */ + PERCENT("Percent"), + + /** Enum value CountsPerSecond. */ + COUNTS_PER_SECOND("CountsPerSecond"), + + /** Enum value BytesPerSecond. */ + BYTES_PER_SECOND("BytesPerSecond"); + + /** The actual serialized value for a UsageUnit instance. */ + private String value; + + UsageUnit(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a UsageUnit instance. + * + * @param value the serialized value to parse. + * @return the parsed UsageUnit object, or null if unable to parse. + */ + @JsonCreator + public static UsageUnit fromString(String value) { + UsageUnit[] items = UsageUnit.values(); + for (UsageUnit item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/DataLakeStoreAccountImpl.java b/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/DataLakeStoreAccountImpl.java index b8693598d607b..a033bc74cbbc2 100644 --- a/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/DataLakeStoreAccountImpl.java +++ b/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/DataLakeStoreAccountImpl.java @@ -220,7 +220,7 @@ public DataLakeStoreAccountImpl withEncryptionState(EncryptionState encryptionSt } @Override - public DataLakeStoreAccountImpl withFirewallRulesForCreate(List firewallRules) { + public DataLakeStoreAccountImpl withFirewallRules(List firewallRules) { this.createParameter.withFirewallRules(firewallRules); return this; } @@ -232,13 +232,13 @@ public DataLakeStoreAccountImpl withIdentity(EncryptionIdentity identity) { } @Override - public DataLakeStoreAccountImpl withTrustedIdProvidersForCreate(List trustedIdProviders) { + public DataLakeStoreAccountImpl withTrustedIdProviders(List trustedIdProviders) { this.createParameter.withTrustedIdProviders(trustedIdProviders); return this; } @Override - public DataLakeStoreAccountImpl withVirtualNetworkRulesForCreate(List virtualNetworkRules) { + public DataLakeStoreAccountImpl withVirtualNetworkRules(List virtualNetworkRules) { this.createParameter.withVirtualNetworkRules(virtualNetworkRules); return this; } @@ -250,19 +250,19 @@ public DataLakeStoreAccountImpl withEncryptionConfig(UpdateEncryptionConfig encr } @Override - public DataLakeStoreAccountImpl withFirewallRulesForUpdate(List firewallRules) { + public DataLakeStoreAccountImpl withFirewallRules(List firewallRules) { this.updateParameter.withFirewallRules(firewallRules); return this; } @Override - public DataLakeStoreAccountImpl withTrustedIdProvidersForUpdate(List trustedIdProviders) { + public DataLakeStoreAccountImpl withTrustedIdProviders(List trustedIdProviders) { this.updateParameter.withTrustedIdProviders(trustedIdProviders); return this; } @Override - public DataLakeStoreAccountImpl withVirtualNetworkRulesForUpdate(List virtualNetworkRules) { + public DataLakeStoreAccountImpl withVirtualNetworkRules(List virtualNetworkRules) { this.updateParameter.withVirtualNetworkRules(virtualNetworkRules); return this; } diff --git a/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/FirewallRuleImpl.java b/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/FirewallRuleImpl.java index 991d4dade49d5..59c57f389c12d 100644 --- a/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/FirewallRuleImpl.java +++ b/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/FirewallRuleImpl.java @@ -38,7 +38,7 @@ class FirewallRuleImpl extends CreatableUpdatableImpl getAsync(String resourceGroupName, String accountName, String firewallRuleName) { FirewallRulesInner client = this.inner(); return client.getAsync(resourceGroupName, accountName, firewallRuleName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public FirewallRule call(FirewallRuleInner inner) { - return wrapModel(inner); + public Observable call(FirewallRuleInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((FirewallRule)wrapModel(inner)); + } } }); } diff --git a/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/LocationsImpl.java b/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/LocationsImpl.java index 7aef8cec80817..2431131c5ff8a 100644 --- a/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/LocationsImpl.java +++ b/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/LocationsImpl.java @@ -4,15 +4,17 @@ * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * abc + * */ package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation; import com.microsoft.azure.arm.model.implementation.WrapperImpl; import com.microsoft.azure.management.datalakestore.v2016_11_01.Locations; -import rx.functions.Func1; import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.datalakestore.v2016_11_01.Usage; import com.microsoft.azure.management.datalakestore.v2016_11_01.CapabilityInformation; class LocationsImpl extends WrapperImpl implements Locations { @@ -27,6 +29,28 @@ public DataLakeStoreManager manager() { return this.manager; } + private UsageImpl wrapModel(UsageInner inner) { + return new UsageImpl(inner, manager()); + } + + @Override + public Observable getUsageAsync(String location) { + LocationsInner client = this.inner(); + return client.getUsageAsync(location) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Usage call(UsageInner inner) { + return wrapModel(inner); + } + }); + } + @Override public Observable getCapabilityAsync(String location) { LocationsInner client = this.inner(); diff --git a/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/LocationsInner.java b/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/LocationsInner.java index 48af59f32df3f..5122531436fc7 100644 --- a/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/LocationsInner.java +++ b/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/LocationsInner.java @@ -15,6 +15,7 @@ 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; @@ -55,6 +56,10 @@ interface LocationsService { @GET("subscriptions/{subscriptionId}/providers/Microsoft.DataLakeStore/locations/{location}/capability") Observable> getCapability(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @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.datalakestore.v2016_11_01.Locations getUsage" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DataLakeStore/locations/{location}/usages") + Observable> getUsage(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + } /** @@ -137,4 +142,88 @@ private ServiceResponse getCapabilityDelegate(Respon .build(response); } + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The resource location without whitespace. + * @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<UsageInner> object if successful. + */ + public List getUsage(String location) { + return getUsageWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The resource location without whitespace. + * @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> getUsageAsync(String location, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getUsageWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The resource location without whitespace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UsageInner> object + */ + public Observable> getUsageAsync(String location) { + return getUsageWithServiceResponseAsync(location).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The resource location without whitespace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UsageInner> object + */ + public Observable>> getUsageWithServiceResponseAsync(String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location 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.getUsage(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getUsageDelegate(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> getUsageDelegate(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/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/PageImpl1.java b/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/PageImpl1.java new file mode 100644 index 0000000000000..e4c0b3718f10d --- /dev/null +++ b/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/PageImpl1.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.datalakestore.v2016_11_01.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 PageImpl1 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 PageImpl1 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 PageImpl1 setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/TrustedIdProviderImpl.java b/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/TrustedIdProviderImpl.java index 5564c3efe5d1f..fdde70654be4b 100644 --- a/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/TrustedIdProviderImpl.java +++ b/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/TrustedIdProviderImpl.java @@ -38,7 +38,7 @@ class TrustedIdProviderImpl extends CreatableUpdatableImpl getAsync(String resourceGroupName, String accountName, String trustedIdProviderName) { TrustedIdProvidersInner client = this.inner(); return client.getAsync(resourceGroupName, accountName, trustedIdProviderName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public TrustedIdProvider call(TrustedIdProviderInner inner) { - return wrapModel(inner); + public Observable call(TrustedIdProviderInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((TrustedIdProvider)wrapModel(inner)); + } } }); } diff --git a/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/UsageImpl.java b/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/UsageImpl.java new file mode 100644 index 0000000000000..74ff0e31ad1c0 --- /dev/null +++ b/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/UsageImpl.java @@ -0,0 +1,57 @@ +/** + * 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.datalakestore.v2016_11_01.implementation; + +import com.microsoft.azure.management.datalakestore.v2016_11_01.Usage; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.datalakestore.v2016_11_01.UsageName; +import com.microsoft.azure.management.datalakestore.v2016_11_01.UsageUnit; + +class UsageImpl extends WrapperImpl implements Usage { + private final DataLakeStoreManager manager; + + UsageImpl(UsageInner inner, DataLakeStoreManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataLakeStoreManager manager() { + return this.manager; + } + + + + @Override + public Integer currentValue() { + return this.inner().currentValue(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Integer limit() { + return this.inner().limit(); + } + + @Override + public UsageName name() { + return this.inner().name(); + } + + @Override + public UsageUnit unit() { + return this.inner().unit(); + } + +} diff --git a/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/UsageInner.java b/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/UsageInner.java new file mode 100644 index 0000000000000..107b558b69d5f --- /dev/null +++ b/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/UsageInner.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.datalakestore.v2016_11_01.implementation; + +import com.microsoft.azure.management.datalakestore.v2016_11_01.UsageUnit; +import com.microsoft.azure.management.datalakestore.v2016_11_01.UsageName; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the Resource Usage. + */ +public class UsageInner { + /** + * Gets the unit of measurement. Possible values include: 'Count', 'Bytes', + * 'Seconds', 'Percent', 'CountsPerSecond', 'BytesPerSecond'. + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private UsageUnit unit; + + /** + * Resource identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Gets the current count of the allocated resources in the subscription. + */ + @JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY) + private Integer currentValue; + + /** + * Gets the maximum count of the resources that can be allocated in the + * subscription. + */ + @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) + private Integer limit; + + /** + * Gets the name of the type of usage. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private UsageName name; + + /** + * Get gets the unit of measurement. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', 'BytesPerSecond'. + * + * @return the unit value + */ + public UsageUnit unit() { + return this.unit; + } + + /** + * Get resource identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get gets the current count of the allocated resources in the subscription. + * + * @return the currentValue value + */ + public Integer currentValue() { + return this.currentValue; + } + + /** + * Get gets the maximum count of the resources that can be allocated in the subscription. + * + * @return the limit value + */ + public Integer limit() { + return this.limit; + } + + /** + * Get gets the name of the type of usage. + * + * @return the name value + */ + public UsageName name() { + return this.name; + } + +} diff --git a/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/VirtualNetworkRuleImpl.java b/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/VirtualNetworkRuleImpl.java index ad74fb01bae58..d182221428401 100644 --- a/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/VirtualNetworkRuleImpl.java +++ b/sdk/datalakestore/mgmt-v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/VirtualNetworkRuleImpl.java @@ -38,7 +38,7 @@ class VirtualNetworkRuleImpl extends CreatableUpdatableImpl getAsync(String resourceGroupName, String accountName, String virtualNetworkRuleName) { VirtualNetworkRulesInner client = this.inner(); return client.getAsync(resourceGroupName, accountName, virtualNetworkRuleName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public VirtualNetworkRule call(VirtualNetworkRuleInner inner) { - return wrapModel(inner); + public Observable call(VirtualNetworkRuleInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((VirtualNetworkRule)wrapModel(inner)); + } } }); }