diff --git a/api-specs.json b/api-specs.json index ac05a230d3ec..e8fee0af8735 100644 --- a/api-specs.json +++ b/api-specs.json @@ -215,6 +215,10 @@ "source": "specification/resourcegraph/resource-manager/readme.md", "args": "--multiapi --fluent" }, + "resourcehealth/resource-manager": { + "source": "specification/resourcehealth/resource-manager/readme.md", + "args": "--multiapi --fluent" + }, "resources/resource-manager": { "source": "specification/resources/resource-manager/readme.md", "args": "--multiapi --fluent" diff --git a/resourcehealth/resource-manager/v2015_01_01/pom.xml b/resourcehealth/resource-manager/v2015_01_01/pom.xml new file mode 100644 index 000000000000..b35fcde154c6 --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.resourcehealth.v2015_01_01 + + com.microsoft.azure + azure-arm-parent + 1.1.0 + ../../../pom.management.xml + + azure-mgmt-resourcehealth + 1.0.0-beta + jar + Microsoft Azure SDK for ResourceHealth Management + This package contains Microsoft ResourceHealth Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/AvailabilityStateValues.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/AvailabilityStateValues.java new file mode 100644 index 000000000000..b797a8b6fe02 --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/AvailabilityStateValues.java @@ -0,0 +1,56 @@ +/** + * 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.resourcehealth.v2015_01_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AvailabilityStateValues. + */ +public enum AvailabilityStateValues { + /** Enum value Available. */ + AVAILABLE("Available"), + + /** Enum value Unavailable. */ + UNAVAILABLE("Unavailable"), + + /** Enum value Unknown. */ + UNKNOWN("Unknown"); + + /** The actual serialized value for a AvailabilityStateValues instance. */ + private String value; + + AvailabilityStateValues(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AvailabilityStateValues instance. + * + * @param value the serialized value to parse. + * @return the parsed AvailabilityStateValues object, or null if unable to parse. + */ + @JsonCreator + public static AvailabilityStateValues fromString(String value) { + AvailabilityStateValues[] items = AvailabilityStateValues.values(); + for (AvailabilityStateValues item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/AvailabilityStatus.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/AvailabilityStatus.java new file mode 100644 index 000000000000..b64fd1e49f49 --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/AvailabilityStatus.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.resourcehealth.v2015_01_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.resourcehealth.v2015_01_01.implementation.AvailabilityStatusInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.resourcehealth.v2015_01_01.implementation.ResourceHealthManager; + +/** + * Type representing AvailabilityStatus. + */ +public interface AvailabilityStatus extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + AvailabilityStatusProperties properties(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/AvailabilityStatusProperties.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/AvailabilityStatusProperties.java new file mode 100644 index 000000000000..229220b92395 --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/AvailabilityStatusProperties.java @@ -0,0 +1,367 @@ +/** + * 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.resourcehealth.v2015_01_01; + +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of availability state. + */ +public class AvailabilityStatusProperties { + /** + * Availability status of the resource. Possible values include: + * 'Available', 'Unavailable', 'Unknown'. + */ + @JsonProperty(value = "availabilityState") + private AvailabilityStateValues availabilityState; + + /** + * Summary description of the availability state. + */ + @JsonProperty(value = "summary") + private String summary; + + /** + * Details of the availability status. + */ + @JsonProperty(value = "detailedStatus") + private String detailedStatus; + + /** + * When the resource's availabilityState is Unavailable, it describes where + * the health impacting event was originated. Examples are planned, + * unplanned, user initiated or an outage etc. + */ + @JsonProperty(value = "reasonType") + private String reasonType; + + /** + * When the resource's availabilityState is Unavailable, it provides the + * Timestamp for when the health impacting event was received. + */ + @JsonProperty(value = "rootCauseAttributionTime") + private DateTime rootCauseAttributionTime; + + /** + * When the resource's availabilityState is Unavailable and the reasonType + * is not User Initiated, it provides the date and time for when the issue + * is expected to be resolved. + */ + @JsonProperty(value = "resolutionETA") + private DateTime resolutionETA; + + /** + * Timestamp for when last change in health status occurred. + */ + @JsonProperty(value = "occuredTime") + private DateTime occuredTime; + + /** + * Chronicity of the availability transition. Possible values include: + * 'Transient', 'Persistent'. + */ + @JsonProperty(value = "reasonChronicity") + private ReasonChronicityTypes reasonChronicity; + + /** + * Timestamp for when the health was last checked. + */ + @JsonProperty(value = "reportedTime") + private DateTime reportedTime; + + /** + * flag to show if child resource need detail health. + */ + @JsonProperty(value = "isArmResource") + private Boolean isArmResource; + + /** + * An annotation describing a change in the availabilityState to Available + * from Unavailable with a reasonType of type Unplanned. + */ + @JsonProperty(value = "recentlyResolvedState") + private AvailabilityStatusPropertiesRecentlyResolvedState recentlyResolvedState; + + /** + * Lists actions the user can take based on the current availabilityState + * of the resource. + */ + @JsonProperty(value = "recommendedActions") + private List recommendedActions; + + /** + * Lists the service impacting events that may be affecting the health of + * the resource. + */ + @JsonProperty(value = "serviceImpactingEvents") + private List serviceImpactingEvents; + + /** + * Get availability status of the resource. Possible values include: 'Available', 'Unavailable', 'Unknown'. + * + * @return the availabilityState value + */ + public AvailabilityStateValues availabilityState() { + return this.availabilityState; + } + + /** + * Set availability status of the resource. Possible values include: 'Available', 'Unavailable', 'Unknown'. + * + * @param availabilityState the availabilityState value to set + * @return the AvailabilityStatusProperties object itself. + */ + public AvailabilityStatusProperties withAvailabilityState(AvailabilityStateValues availabilityState) { + this.availabilityState = availabilityState; + return this; + } + + /** + * Get summary description of the availability state. + * + * @return the summary value + */ + public String summary() { + return this.summary; + } + + /** + * Set summary description of the availability state. + * + * @param summary the summary value to set + * @return the AvailabilityStatusProperties object itself. + */ + public AvailabilityStatusProperties withSummary(String summary) { + this.summary = summary; + return this; + } + + /** + * Get details of the availability status. + * + * @return the detailedStatus value + */ + public String detailedStatus() { + return this.detailedStatus; + } + + /** + * Set details of the availability status. + * + * @param detailedStatus the detailedStatus value to set + * @return the AvailabilityStatusProperties object itself. + */ + public AvailabilityStatusProperties withDetailedStatus(String detailedStatus) { + this.detailedStatus = detailedStatus; + return this; + } + + /** + * Get when the resource's availabilityState is Unavailable, it describes where the health impacting event was originated. Examples are planned, unplanned, user initiated or an outage etc. + * + * @return the reasonType value + */ + public String reasonType() { + return this.reasonType; + } + + /** + * Set when the resource's availabilityState is Unavailable, it describes where the health impacting event was originated. Examples are planned, unplanned, user initiated or an outage etc. + * + * @param reasonType the reasonType value to set + * @return the AvailabilityStatusProperties object itself. + */ + public AvailabilityStatusProperties withReasonType(String reasonType) { + this.reasonType = reasonType; + return this; + } + + /** + * Get when the resource's availabilityState is Unavailable, it provides the Timestamp for when the health impacting event was received. + * + * @return the rootCauseAttributionTime value + */ + public DateTime rootCauseAttributionTime() { + return this.rootCauseAttributionTime; + } + + /** + * Set when the resource's availabilityState is Unavailable, it provides the Timestamp for when the health impacting event was received. + * + * @param rootCauseAttributionTime the rootCauseAttributionTime value to set + * @return the AvailabilityStatusProperties object itself. + */ + public AvailabilityStatusProperties withRootCauseAttributionTime(DateTime rootCauseAttributionTime) { + this.rootCauseAttributionTime = rootCauseAttributionTime; + return this; + } + + /** + * Get when the resource's availabilityState is Unavailable and the reasonType is not User Initiated, it provides the date and time for when the issue is expected to be resolved. + * + * @return the resolutionETA value + */ + public DateTime resolutionETA() { + return this.resolutionETA; + } + + /** + * Set when the resource's availabilityState is Unavailable and the reasonType is not User Initiated, it provides the date and time for when the issue is expected to be resolved. + * + * @param resolutionETA the resolutionETA value to set + * @return the AvailabilityStatusProperties object itself. + */ + public AvailabilityStatusProperties withResolutionETA(DateTime resolutionETA) { + this.resolutionETA = resolutionETA; + return this; + } + + /** + * Get timestamp for when last change in health status occurred. + * + * @return the occuredTime value + */ + public DateTime occuredTime() { + return this.occuredTime; + } + + /** + * Set timestamp for when last change in health status occurred. + * + * @param occuredTime the occuredTime value to set + * @return the AvailabilityStatusProperties object itself. + */ + public AvailabilityStatusProperties withOccuredTime(DateTime occuredTime) { + this.occuredTime = occuredTime; + return this; + } + + /** + * Get chronicity of the availability transition. Possible values include: 'Transient', 'Persistent'. + * + * @return the reasonChronicity value + */ + public ReasonChronicityTypes reasonChronicity() { + return this.reasonChronicity; + } + + /** + * Set chronicity of the availability transition. Possible values include: 'Transient', 'Persistent'. + * + * @param reasonChronicity the reasonChronicity value to set + * @return the AvailabilityStatusProperties object itself. + */ + public AvailabilityStatusProperties withReasonChronicity(ReasonChronicityTypes reasonChronicity) { + this.reasonChronicity = reasonChronicity; + return this; + } + + /** + * Get timestamp for when the health was last checked. + * + * @return the reportedTime value + */ + public DateTime reportedTime() { + return this.reportedTime; + } + + /** + * Set timestamp for when the health was last checked. + * + * @param reportedTime the reportedTime value to set + * @return the AvailabilityStatusProperties object itself. + */ + public AvailabilityStatusProperties withReportedTime(DateTime reportedTime) { + this.reportedTime = reportedTime; + return this; + } + + /** + * Get flag to show if child resource need detail health. + * + * @return the isArmResource value + */ + public Boolean isArmResource() { + return this.isArmResource; + } + + /** + * Set flag to show if child resource need detail health. + * + * @param isArmResource the isArmResource value to set + * @return the AvailabilityStatusProperties object itself. + */ + public AvailabilityStatusProperties withIsArmResource(Boolean isArmResource) { + this.isArmResource = isArmResource; + return this; + } + + /** + * Get an annotation describing a change in the availabilityState to Available from Unavailable with a reasonType of type Unplanned. + * + * @return the recentlyResolvedState value + */ + public AvailabilityStatusPropertiesRecentlyResolvedState recentlyResolvedState() { + return this.recentlyResolvedState; + } + + /** + * Set an annotation describing a change in the availabilityState to Available from Unavailable with a reasonType of type Unplanned. + * + * @param recentlyResolvedState the recentlyResolvedState value to set + * @return the AvailabilityStatusProperties object itself. + */ + public AvailabilityStatusProperties withRecentlyResolvedState(AvailabilityStatusPropertiesRecentlyResolvedState recentlyResolvedState) { + this.recentlyResolvedState = recentlyResolvedState; + return this; + } + + /** + * Get lists actions the user can take based on the current availabilityState of the resource. + * + * @return the recommendedActions value + */ + public List recommendedActions() { + return this.recommendedActions; + } + + /** + * Set lists actions the user can take based on the current availabilityState of the resource. + * + * @param recommendedActions the recommendedActions value to set + * @return the AvailabilityStatusProperties object itself. + */ + public AvailabilityStatusProperties withRecommendedActions(List recommendedActions) { + this.recommendedActions = recommendedActions; + return this; + } + + /** + * Get lists the service impacting events that may be affecting the health of the resource. + * + * @return the serviceImpactingEvents value + */ + public List serviceImpactingEvents() { + return this.serviceImpactingEvents; + } + + /** + * Set lists the service impacting events that may be affecting the health of the resource. + * + * @param serviceImpactingEvents the serviceImpactingEvents value to set + * @return the AvailabilityStatusProperties object itself. + */ + public AvailabilityStatusProperties withServiceImpactingEvents(List serviceImpactingEvents) { + this.serviceImpactingEvents = serviceImpactingEvents; + return this; + } + +} diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/AvailabilityStatusPropertiesRecentlyResolvedState.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/AvailabilityStatusPropertiesRecentlyResolvedState.java new file mode 100644 index 000000000000..7b3a4227c3ea --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/AvailabilityStatusPropertiesRecentlyResolvedState.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.resourcehealth.v2015_01_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An annotation describing a change in the availabilityState to Available from + * Unavailable with a reasonType of type Unplanned. + */ +public class AvailabilityStatusPropertiesRecentlyResolvedState { + /** + * Timestamp for when the availabilityState changed to Unavailable. + */ + @JsonProperty(value = "unavailableOccurredTime") + private DateTime unavailableOccurredTime; + + /** + * Timestamp when the availabilityState changes to Available. + */ + @JsonProperty(value = "resolvedTime") + private DateTime resolvedTime; + + /** + * Brief description of cause of the resource becoming unavailable. + */ + @JsonProperty(value = "unavailabilitySummary") + private String unavailabilitySummary; + + /** + * Get timestamp for when the availabilityState changed to Unavailable. + * + * @return the unavailableOccurredTime value + */ + public DateTime unavailableOccurredTime() { + return this.unavailableOccurredTime; + } + + /** + * Set timestamp for when the availabilityState changed to Unavailable. + * + * @param unavailableOccurredTime the unavailableOccurredTime value to set + * @return the AvailabilityStatusPropertiesRecentlyResolvedState object itself. + */ + public AvailabilityStatusPropertiesRecentlyResolvedState withUnavailableOccurredTime(DateTime unavailableOccurredTime) { + this.unavailableOccurredTime = unavailableOccurredTime; + return this; + } + + /** + * Get timestamp when the availabilityState changes to Available. + * + * @return the resolvedTime value + */ + public DateTime resolvedTime() { + return this.resolvedTime; + } + + /** + * Set timestamp when the availabilityState changes to Available. + * + * @param resolvedTime the resolvedTime value to set + * @return the AvailabilityStatusPropertiesRecentlyResolvedState object itself. + */ + public AvailabilityStatusPropertiesRecentlyResolvedState withResolvedTime(DateTime resolvedTime) { + this.resolvedTime = resolvedTime; + return this; + } + + /** + * Get brief description of cause of the resource becoming unavailable. + * + * @return the unavailabilitySummary value + */ + public String unavailabilitySummary() { + return this.unavailabilitySummary; + } + + /** + * Set brief description of cause of the resource becoming unavailable. + * + * @param unavailabilitySummary the unavailabilitySummary value to set + * @return the AvailabilityStatusPropertiesRecentlyResolvedState object itself. + */ + public AvailabilityStatusPropertiesRecentlyResolvedState withUnavailabilitySummary(String unavailabilitySummary) { + this.unavailabilitySummary = unavailabilitySummary; + return this; + } + +} diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/AvailabilityStatuses.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/AvailabilityStatuses.java new file mode 100644 index 000000000000..7a4167fdc1ec --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/AvailabilityStatuses.java @@ -0,0 +1,39 @@ +/** + * 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.resourcehealth.v2015_01_01; + +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Observable; +import com.microsoft.azure.management.resourcehealth.v2015_01_01.implementation.AvailabilityStatusesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing AvailabilityStatuses. + */ +public interface AvailabilityStatuses extends SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getByResourceAsync(String resourceUri); + + /** + * Lists the historical availability statuses for a single resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable list1Async(final String resourceUri); + +} diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/ChildAvailabilityStatuses.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/ChildAvailabilityStatuses.java new file mode 100644 index 000000000000..eb469b6bfc92 --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/ChildAvailabilityStatuses.java @@ -0,0 +1,37 @@ +/** + * 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.resourcehealth.v2015_01_01; + +import rx.Observable; +import com.microsoft.azure.management.resourcehealth.v2015_01_01.implementation.ChildAvailabilityStatusesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ChildAvailabilityStatuses. + */ +public interface ChildAvailabilityStatuses extends HasInner { + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getByResourceAsync(String resourceUri); + + /** + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceUri); + +} diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/ChildResources.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/ChildResources.java new file mode 100644 index 000000000000..6a177870e124 --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/ChildResources.java @@ -0,0 +1,28 @@ +/** + * 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.resourcehealth.v2015_01_01; + +import rx.Observable; +import com.microsoft.azure.management.resourcehealth.v2015_01_01.implementation.ChildResourcesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ChildResources. + */ +public interface ChildResources extends HasInner { + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the response to get the next page of children current health. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support not nested parent resource type: /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceUri); + +} diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/ErrorResponse.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/ErrorResponse.java new file mode 100644 index 000000000000..7d72d5a582f5 --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/ErrorResponse.java @@ -0,0 +1,62 @@ +/** + * 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.resourcehealth.v2015_01_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error details. + */ +public class ErrorResponse { + /** + * The error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * The error message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * The error details. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private String details; + + /** + * Get the error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get the error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the error details. + * + * @return the details value + */ + public String details() { + return this.details; + } + +} diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/ErrorResponseException.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/ErrorResponseException.java new file mode 100644 index 000000000000..d3f7116fac3e --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/ErrorResponseException.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.resourcehealth.v2015_01_01; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.body(); + } +} diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/OperationDisplay.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/OperationDisplay.java new file mode 100644 index 000000000000..23bcceb106fb --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/OperationDisplay.java @@ -0,0 +1,121 @@ +/** + * 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.resourcehealth.v2015_01_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the operation. + */ +public class OperationDisplay { + /** + * Provider name. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Resource name. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Operation name. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get provider name. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set provider name. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get resource name. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set resource name. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get operation name. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set operation name. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get description of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the operation. + * + * @param description the description value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/OperationListResult.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/OperationListResult.java new file mode 100644 index 000000000000..3a47786e7114 --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/OperationListResult.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.resourcehealth.v2015_01_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.resourcehealth.v2015_01_01.implementation.ResourceHealthManager; +import com.microsoft.azure.management.resourcehealth.v2015_01_01.implementation.OperationListResultInner; +import com.microsoft.azure.management.resourcehealth.v2015_01_01.implementation.OperationInner; +import java.util.List; + +/** + * Type representing OperationListResult. + */ +public interface OperationListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/Operations.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/Operations.java new file mode 100644 index 000000000000..ed7e0fb3c084 --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.resourcehealth.v2015_01_01; + +import rx.Observable; +import com.microsoft.azure.management.resourcehealth.v2015_01_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists available operations for the resourcehealth resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/ReasonChronicityTypes.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/ReasonChronicityTypes.java new file mode 100644 index 000000000000..d38e7582f717 --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/ReasonChronicityTypes.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.resourcehealth.v2015_01_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ReasonChronicityTypes. + */ +public enum ReasonChronicityTypes { + /** Enum value Transient. */ + TRANSIENT("Transient"), + + /** Enum value Persistent. */ + PERSISTENT("Persistent"); + + /** The actual serialized value for a ReasonChronicityTypes instance. */ + private String value; + + ReasonChronicityTypes(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ReasonChronicityTypes instance. + * + * @param value the serialized value to parse. + * @return the parsed ReasonChronicityTypes object, or null if unable to parse. + */ + @JsonCreator + public static ReasonChronicityTypes fromString(String value) { + ReasonChronicityTypes[] items = ReasonChronicityTypes.values(); + for (ReasonChronicityTypes item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/RecommendedAction.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/RecommendedAction.java new file mode 100644 index 000000000000..466b41dee1c5 --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/RecommendedAction.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.resourcehealth.v2015_01_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Lists actions the user can take based on the current availabilityState of + * the resource. + */ +public class RecommendedAction { + /** + * Recommended action. + */ + @JsonProperty(value = "action") + private String action; + + /** + * Link to the action. + */ + @JsonProperty(value = "actionUrl") + private String actionUrl; + + /** + * Substring of action, it describes which text should host the action url. + */ + @JsonProperty(value = "actionUrlText") + private String actionUrlText; + + /** + * Get recommended action. + * + * @return the action value + */ + public String action() { + return this.action; + } + + /** + * Set recommended action. + * + * @param action the action value to set + * @return the RecommendedAction object itself. + */ + public RecommendedAction withAction(String action) { + this.action = action; + return this; + } + + /** + * Get link to the action. + * + * @return the actionUrl value + */ + public String actionUrl() { + return this.actionUrl; + } + + /** + * Set link to the action. + * + * @param actionUrl the actionUrl value to set + * @return the RecommendedAction object itself. + */ + public RecommendedAction withActionUrl(String actionUrl) { + this.actionUrl = actionUrl; + return this; + } + + /** + * Get substring of action, it describes which text should host the action url. + * + * @return the actionUrlText value + */ + public String actionUrlText() { + return this.actionUrlText; + } + + /** + * Set substring of action, it describes which text should host the action url. + * + * @param actionUrlText the actionUrlText value to set + * @return the RecommendedAction object itself. + */ + public RecommendedAction withActionUrlText(String actionUrlText) { + this.actionUrlText = actionUrlText; + return this; + } + +} diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/ServiceImpactingEvent.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/ServiceImpactingEvent.java new file mode 100644 index 000000000000..7ea8f5c1e535 --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/ServiceImpactingEvent.java @@ -0,0 +1,149 @@ +/** + * 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.resourcehealth.v2015_01_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Lists the service impacting events that may be affecting the health of the + * resource. + */ +public class ServiceImpactingEvent { + /** + * Timestamp for when the event started. + */ + @JsonProperty(value = "eventStartTime") + private DateTime eventStartTime; + + /** + * Timestamp for when event was submitted/detected. + */ + @JsonProperty(value = "eventStatusLastModifiedTime") + private DateTime eventStatusLastModifiedTime; + + /** + * Correlation id for the event. + */ + @JsonProperty(value = "correlationId") + private String correlationId; + + /** + * Status of the service impacting event. + */ + @JsonProperty(value = "status") + private ServiceImpactingEventStatus status; + + /** + * Properties of the service impacting event. + */ + @JsonProperty(value = "incidentProperties") + private ServiceImpactingEventIncidentProperties incidentProperties; + + /** + * Get timestamp for when the event started. + * + * @return the eventStartTime value + */ + public DateTime eventStartTime() { + return this.eventStartTime; + } + + /** + * Set timestamp for when the event started. + * + * @param eventStartTime the eventStartTime value to set + * @return the ServiceImpactingEvent object itself. + */ + public ServiceImpactingEvent withEventStartTime(DateTime eventStartTime) { + this.eventStartTime = eventStartTime; + return this; + } + + /** + * Get timestamp for when event was submitted/detected. + * + * @return the eventStatusLastModifiedTime value + */ + public DateTime eventStatusLastModifiedTime() { + return this.eventStatusLastModifiedTime; + } + + /** + * Set timestamp for when event was submitted/detected. + * + * @param eventStatusLastModifiedTime the eventStatusLastModifiedTime value to set + * @return the ServiceImpactingEvent object itself. + */ + public ServiceImpactingEvent withEventStatusLastModifiedTime(DateTime eventStatusLastModifiedTime) { + this.eventStatusLastModifiedTime = eventStatusLastModifiedTime; + return this; + } + + /** + * Get correlation id for the event. + * + * @return the correlationId value + */ + public String correlationId() { + return this.correlationId; + } + + /** + * Set correlation id for the event. + * + * @param correlationId the correlationId value to set + * @return the ServiceImpactingEvent object itself. + */ + public ServiceImpactingEvent withCorrelationId(String correlationId) { + this.correlationId = correlationId; + return this; + } + + /** + * Get status of the service impacting event. + * + * @return the status value + */ + public ServiceImpactingEventStatus status() { + return this.status; + } + + /** + * Set status of the service impacting event. + * + * @param status the status value to set + * @return the ServiceImpactingEvent object itself. + */ + public ServiceImpactingEvent withStatus(ServiceImpactingEventStatus status) { + this.status = status; + return this; + } + + /** + * Get properties of the service impacting event. + * + * @return the incidentProperties value + */ + public ServiceImpactingEventIncidentProperties incidentProperties() { + return this.incidentProperties; + } + + /** + * Set properties of the service impacting event. + * + * @param incidentProperties the incidentProperties value to set + * @return the ServiceImpactingEvent object itself. + */ + public ServiceImpactingEvent withIncidentProperties(ServiceImpactingEventIncidentProperties incidentProperties) { + this.incidentProperties = incidentProperties; + return this; + } + +} diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/ServiceImpactingEventIncidentProperties.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/ServiceImpactingEventIncidentProperties.java new file mode 100644 index 000000000000..363dc8271c70 --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/ServiceImpactingEventIncidentProperties.java @@ -0,0 +1,121 @@ +/** + * 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.resourcehealth.v2015_01_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the service impacting event. + */ +public class ServiceImpactingEventIncidentProperties { + /** + * Title of the incident. + */ + @JsonProperty(value = "title") + private String title; + + /** + * Service impacted by the event. + */ + @JsonProperty(value = "service") + private String service; + + /** + * Region impacted by the event. + */ + @JsonProperty(value = "region") + private String region; + + /** + * Type of Event. + */ + @JsonProperty(value = "incidentType") + private String incidentType; + + /** + * Get title of the incident. + * + * @return the title value + */ + public String title() { + return this.title; + } + + /** + * Set title of the incident. + * + * @param title the title value to set + * @return the ServiceImpactingEventIncidentProperties object itself. + */ + public ServiceImpactingEventIncidentProperties withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get service impacted by the event. + * + * @return the service value + */ + public String service() { + return this.service; + } + + /** + * Set service impacted by the event. + * + * @param service the service value to set + * @return the ServiceImpactingEventIncidentProperties object itself. + */ + public ServiceImpactingEventIncidentProperties withService(String service) { + this.service = service; + return this; + } + + /** + * Get region impacted by the event. + * + * @return the region value + */ + public String region() { + return this.region; + } + + /** + * Set region impacted by the event. + * + * @param region the region value to set + * @return the ServiceImpactingEventIncidentProperties object itself. + */ + public ServiceImpactingEventIncidentProperties withRegion(String region) { + this.region = region; + return this; + } + + /** + * Get type of Event. + * + * @return the incidentType value + */ + public String incidentType() { + return this.incidentType; + } + + /** + * Set type of Event. + * + * @param incidentType the incidentType value to set + * @return the ServiceImpactingEventIncidentProperties object itself. + */ + public ServiceImpactingEventIncidentProperties withIncidentType(String incidentType) { + this.incidentType = incidentType; + return this; + } + +} diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/ServiceImpactingEventStatus.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/ServiceImpactingEventStatus.java new file mode 100644 index 000000000000..b8e3e85be917 --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/ServiceImpactingEventStatus.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.resourcehealth.v2015_01_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Status of the service impacting event. + */ +public class ServiceImpactingEventStatus { + /** + * Current status of the event. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get current status of the event. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set current status of the event. + * + * @param value the value value to set + * @return the ServiceImpactingEventStatus object itself. + */ + public ServiceImpactingEventStatus withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/AvailabilityStatusImpl.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/AvailabilityStatusImpl.java new file mode 100644 index 000000000000..ebef24e69c24 --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/AvailabilityStatusImpl.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.resourcehealth.v2015_01_01.implementation; + +import com.microsoft.azure.management.resourcehealth.v2015_01_01.AvailabilityStatus; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.resourcehealth.v2015_01_01.AvailabilityStatusProperties; + +class AvailabilityStatusImpl extends WrapperImpl implements AvailabilityStatus { + private final ResourceHealthManager manager; + + AvailabilityStatusImpl(AvailabilityStatusInner inner, ResourceHealthManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ResourceHealthManager manager() { + return this.manager; + } + + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public AvailabilityStatusProperties properties() { + return this.inner().properties(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/AvailabilityStatusInner.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/AvailabilityStatusInner.java new file mode 100644 index 000000000000..bfc4cdadcce2 --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/AvailabilityStatusInner.java @@ -0,0 +1,148 @@ +/** + * 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.resourcehealth.v2015_01_01.implementation; + +import com.microsoft.azure.management.resourcehealth.v2015_01_01.AvailabilityStatusProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * availabilityStatus of a resource. + */ +public class AvailabilityStatusInner { + /** + * Azure Resource Manager Identity for the availabilityStatuses resource. + */ + @JsonProperty(value = "id") + private String id; + + /** + * current. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Microsoft.ResourceHealth/AvailabilityStatuses. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Azure Resource Manager geo location of the resource. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Properties of availability state. + */ + @JsonProperty(value = "properties") + private AvailabilityStatusProperties properties; + + /** + * Get azure Resource Manager Identity for the availabilityStatuses resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set azure Resource Manager Identity for the availabilityStatuses resource. + * + * @param id the id value to set + * @return the AvailabilityStatusInner object itself. + */ + public AvailabilityStatusInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get current. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set current. + * + * @param name the name value to set + * @return the AvailabilityStatusInner object itself. + */ + public AvailabilityStatusInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get microsoft.ResourceHealth/AvailabilityStatuses. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set microsoft.ResourceHealth/AvailabilityStatuses. + * + * @param type the type value to set + * @return the AvailabilityStatusInner object itself. + */ + public AvailabilityStatusInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get azure Resource Manager geo location of the resource. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set azure Resource Manager geo location of the resource. + * + * @param location the location value to set + * @return the AvailabilityStatusInner object itself. + */ + public AvailabilityStatusInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get properties of availability state. + * + * @return the properties value + */ + public AvailabilityStatusProperties properties() { + return this.properties; + } + + /** + * Set properties of availability state. + * + * @param properties the properties value to set + * @return the AvailabilityStatusInner object itself. + */ + public AvailabilityStatusInner withProperties(AvailabilityStatusProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/AvailabilityStatusesImpl.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/AvailabilityStatusesImpl.java new file mode 100644 index 000000000000..30dcb8196f80 --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/AvailabilityStatusesImpl.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * jkl + */ + +package com.microsoft.azure.management.resourcehealth.v2015_01_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.resourcehealth.v2015_01_01.AvailabilityStatuses; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.resourcehealth.v2015_01_01.AvailabilityStatus; +import com.microsoft.azure.arm.utils.PagedListConverter; + +class AvailabilityStatusesImpl extends WrapperImpl implements AvailabilityStatuses { + private PagedListConverter converter; + private final ResourceHealthManager manager; + + AvailabilityStatusesImpl(ResourceHealthManager manager) { + super(manager.inner().availabilityStatuses()); + this.manager = manager; + this.converter = new PagedListConverter() { + @Override + public Observable typeConvertAsync(AvailabilityStatusInner inner) { + return Observable.just((AvailabilityStatus) wrapModel(inner)); + } + }; + } + + public ResourceHealthManager manager() { + return this.manager; + } + + private AvailabilityStatusImpl wrapModel(AvailabilityStatusInner inner) { + return new AvailabilityStatusImpl(inner, manager()); + } + + @Override + public Observable getByResourceAsync(String resourceUri) { + AvailabilityStatusesInner client = this.inner(); + return client.getByResourceAsync(resourceUri) + .map(new Func1() { + @Override + public AvailabilityStatus call(AvailabilityStatusInner inner) { + return new AvailabilityStatusImpl(inner, manager()); + } + }); + } + + @Override + public Observable list1Async(final String resourceUri) { + AvailabilityStatusesInner client = this.inner(); + return client.list1Async(resourceUri) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public AvailabilityStatus call(AvailabilityStatusInner inner) { + return new AvailabilityStatusImpl(inner, manager()); + } + }); + } + + @Override + public PagedList list() { + AvailabilityStatusesInner client = this.inner(); + return converter.convert(client.list()); + } + + @Override + public Observable listAsync() { + AvailabilityStatusesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public AvailabilityStatus call(AvailabilityStatusInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + AvailabilityStatusesInner client = this.inner(); + return converter.convert(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + AvailabilityStatusesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public AvailabilityStatus call(AvailabilityStatusInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/AvailabilityStatusesInner.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/AvailabilityStatusesInner.java new file mode 100644 index 000000000000..a2bed791060d --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/AvailabilityStatusesInner.java @@ -0,0 +1,1262 @@ +/** + * 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.resourcehealth.v2015_01_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.resourcehealth.v2015_01_01.ErrorResponseException; +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.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in AvailabilityStatuses. + */ +public class AvailabilityStatusesInner implements InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private AvailabilityStatusesService service; + /** The service client containing this operation class. */ + private MicrosoftResourceHealthImpl client; + + /** + * Initializes an instance of AvailabilityStatusesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AvailabilityStatusesInner(Retrofit retrofit, MicrosoftResourceHealthImpl client) { + this.service = retrofit.create(AvailabilityStatusesService.class); + this.client = client; + } + + /** + * The interface defining all the services for AvailabilityStatuses to be + * used by Retrofit to perform actually REST calls. + */ + interface AvailabilityStatusesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resourcehealth.v2015_01_01.AvailabilityStatuses list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/availabilityStatuses") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$expand") String expand, @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.resourcehealth.v2015_01_01.AvailabilityStatuses listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceHealth/availabilityStatuses") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$expand") String expand, @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.resourcehealth.v2015_01_01.AvailabilityStatuses getByResource" }) + @GET("{resourceUri}/providers/Microsoft.ResourceHealth/availabilityStatuses/current") + Observable> getByResource(@Path(value = "resourceUri", encoded = true) String resourceUri, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$expand") String expand, @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.resourcehealth.v2015_01_01.AvailabilityStatuses list1" }) + @GET("{resourceUri}/providers/Microsoft.ResourceHealth/availabilityStatuses") + Observable> list1(@Path(value = "resourceUri", encoded = true) String resourceUri, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$expand") String expand, @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.resourcehealth.v2015_01_01.AvailabilityStatuses listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @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.resourcehealth.v2015_01_01.AvailabilityStatuses listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @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.resourcehealth.v2015_01_01.AvailabilityStatuses list1Next" }) + @GET + Observable> list1Next(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the response to get the next page of availability statuses. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailabilityStatusInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the response to get the next page of availability statuses. + * + * @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 ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the response to get the next page of availability statuses. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the response to get the next page of availability statuses. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the response to get the next page of availability statuses. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailabilityStatusInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + 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."); + } + final String filter = null; + final String expand = null; + return service.list(this.client.subscriptionId(), this.client.apiVersion(), filter, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailabilityStatusInner> object if successful. + */ + public PagedList list(final String filter, final String expand) { + ServiceResponse> response = listSinglePageAsync(filter, expand).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @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 String filter, final String expand, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(filter, expand), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable> listAsync(final String filter, final String expand) { + return listWithServiceResponseAsync(filter, expand) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable>> listWithServiceResponseAsync(final String filter, final String expand) { + return listSinglePageAsync(filter, expand) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the response to get the next page of availability statuses. + * + ServiceResponse> * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + ServiceResponse> * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailabilityStatusInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String filter, final String expand) { + 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(), filter, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailabilityStatusInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param resourceGroupName The name of the resource group. + * @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> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailabilityStatusInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final 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."); + } + final String filter = null; + final String expand = null; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), filter, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param resourceGroupName The name of the resource group. + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailabilityStatusInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName, final String filter, final String expand) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param resourceGroupName The name of the resource group. + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @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> listByResourceGroupAsync(final String resourceGroupName, final String filter, final String expand, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param resourceGroupName The name of the resource group. + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName, final String filter, final String expand) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName, filter, expand) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param resourceGroupName The name of the resource group. + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String filter, final String expand) { + return listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in the response to get the next page of availability statuses. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + ServiceResponse> * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailabilityStatusInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName, final String filter, final String expand) { + 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(), filter, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AvailabilityStatusInner object if successful. + */ + public AvailabilityStatusInner getByResource(String resourceUri) { + return getByResourceWithServiceResponseAsync(resourceUri).toBlocking().single().body(); + } + + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @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 getByResourceAsync(String resourceUri, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceWithServiceResponseAsync(resourceUri), serviceCallback); + } + + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AvailabilityStatusInner object + */ + public Observable getByResourceAsync(String resourceUri) { + return getByResourceWithServiceResponseAsync(resourceUri).map(new Func1, AvailabilityStatusInner>() { + @Override + public AvailabilityStatusInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AvailabilityStatusInner object + */ + public Observable> getByResourceWithServiceResponseAsync(String resourceUri) { + if (resourceUri == null) { + throw new IllegalArgumentException("Parameter resourceUri 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 String filter = null; + final String expand = null; + return service.getByResource(resourceUri, this.client.apiVersion(), filter, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AvailabilityStatusInner object if successful. + */ + public AvailabilityStatusInner getByResource(String resourceUri, String filter, String expand) { + return getByResourceWithServiceResponseAsync(resourceUri, filter, expand).toBlocking().single().body(); + } + + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @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 getByResourceAsync(String resourceUri, String filter, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceWithServiceResponseAsync(resourceUri, filter, expand), serviceCallback); + } + + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AvailabilityStatusInner object + */ + public Observable getByResourceAsync(String resourceUri, String filter, String expand) { + return getByResourceWithServiceResponseAsync(resourceUri, filter, expand).map(new Func1, AvailabilityStatusInner>() { + @Override + public AvailabilityStatusInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AvailabilityStatusInner object + */ + public Observable> getByResourceWithServiceResponseAsync(String resourceUri, String filter, String expand) { + if (resourceUri == null) { + throw new IllegalArgumentException("Parameter resourceUri 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.getByResource(resourceUri, this.client.apiVersion(), filter, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the historical availability statuses for a single resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailabilityStatusInner> object if successful. + */ + public PagedList list1(final String resourceUri) { + ServiceResponse> response = list1SinglePageAsync(resourceUri).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return list1NextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the historical availability statuses for a single resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @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> list1Async(final String resourceUri, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + list1SinglePageAsync(resourceUri), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return list1NextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the historical availability statuses for a single resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable> list1Async(final String resourceUri) { + return list1WithServiceResponseAsync(resourceUri) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the historical availability statuses for a single resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable>> list1WithServiceResponseAsync(final String resourceUri) { + return list1SinglePageAsync(resourceUri) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(list1NextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the historical availability statuses for a single resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailabilityStatusInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> list1SinglePageAsync(final String resourceUri) { + if (resourceUri == null) { + throw new IllegalArgumentException("Parameter resourceUri 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 String filter = null; + final String expand = null; + return service.list1(resourceUri, this.client.apiVersion(), filter, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = list1Delegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists the historical availability statuses for a single resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailabilityStatusInner> object if successful. + */ + public PagedList list1(final String resourceUri, final String filter, final String expand) { + ServiceResponse> response = list1SinglePageAsync(resourceUri, filter, expand).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return list1NextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the historical availability statuses for a single resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @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> list1Async(final String resourceUri, final String filter, final String expand, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + list1SinglePageAsync(resourceUri, filter, expand), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return list1NextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the historical availability statuses for a single resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable> list1Async(final String resourceUri, final String filter, final String expand) { + return list1WithServiceResponseAsync(resourceUri, filter, expand) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the historical availability statuses for a single resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable>> list1WithServiceResponseAsync(final String resourceUri, final String filter, final String expand) { + return list1SinglePageAsync(resourceUri, filter, expand) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(list1NextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the historical availability statuses for a single resource. Use the nextLink property in the response to get the next page of availability status. + * + ServiceResponse> * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + ServiceResponse> * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + ServiceResponse> * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailabilityStatusInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> list1SinglePageAsync(final String resourceUri, final String filter, final String expand) { + if (resourceUri == null) { + throw new IllegalArgumentException("Parameter resourceUri 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.list1(resourceUri, this.client.apiVersion(), filter, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = list1Delegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> list1Delegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailabilityStatusInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the response to get the next page of availability statuses. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailabilityStatusInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailabilityStatusInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in the response to get the next page of availability statuses. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailabilityStatusInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the historical availability statuses for a single resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailabilityStatusInner> object if successful. + */ + public PagedList list1Next(final String nextPageLink) { + ServiceResponse> response = list1NextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return list1NextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the historical availability statuses for a single resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> list1NextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + list1NextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return list1NextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the historical availability statuses for a single resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable> list1NextAsync(final String nextPageLink) { + return list1NextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the historical availability statuses for a single resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable>> list1NextWithServiceResponseAsync(final String nextPageLink) { + return list1NextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(list1NextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the historical availability statuses for a single resource. Use the nextLink property in the response to get the next page of availability status. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailabilityStatusInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> list1NextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.list1Next(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = list1NextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> list1NextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/ChildAvailabilityStatusesImpl.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/ChildAvailabilityStatusesImpl.java new file mode 100644 index 000000000000..e2aa59476be3 --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/ChildAvailabilityStatusesImpl.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.resourcehealth.v2015_01_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.resourcehealth.v2015_01_01.ChildAvailabilityStatuses; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.resourcehealth.v2015_01_01.AvailabilityStatus; + +class ChildAvailabilityStatusesImpl extends WrapperImpl implements ChildAvailabilityStatuses { + private final ResourceHealthManager manager; + + ChildAvailabilityStatusesImpl(ResourceHealthManager manager) { + super(manager.inner().childAvailabilityStatuses()); + this.manager = manager; + } + + public ResourceHealthManager manager() { + return this.manager; + } + + @Override + public Observable getByResourceAsync(String resourceUri) { + ChildAvailabilityStatusesInner client = this.inner(); + return client.getByResourceAsync(resourceUri) + .map(new Func1() { + @Override + public AvailabilityStatus call(AvailabilityStatusInner inner) { + return new AvailabilityStatusImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String resourceUri) { + ChildAvailabilityStatusesInner client = this.inner(); + return client.listAsync(resourceUri) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public AvailabilityStatus call(AvailabilityStatusInner inner) { + return new AvailabilityStatusImpl(inner, manager()); + } + }); + } + +} diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/ChildAvailabilityStatusesInner.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/ChildAvailabilityStatusesInner.java new file mode 100644 index 000000000000..66efc7db5bfb --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/ChildAvailabilityStatusesInner.java @@ -0,0 +1,569 @@ +/** + * 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.resourcehealth.v2015_01_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.resourcehealth.v2015_01_01.ErrorResponseException; +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.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ChildAvailabilityStatuses. + */ +public class ChildAvailabilityStatusesInner { + /** The Retrofit service to perform REST calls. */ + private ChildAvailabilityStatusesService service; + /** The service client containing this operation class. */ + private MicrosoftResourceHealthImpl client; + + /** + * Initializes an instance of ChildAvailabilityStatusesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ChildAvailabilityStatusesInner(Retrofit retrofit, MicrosoftResourceHealthImpl client) { + this.service = retrofit.create(ChildAvailabilityStatusesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ChildAvailabilityStatuses to be + * used by Retrofit to perform actually REST calls. + */ + interface ChildAvailabilityStatusesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resourcehealth.v2015_01_01.ChildAvailabilityStatuses getByResource" }) + @GET("{resourceUri}/providers/Microsoft.ResourceHealth/childAvailabilityStatuses/current") + Observable> getByResource(@Path(value = "resourceUri", encoded = true) String resourceUri, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$expand") String expand, @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.resourcehealth.v2015_01_01.ChildAvailabilityStatuses list" }) + @GET("{resourceUri}/providers/Microsoft.ResourceHealth/childAvailabilityStatuses") + Observable> list(@Path(value = "resourceUri", encoded = true) String resourceUri, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$expand") String expand, @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.resourcehealth.v2015_01_01.ChildAvailabilityStatuses listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AvailabilityStatusInner object if successful. + */ + public AvailabilityStatusInner getByResource(String resourceUri) { + return getByResourceWithServiceResponseAsync(resourceUri).toBlocking().single().body(); + } + + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @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 getByResourceAsync(String resourceUri, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceWithServiceResponseAsync(resourceUri), serviceCallback); + } + + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AvailabilityStatusInner object + */ + public Observable getByResourceAsync(String resourceUri) { + return getByResourceWithServiceResponseAsync(resourceUri).map(new Func1, AvailabilityStatusInner>() { + @Override + public AvailabilityStatusInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AvailabilityStatusInner object + */ + public Observable> getByResourceWithServiceResponseAsync(String resourceUri) { + if (resourceUri == null) { + throw new IllegalArgumentException("Parameter resourceUri 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 String filter = null; + final String expand = null; + return service.getByResource(resourceUri, this.client.apiVersion(), filter, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AvailabilityStatusInner object if successful. + */ + public AvailabilityStatusInner getByResource(String resourceUri, String filter, String expand) { + return getByResourceWithServiceResponseAsync(resourceUri, filter, expand).toBlocking().single().body(); + } + + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @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 getByResourceAsync(String resourceUri, String filter, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceWithServiceResponseAsync(resourceUri, filter, expand), serviceCallback); + } + + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AvailabilityStatusInner object + */ + public Observable getByResourceAsync(String resourceUri, String filter, String expand) { + return getByResourceWithServiceResponseAsync(resourceUri, filter, expand).map(new Func1, AvailabilityStatusInner>() { + @Override + public AvailabilityStatusInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AvailabilityStatusInner object + */ + public Observable> getByResourceWithServiceResponseAsync(String resourceUri, String filter, String expand) { + if (resourceUri == null) { + throw new IllegalArgumentException("Parameter resourceUri 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.getByResource(resourceUri, this.client.apiVersion(), filter, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailabilityStatusInner> object if successful. + */ + public PagedList list(final String resourceUri) { + ServiceResponse> response = listSinglePageAsync(resourceUri).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @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 String resourceUri, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceUri), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable> listAsync(final String resourceUri) { + return listWithServiceResponseAsync(resourceUri) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceUri) { + return listSinglePageAsync(resourceUri) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailabilityStatusInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceUri) { + if (resourceUri == null) { + throw new IllegalArgumentException("Parameter resourceUri 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 String filter = null; + final String expand = null; + return service.list(resourceUri, this.client.apiVersion(), filter, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailabilityStatusInner> object if successful. + */ + public PagedList list(final String resourceUri, final String filter, final String expand) { + ServiceResponse> response = listSinglePageAsync(resourceUri, filter, expand).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @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 String resourceUri, final String filter, final String expand, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceUri, filter, expand), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable> listAsync(final String resourceUri, final String filter, final String expand) { + return listWithServiceResponseAsync(resourceUri, filter, expand) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceUri, final String filter, final String expand) { + return listSinglePageAsync(resourceUri, filter, expand) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response to get the next page of availability status. + * + ServiceResponse> * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + ServiceResponse> * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + ServiceResponse> * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailabilityStatusInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceUri, final String filter, final String expand) { + if (resourceUri == null) { + throw new IllegalArgumentException("Parameter resourceUri 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(resourceUri, this.client.apiVersion(), filter, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailabilityStatusInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response to get the next page of availability status. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailabilityStatusInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/ChildResourcesImpl.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/ChildResourcesImpl.java new file mode 100644 index 000000000000..3fae78556805 --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/ChildResourcesImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.resourcehealth.v2015_01_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.resourcehealth.v2015_01_01.ChildResources; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.resourcehealth.v2015_01_01.AvailabilityStatus; + +class ChildResourcesImpl extends WrapperImpl implements ChildResources { + private final ResourceHealthManager manager; + + ChildResourcesImpl(ResourceHealthManager manager) { + super(manager.inner().childResources()); + this.manager = manager; + } + + public ResourceHealthManager manager() { + return this.manager; + } + + @Override + public Observable listAsync(final String resourceUri) { + ChildResourcesInner client = this.inner(); + return client.listAsync(resourceUri) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public AvailabilityStatus call(AvailabilityStatusInner inner) { + return new AvailabilityStatusImpl(inner, manager()); + } + }); + } + +} diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/ChildResourcesInner.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/ChildResourcesInner.java new file mode 100644 index 000000000000..57fc31ab6012 --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/ChildResourcesInner.java @@ -0,0 +1,409 @@ +/** + * 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.resourcehealth.v2015_01_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.resourcehealth.v2015_01_01.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +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.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ChildResources. + */ +public class ChildResourcesInner { + /** The Retrofit service to perform REST calls. */ + private ChildResourcesService service; + /** The service client containing this operation class. */ + private MicrosoftResourceHealthImpl client; + + /** + * Initializes an instance of ChildResourcesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ChildResourcesInner(Retrofit retrofit, MicrosoftResourceHealthImpl client) { + this.service = retrofit.create(ChildResourcesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ChildResources to be + * used by Retrofit to perform actually REST calls. + */ + interface ChildResourcesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resourcehealth.v2015_01_01.ChildResources list" }) + @GET("{resourceUri}/providers/Microsoft.ResourceHealth/childResources") + Observable> list(@Path(value = "resourceUri", encoded = true) String resourceUri, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$expand") String expand, @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.resourcehealth.v2015_01_01.ChildResources listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the response to get the next page of children current health. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support not nested parent resource type: /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailabilityStatusInner> object if successful. + */ + public PagedList list(final String resourceUri) { + ServiceResponse> response = listSinglePageAsync(resourceUri).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the response to get the next page of children current health. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support not nested parent resource type: /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-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> listAsync(final String resourceUri, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceUri), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the response to get the next page of children current health. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support not nested parent resource type: /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable> listAsync(final String resourceUri) { + return listWithServiceResponseAsync(resourceUri) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the response to get the next page of children current health. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support not nested parent resource type: /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceUri) { + return listSinglePageAsync(resourceUri) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the response to get the next page of children current health. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support not nested parent resource type: /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailabilityStatusInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceUri) { + if (resourceUri == null) { + throw new IllegalArgumentException("Parameter resourceUri 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 String filter = null; + final String expand = null; + return service.list(resourceUri, this.client.apiVersion(), filter, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the response to get the next page of children current health. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support not nested parent resource type: /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailabilityStatusInner> object if successful. + */ + public PagedList list(final String resourceUri, final String filter, final String expand) { + ServiceResponse> response = listSinglePageAsync(resourceUri, filter, expand).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the response to get the next page of children current health. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support not nested parent resource type: /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @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 String resourceUri, final String filter, final String expand, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceUri, filter, expand), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the response to get the next page of children current health. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support not nested parent resource type: /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable> listAsync(final String resourceUri, final String filter, final String expand) { + return listWithServiceResponseAsync(resourceUri, filter, expand) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the response to get the next page of children current health. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support not nested parent resource type: /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceUri, final String filter, final String expand) { + return listSinglePageAsync(resourceUri, filter, expand) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the response to get the next page of children current health. + * + ServiceResponse> * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support not nested parent resource type: /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} + ServiceResponse> * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + ServiceResponse> * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailabilityStatusInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceUri, final String filter, final String expand) { + if (resourceUri == null) { + throw new IllegalArgumentException("Parameter resourceUri 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(resourceUri, this.client.apiVersion(), filter, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the response to get the next page of children current health. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailabilityStatusInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the response to get the next page of children current health. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the response to get the next page of children current health. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the response to get the next page of children current health. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the response to get the next page of children current health. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailabilityStatusInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/IdParsingUtils.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..21e7c1d6b2a4 --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/IdParsingUtils.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.resourcehealth.v2015_01_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/MicrosoftResourceHealthImpl.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/MicrosoftResourceHealthImpl.java new file mode 100644 index 000000000000..ba2725b5de13 --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/MicrosoftResourceHealthImpl.java @@ -0,0 +1,238 @@ +/** + * 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.resourcehealth.v2015_01_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the MicrosoftResourceHealthImpl class. + */ +public class MicrosoftResourceHealthImpl extends AzureServiceClient { + /** 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 credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public MicrosoftResourceHealthImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client Api Version. */ + private String apiVersion; + + /** + * Gets Client 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 MicrosoftResourceHealthImpl 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 MicrosoftResourceHealthImpl 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 MicrosoftResourceHealthImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The AvailabilityStatusesInner object to access its operations. + */ + private AvailabilityStatusesInner availabilityStatuses; + + /** + * Gets the AvailabilityStatusesInner object to access its operations. + * @return the AvailabilityStatusesInner object. + */ + public AvailabilityStatusesInner availabilityStatuses() { + return this.availabilityStatuses; + } + + /** + * The ChildAvailabilityStatusesInner object to access its operations. + */ + private ChildAvailabilityStatusesInner childAvailabilityStatuses; + + /** + * Gets the ChildAvailabilityStatusesInner object to access its operations. + * @return the ChildAvailabilityStatusesInner object. + */ + public ChildAvailabilityStatusesInner childAvailabilityStatuses() { + return this.childAvailabilityStatuses; + } + + /** + * The ChildResourcesInner object to access its operations. + */ + private ChildResourcesInner childResources; + + /** + * Gets the ChildResourcesInner object to access its operations. + * @return the ChildResourcesInner object. + */ + public ChildResourcesInner childResources() { + return this.childResources; + } + + /** + * 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; + } + + /** + * Initializes an instance of MicrosoftResourceHealth client. + * + * @param credentials the management credentials for Azure + */ + public MicrosoftResourceHealthImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of MicrosoftResourceHealth client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public MicrosoftResourceHealthImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of MicrosoftResourceHealth client. + * + * @param restClient the REST client to connect to Azure. + */ + public MicrosoftResourceHealthImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2015-01-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.availabilityStatuses = new AvailabilityStatusesInner(restClient().retrofit(), this); + this.childAvailabilityStatuses = new ChildAvailabilityStatusesInner(restClient().retrofit(), this); + this.childResources = new ChildResourcesInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * 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(), "MicrosoftResourceHealth", "2015-01-01"); + } +} diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/OperationInner.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/OperationInner.java new file mode 100644 index 000000000000..570586e13b69 --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/OperationInner.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.resourcehealth.v2015_01_01.implementation; + +import com.microsoft.azure.management.resourcehealth.v2015_01_01.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Operation available in the resourcehealth resource provider. + */ +public class OperationInner { + /** + * Name of the operation. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Properties of the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Get name of the operation. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the operation. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get properties of the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set properties of the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + +} diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/OperationListResultImpl.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/OperationListResultImpl.java new file mode 100644 index 000000000000..f61056e19033 --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/OperationListResultImpl.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.resourcehealth.v2015_01_01.implementation; + +import com.microsoft.azure.management.resourcehealth.v2015_01_01.OperationListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class OperationListResultImpl extends WrapperImpl implements OperationListResult { + private final ResourceHealthManager manager; + OperationListResultImpl(OperationListResultInner inner, ResourceHealthManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ResourceHealthManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/OperationListResultInner.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/OperationListResultInner.java new file mode 100644 index 000000000000..ea8dcfcc8183 --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/OperationListResultInner.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.resourcehealth.v2015_01_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Lists the operations response. + */ +public class OperationListResultInner { + /** + * List of operations available in the resourcehealth resource provider. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get list of operations available in the resourcehealth resource provider. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set list of operations available in the resourcehealth resource provider. + * + * @param value the value value to set + * @return the OperationListResultInner object itself. + */ + public OperationListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/OperationsImpl.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/OperationsImpl.java new file mode 100644 index 000000000000..3025d3879ea7 --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/OperationsImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.resourcehealth.v2015_01_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.resourcehealth.v2015_01_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.resourcehealth.v2015_01_01.OperationListResult; + +class OperationsImpl extends WrapperImpl implements Operations { + private final ResourceHealthManager manager; + + OperationsImpl(ResourceHealthManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public ResourceHealthManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .map(new Func1() { + @Override + public OperationListResult call(OperationListResultInner inner) { + return new OperationListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/OperationsInner.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/OperationsInner.java new file mode 100644 index 000000000000..3c9925deed0b --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/OperationsInner.java @@ -0,0 +1,128 @@ +/** + * 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.resourcehealth.v2015_01_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.resourcehealth.v2015_01_01.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.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 MicrosoftResourceHealthImpl 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, MicrosoftResourceHealthImpl 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.resourcehealth.v2015_01_01.Operations list" }) + @GET("providers/Microsoft.ResourceHealth/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists available operations for the resourcehealth resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OperationListResultInner object if successful. + */ + public OperationListResultInner list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Lists available operations for the resourcehealth resource provider. + * + * @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); + } + + /** + * Lists available operations for the resourcehealth resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListResultInner object + */ + public Observable listAsync() { + return listWithServiceResponseAsync().map(new Func1, OperationListResultInner>() { + @Override + public OperationListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists available operations for the resourcehealth resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListResultInner 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 clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/PageImpl.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/PageImpl.java new file mode 100644 index 000000000000..3309cfa1ebcd --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/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.resourcehealth.v2015_01_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 PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + 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/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/ResourceHealthManager.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/ResourceHealthManager.java new file mode 100644 index 000000000000..98f744251bf0 --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/ResourceHealthManager.java @@ -0,0 +1,135 @@ +/** + * 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.resourcehealth.v2015_01_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.resourcehealth.v2015_01_01.AvailabilityStatuses; +import com.microsoft.azure.management.resourcehealth.v2015_01_01.ChildAvailabilityStatuses; +import com.microsoft.azure.management.resourcehealth.v2015_01_01.ChildResources; +import com.microsoft.azure.management.resourcehealth.v2015_01_01.Operations; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure ResourceHealth resource management. + */ +public final class ResourceHealthManager extends ManagerCore { + private AvailabilityStatuses availabilityStatuses; + private ChildAvailabilityStatuses childAvailabilityStatuses; + private ChildResources childResources; + private Operations operations; + /** + * Get a Configurable instance that can be used to create ResourceHealthManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new ResourceHealthManager.ConfigurableImpl(); + } + /** + * Creates an instance of ResourceHealthManager that exposes ResourceHealth resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the ResourceHealthManager + */ + public static ResourceHealthManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new ResourceHealthManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of ResourceHealthManager that exposes ResourceHealth resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the ResourceHealthManager + */ + public static ResourceHealthManager authenticate(RestClient restClient, String subscriptionId) { + return new ResourceHealthManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of ResourceHealthManager that exposes ResourceHealth management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing ResourceHealth management API entry points that work across subscriptions + */ + ResourceHealthManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage AvailabilityStatuses. + */ + public AvailabilityStatuses availabilityStatuses() { + if (this.availabilityStatuses == null) { + this.availabilityStatuses = new AvailabilityStatusesImpl(this); + } + return this.availabilityStatuses; + } + + /** + * @return Entry point to manage ChildAvailabilityStatuses. + */ + public ChildAvailabilityStatuses childAvailabilityStatuses() { + if (this.childAvailabilityStatuses == null) { + this.childAvailabilityStatuses = new ChildAvailabilityStatusesImpl(this); + } + return this.childAvailabilityStatuses; + } + + /** + * @return Entry point to manage ChildResources. + */ + public ChildResources childResources() { + if (this.childResources == null) { + this.childResources = new ChildResourcesImpl(this); + } + return this.childResources; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public ResourceHealthManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return ResourceHealthManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private ResourceHealthManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new MicrosoftResourceHealthImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/package-info.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/implementation/package-info.java new file mode 100644 index 000000000000..e2dd22f58ca7 --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/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 MicrosoftResourceHealth. + * The Resource Health Client. + */ +package com.microsoft.azure.management.resourcehealth.v2015_01_01.implementation; diff --git a/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/package-info.java b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/package-info.java new file mode 100644 index 000000000000..7bc70c7fb44d --- /dev/null +++ b/resourcehealth/resource-manager/v2015_01_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2015_01_01/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 MicrosoftResourceHealth. + * The Resource Health Client. + */ +package com.microsoft.azure.management.resourcehealth.v2015_01_01; diff --git a/resourcehealth/resource-manager/v2017_07_01/pom.xml b/resourcehealth/resource-manager/v2017_07_01/pom.xml new file mode 100644 index 000000000000..58d389a738ce --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.resourcehealth.v2017_07_01 + + com.microsoft.azure + azure-arm-parent + 1.1.0 + ../../../pom.management.xml + + azure-mgmt-resourcehealth + 1.0.0-beta + jar + Microsoft Azure SDK for ResourceHealth Management + This package contains Microsoft ResourceHealth Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/AvailabilityStateValues.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/AvailabilityStateValues.java new file mode 100644 index 000000000000..781dea16d7ff --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/AvailabilityStateValues.java @@ -0,0 +1,56 @@ +/** + * 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.resourcehealth.v2017_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AvailabilityStateValues. + */ +public enum AvailabilityStateValues { + /** Enum value Available. */ + AVAILABLE("Available"), + + /** Enum value Unavailable. */ + UNAVAILABLE("Unavailable"), + + /** Enum value Unknown. */ + UNKNOWN("Unknown"); + + /** The actual serialized value for a AvailabilityStateValues instance. */ + private String value; + + AvailabilityStateValues(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AvailabilityStateValues instance. + * + * @param value the serialized value to parse. + * @return the parsed AvailabilityStateValues object, or null if unable to parse. + */ + @JsonCreator + public static AvailabilityStateValues fromString(String value) { + AvailabilityStateValues[] items = AvailabilityStateValues.values(); + for (AvailabilityStateValues item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/AvailabilityStatus.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/AvailabilityStatus.java new file mode 100644 index 000000000000..45c526786dab --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/AvailabilityStatus.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.resourcehealth.v2017_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.resourcehealth.v2017_07_01.implementation.AvailabilityStatusInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.resourcehealth.v2017_07_01.implementation.ResourceHealthManager; + +/** + * Type representing AvailabilityStatus. + */ +public interface AvailabilityStatus extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + AvailabilityStatusProperties properties(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/AvailabilityStatusProperties.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/AvailabilityStatusProperties.java new file mode 100644 index 000000000000..60859cc39b33 --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/AvailabilityStatusProperties.java @@ -0,0 +1,452 @@ +/** + * 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.resourcehealth.v2017_07_01; + +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of availability state. + */ +public class AvailabilityStatusProperties { + /** + * Availability status of the resource. When it is null, this + * availabilityStatus object represents an availability impacting event. + * Possible values include: 'Available', 'Unavailable', 'Unknown'. + */ + @JsonProperty(value = "availabilityState") + private AvailabilityStateValues availabilityState; + + /** + * Summary description of the availability status. + */ + @JsonProperty(value = "summary") + private String summary; + + /** + * Details of the availability status. + */ + @JsonProperty(value = "detailedStatus") + private String detailedStatus; + + /** + * When the resource's availabilityState is Unavailable, it describes where + * the health impacting event was originated. Examples are planned, + * unplanned, user initiated or an outage etc. + */ + @JsonProperty(value = "reasonType") + private String reasonType; + + /** + * When the resource's availabilityState is Unavailable, it provides the + * Timestamp for when the health impacting event was received. + */ + @JsonProperty(value = "rootCauseAttributionTime") + private DateTime rootCauseAttributionTime; + + /** + * In case of an availability impacting event, it describes when the health + * impacting event was originated. Examples are Lifecycle, Downtime, Fault + * Analysis etc. + */ + @JsonProperty(value = "healthEventType") + private String healthEventType; + + /** + * In case of an availability impacting event, it describes where the + * health impacting event was originated. Examples are PlatformInitiated, + * UserInitiated etc. + */ + @JsonProperty(value = "healthEventCause") + private String healthEventCause; + + /** + * In case of an availability impacting event, it describes the category of + * a PlatformInitiated health impacting event. Examples are Planned, + * Unplanned etc. + */ + @JsonProperty(value = "healthEventCategory") + private String healthEventCategory; + + /** + * It is a unique Id that identifies the event. + */ + @JsonProperty(value = "healthEventId") + private String healthEventId; + + /** + * When the resource's availabilityState is Unavailable and the reasonType + * is not User Initiated, it provides the date and time for when the issue + * is expected to be resolved. + */ + @JsonProperty(value = "resolutionETA") + private DateTime resolutionETA; + + /** + * Timestamp for when last change in health status occurred. + */ + @JsonProperty(value = "occuredTime") + private DateTime occuredTime; + + /** + * Chronicity of the availability transition. Possible values include: + * 'Transient', 'Persistent'. + */ + @JsonProperty(value = "reasonChronicity") + private ReasonChronicityTypes reasonChronicity; + + /** + * Timestamp for when the health was last checked. + */ + @JsonProperty(value = "reportedTime") + private DateTime reportedTime; + + /** + * An annotation describing a change in the availabilityState to Available + * from Unavailable with a reasonType of type Unplanned. + */ + @JsonProperty(value = "recentlyResolvedState") + private AvailabilityStatusPropertiesRecentlyResolvedState recentlyResolvedState; + + /** + * Lists actions the user can take based on the current availabilityState + * of the resource. + */ + @JsonProperty(value = "recommendedActions") + private List recommendedActions; + + /** + * Lists the service impacting events that may be affecting the health of + * the resource. + */ + @JsonProperty(value = "serviceImpactingEvents") + private List serviceImpactingEvents; + + /** + * Get availability status of the resource. When it is null, this availabilityStatus object represents an availability impacting event. Possible values include: 'Available', 'Unavailable', 'Unknown'. + * + * @return the availabilityState value + */ + public AvailabilityStateValues availabilityState() { + return this.availabilityState; + } + + /** + * Set availability status of the resource. When it is null, this availabilityStatus object represents an availability impacting event. Possible values include: 'Available', 'Unavailable', 'Unknown'. + * + * @param availabilityState the availabilityState value to set + * @return the AvailabilityStatusProperties object itself. + */ + public AvailabilityStatusProperties withAvailabilityState(AvailabilityStateValues availabilityState) { + this.availabilityState = availabilityState; + return this; + } + + /** + * Get summary description of the availability status. + * + * @return the summary value + */ + public String summary() { + return this.summary; + } + + /** + * Set summary description of the availability status. + * + * @param summary the summary value to set + * @return the AvailabilityStatusProperties object itself. + */ + public AvailabilityStatusProperties withSummary(String summary) { + this.summary = summary; + return this; + } + + /** + * Get details of the availability status. + * + * @return the detailedStatus value + */ + public String detailedStatus() { + return this.detailedStatus; + } + + /** + * Set details of the availability status. + * + * @param detailedStatus the detailedStatus value to set + * @return the AvailabilityStatusProperties object itself. + */ + public AvailabilityStatusProperties withDetailedStatus(String detailedStatus) { + this.detailedStatus = detailedStatus; + return this; + } + + /** + * Get when the resource's availabilityState is Unavailable, it describes where the health impacting event was originated. Examples are planned, unplanned, user initiated or an outage etc. + * + * @return the reasonType value + */ + public String reasonType() { + return this.reasonType; + } + + /** + * Set when the resource's availabilityState is Unavailable, it describes where the health impacting event was originated. Examples are planned, unplanned, user initiated or an outage etc. + * + * @param reasonType the reasonType value to set + * @return the AvailabilityStatusProperties object itself. + */ + public AvailabilityStatusProperties withReasonType(String reasonType) { + this.reasonType = reasonType; + return this; + } + + /** + * Get when the resource's availabilityState is Unavailable, it provides the Timestamp for when the health impacting event was received. + * + * @return the rootCauseAttributionTime value + */ + public DateTime rootCauseAttributionTime() { + return this.rootCauseAttributionTime; + } + + /** + * Set when the resource's availabilityState is Unavailable, it provides the Timestamp for when the health impacting event was received. + * + * @param rootCauseAttributionTime the rootCauseAttributionTime value to set + * @return the AvailabilityStatusProperties object itself. + */ + public AvailabilityStatusProperties withRootCauseAttributionTime(DateTime rootCauseAttributionTime) { + this.rootCauseAttributionTime = rootCauseAttributionTime; + return this; + } + + /** + * Get in case of an availability impacting event, it describes when the health impacting event was originated. Examples are Lifecycle, Downtime, Fault Analysis etc. + * + * @return the healthEventType value + */ + public String healthEventType() { + return this.healthEventType; + } + + /** + * Set in case of an availability impacting event, it describes when the health impacting event was originated. Examples are Lifecycle, Downtime, Fault Analysis etc. + * + * @param healthEventType the healthEventType value to set + * @return the AvailabilityStatusProperties object itself. + */ + public AvailabilityStatusProperties withHealthEventType(String healthEventType) { + this.healthEventType = healthEventType; + return this; + } + + /** + * Get in case of an availability impacting event, it describes where the health impacting event was originated. Examples are PlatformInitiated, UserInitiated etc. + * + * @return the healthEventCause value + */ + public String healthEventCause() { + return this.healthEventCause; + } + + /** + * Set in case of an availability impacting event, it describes where the health impacting event was originated. Examples are PlatformInitiated, UserInitiated etc. + * + * @param healthEventCause the healthEventCause value to set + * @return the AvailabilityStatusProperties object itself. + */ + public AvailabilityStatusProperties withHealthEventCause(String healthEventCause) { + this.healthEventCause = healthEventCause; + return this; + } + + /** + * Get in case of an availability impacting event, it describes the category of a PlatformInitiated health impacting event. Examples are Planned, Unplanned etc. + * + * @return the healthEventCategory value + */ + public String healthEventCategory() { + return this.healthEventCategory; + } + + /** + * Set in case of an availability impacting event, it describes the category of a PlatformInitiated health impacting event. Examples are Planned, Unplanned etc. + * + * @param healthEventCategory the healthEventCategory value to set + * @return the AvailabilityStatusProperties object itself. + */ + public AvailabilityStatusProperties withHealthEventCategory(String healthEventCategory) { + this.healthEventCategory = healthEventCategory; + return this; + } + + /** + * Get it is a unique Id that identifies the event. + * + * @return the healthEventId value + */ + public String healthEventId() { + return this.healthEventId; + } + + /** + * Set it is a unique Id that identifies the event. + * + * @param healthEventId the healthEventId value to set + * @return the AvailabilityStatusProperties object itself. + */ + public AvailabilityStatusProperties withHealthEventId(String healthEventId) { + this.healthEventId = healthEventId; + return this; + } + + /** + * Get when the resource's availabilityState is Unavailable and the reasonType is not User Initiated, it provides the date and time for when the issue is expected to be resolved. + * + * @return the resolutionETA value + */ + public DateTime resolutionETA() { + return this.resolutionETA; + } + + /** + * Set when the resource's availabilityState is Unavailable and the reasonType is not User Initiated, it provides the date and time for when the issue is expected to be resolved. + * + * @param resolutionETA the resolutionETA value to set + * @return the AvailabilityStatusProperties object itself. + */ + public AvailabilityStatusProperties withResolutionETA(DateTime resolutionETA) { + this.resolutionETA = resolutionETA; + return this; + } + + /** + * Get timestamp for when last change in health status occurred. + * + * @return the occuredTime value + */ + public DateTime occuredTime() { + return this.occuredTime; + } + + /** + * Set timestamp for when last change in health status occurred. + * + * @param occuredTime the occuredTime value to set + * @return the AvailabilityStatusProperties object itself. + */ + public AvailabilityStatusProperties withOccuredTime(DateTime occuredTime) { + this.occuredTime = occuredTime; + return this; + } + + /** + * Get chronicity of the availability transition. Possible values include: 'Transient', 'Persistent'. + * + * @return the reasonChronicity value + */ + public ReasonChronicityTypes reasonChronicity() { + return this.reasonChronicity; + } + + /** + * Set chronicity of the availability transition. Possible values include: 'Transient', 'Persistent'. + * + * @param reasonChronicity the reasonChronicity value to set + * @return the AvailabilityStatusProperties object itself. + */ + public AvailabilityStatusProperties withReasonChronicity(ReasonChronicityTypes reasonChronicity) { + this.reasonChronicity = reasonChronicity; + return this; + } + + /** + * Get timestamp for when the health was last checked. + * + * @return the reportedTime value + */ + public DateTime reportedTime() { + return this.reportedTime; + } + + /** + * Set timestamp for when the health was last checked. + * + * @param reportedTime the reportedTime value to set + * @return the AvailabilityStatusProperties object itself. + */ + public AvailabilityStatusProperties withReportedTime(DateTime reportedTime) { + this.reportedTime = reportedTime; + return this; + } + + /** + * Get an annotation describing a change in the availabilityState to Available from Unavailable with a reasonType of type Unplanned. + * + * @return the recentlyResolvedState value + */ + public AvailabilityStatusPropertiesRecentlyResolvedState recentlyResolvedState() { + return this.recentlyResolvedState; + } + + /** + * Set an annotation describing a change in the availabilityState to Available from Unavailable with a reasonType of type Unplanned. + * + * @param recentlyResolvedState the recentlyResolvedState value to set + * @return the AvailabilityStatusProperties object itself. + */ + public AvailabilityStatusProperties withRecentlyResolvedState(AvailabilityStatusPropertiesRecentlyResolvedState recentlyResolvedState) { + this.recentlyResolvedState = recentlyResolvedState; + return this; + } + + /** + * Get lists actions the user can take based on the current availabilityState of the resource. + * + * @return the recommendedActions value + */ + public List recommendedActions() { + return this.recommendedActions; + } + + /** + * Set lists actions the user can take based on the current availabilityState of the resource. + * + * @param recommendedActions the recommendedActions value to set + * @return the AvailabilityStatusProperties object itself. + */ + public AvailabilityStatusProperties withRecommendedActions(List recommendedActions) { + this.recommendedActions = recommendedActions; + return this; + } + + /** + * Get lists the service impacting events that may be affecting the health of the resource. + * + * @return the serviceImpactingEvents value + */ + public List serviceImpactingEvents() { + return this.serviceImpactingEvents; + } + + /** + * Set lists the service impacting events that may be affecting the health of the resource. + * + * @param serviceImpactingEvents the serviceImpactingEvents value to set + * @return the AvailabilityStatusProperties object itself. + */ + public AvailabilityStatusProperties withServiceImpactingEvents(List serviceImpactingEvents) { + this.serviceImpactingEvents = serviceImpactingEvents; + return this; + } + +} diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/AvailabilityStatusPropertiesRecentlyResolvedState.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/AvailabilityStatusPropertiesRecentlyResolvedState.java new file mode 100644 index 000000000000..c108f135192b --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/AvailabilityStatusPropertiesRecentlyResolvedState.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.resourcehealth.v2017_07_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An annotation describing a change in the availabilityState to Available from + * Unavailable with a reasonType of type Unplanned. + */ +public class AvailabilityStatusPropertiesRecentlyResolvedState { + /** + * Timestamp for when the availabilityState changed to Unavailable. + */ + @JsonProperty(value = "unavailableOccurredTime") + private DateTime unavailableOccurredTime; + + /** + * Timestamp when the availabilityState changes to Available. + */ + @JsonProperty(value = "resolvedTime") + private DateTime resolvedTime; + + /** + * Brief description of cause of the resource becoming unavailable. + */ + @JsonProperty(value = "unavailabilitySummary") + private String unavailabilitySummary; + + /** + * Get timestamp for when the availabilityState changed to Unavailable. + * + * @return the unavailableOccurredTime value + */ + public DateTime unavailableOccurredTime() { + return this.unavailableOccurredTime; + } + + /** + * Set timestamp for when the availabilityState changed to Unavailable. + * + * @param unavailableOccurredTime the unavailableOccurredTime value to set + * @return the AvailabilityStatusPropertiesRecentlyResolvedState object itself. + */ + public AvailabilityStatusPropertiesRecentlyResolvedState withUnavailableOccurredTime(DateTime unavailableOccurredTime) { + this.unavailableOccurredTime = unavailableOccurredTime; + return this; + } + + /** + * Get timestamp when the availabilityState changes to Available. + * + * @return the resolvedTime value + */ + public DateTime resolvedTime() { + return this.resolvedTime; + } + + /** + * Set timestamp when the availabilityState changes to Available. + * + * @param resolvedTime the resolvedTime value to set + * @return the AvailabilityStatusPropertiesRecentlyResolvedState object itself. + */ + public AvailabilityStatusPropertiesRecentlyResolvedState withResolvedTime(DateTime resolvedTime) { + this.resolvedTime = resolvedTime; + return this; + } + + /** + * Get brief description of cause of the resource becoming unavailable. + * + * @return the unavailabilitySummary value + */ + public String unavailabilitySummary() { + return this.unavailabilitySummary; + } + + /** + * Set brief description of cause of the resource becoming unavailable. + * + * @param unavailabilitySummary the unavailabilitySummary value to set + * @return the AvailabilityStatusPropertiesRecentlyResolvedState object itself. + */ + public AvailabilityStatusPropertiesRecentlyResolvedState withUnavailabilitySummary(String unavailabilitySummary) { + this.unavailabilitySummary = unavailabilitySummary; + return this; + } + +} diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/AvailabilityStatuses.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/AvailabilityStatuses.java new file mode 100644 index 000000000000..fe7235e89bea --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/AvailabilityStatuses.java @@ -0,0 +1,39 @@ +/** + * 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.resourcehealth.v2017_07_01; + +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Observable; +import com.microsoft.azure.management.resourcehealth.v2017_07_01.implementation.AvailabilityStatusesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing AvailabilityStatuses. + */ +public interface AvailabilityStatuses extends SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getByResourceAsync(String resourceUri); + + /** + * Lists all historical availability transitions and impacting events for a single resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable list1Async(final String resourceUri); + +} diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/ChildAvailabilityStatuses.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/ChildAvailabilityStatuses.java new file mode 100644 index 000000000000..817d8093166c --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/ChildAvailabilityStatuses.java @@ -0,0 +1,37 @@ +/** + * 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.resourcehealth.v2017_07_01; + +import rx.Observable; +import com.microsoft.azure.management.resourcehealth.v2017_07_01.implementation.ChildAvailabilityStatusesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ChildAvailabilityStatuses. + */ +public interface ChildAvailabilityStatuses extends HasInner { + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getByResourceAsync(String resourceUri); + + /** + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceUri); + +} diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/ChildResources.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/ChildResources.java new file mode 100644 index 000000000000..15f4d3a138ca --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/ChildResources.java @@ -0,0 +1,28 @@ +/** + * 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.resourcehealth.v2017_07_01; + +import rx.Observable; +import com.microsoft.azure.management.resourcehealth.v2017_07_01.implementation.ChildResourcesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ChildResources. + */ +public interface ChildResources extends HasInner { + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the response to get the next page of children current health. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support not nested parent resource type: /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceUri); + +} diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/ErrorResponse.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/ErrorResponse.java new file mode 100644 index 000000000000..ab5cbf59214e --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/ErrorResponse.java @@ -0,0 +1,62 @@ +/** + * 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.resourcehealth.v2017_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error details. + */ +public class ErrorResponse { + /** + * The error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * The error message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * The error details. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private String details; + + /** + * Get the error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get the error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the error details. + * + * @return the details value + */ + public String details() { + return this.details; + } + +} diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/ErrorResponseException.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/ErrorResponseException.java new file mode 100644 index 000000000000..071f9083f77f --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/ErrorResponseException.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.resourcehealth.v2017_07_01; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.body(); + } +} diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/OperationDisplay.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/OperationDisplay.java new file mode 100644 index 000000000000..700bb373e815 --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/OperationDisplay.java @@ -0,0 +1,121 @@ +/** + * 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.resourcehealth.v2017_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the operation. + */ +public class OperationDisplay { + /** + * Provider name. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Resource name. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Operation name. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get provider name. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set provider name. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get resource name. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set resource name. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get operation name. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set operation name. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get description of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the operation. + * + * @param description the description value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/OperationListResult.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/OperationListResult.java new file mode 100644 index 000000000000..6183b5c98bda --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/OperationListResult.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.resourcehealth.v2017_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.resourcehealth.v2017_07_01.implementation.ResourceHealthManager; +import com.microsoft.azure.management.resourcehealth.v2017_07_01.implementation.OperationListResultInner; +import com.microsoft.azure.management.resourcehealth.v2017_07_01.implementation.OperationInner; +import java.util.List; + +/** + * Type representing OperationListResult. + */ +public interface OperationListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/Operations.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/Operations.java new file mode 100644 index 000000000000..ebf0728f0260 --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.resourcehealth.v2017_07_01; + +import rx.Observable; +import com.microsoft.azure.management.resourcehealth.v2017_07_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists available operations for the resourcehealth resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/ReasonChronicityTypes.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/ReasonChronicityTypes.java new file mode 100644 index 000000000000..131bd02d8edc --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/ReasonChronicityTypes.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.resourcehealth.v2017_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ReasonChronicityTypes. + */ +public enum ReasonChronicityTypes { + /** Enum value Transient. */ + TRANSIENT("Transient"), + + /** Enum value Persistent. */ + PERSISTENT("Persistent"); + + /** The actual serialized value for a ReasonChronicityTypes instance. */ + private String value; + + ReasonChronicityTypes(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ReasonChronicityTypes instance. + * + * @param value the serialized value to parse. + * @return the parsed ReasonChronicityTypes object, or null if unable to parse. + */ + @JsonCreator + public static ReasonChronicityTypes fromString(String value) { + ReasonChronicityTypes[] items = ReasonChronicityTypes.values(); + for (ReasonChronicityTypes item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/RecommendedAction.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/RecommendedAction.java new file mode 100644 index 000000000000..1642bc1db3af --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/RecommendedAction.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.resourcehealth.v2017_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Lists actions the user can take based on the current availabilityState of + * the resource. + */ +public class RecommendedAction { + /** + * Recommended action. + */ + @JsonProperty(value = "action") + private String action; + + /** + * Link to the action. + */ + @JsonProperty(value = "actionUrl") + private String actionUrl; + + /** + * Substring of action, it describes which text should host the action url. + */ + @JsonProperty(value = "actionUrlText") + private String actionUrlText; + + /** + * Get recommended action. + * + * @return the action value + */ + public String action() { + return this.action; + } + + /** + * Set recommended action. + * + * @param action the action value to set + * @return the RecommendedAction object itself. + */ + public RecommendedAction withAction(String action) { + this.action = action; + return this; + } + + /** + * Get link to the action. + * + * @return the actionUrl value + */ + public String actionUrl() { + return this.actionUrl; + } + + /** + * Set link to the action. + * + * @param actionUrl the actionUrl value to set + * @return the RecommendedAction object itself. + */ + public RecommendedAction withActionUrl(String actionUrl) { + this.actionUrl = actionUrl; + return this; + } + + /** + * Get substring of action, it describes which text should host the action url. + * + * @return the actionUrlText value + */ + public String actionUrlText() { + return this.actionUrlText; + } + + /** + * Set substring of action, it describes which text should host the action url. + * + * @param actionUrlText the actionUrlText value to set + * @return the RecommendedAction object itself. + */ + public RecommendedAction withActionUrlText(String actionUrlText) { + this.actionUrlText = actionUrlText; + return this; + } + +} diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/ServiceImpactingEvent.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/ServiceImpactingEvent.java new file mode 100644 index 000000000000..fe201e715afb --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/ServiceImpactingEvent.java @@ -0,0 +1,149 @@ +/** + * 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.resourcehealth.v2017_07_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Lists the service impacting events that may be affecting the health of the + * resource. + */ +public class ServiceImpactingEvent { + /** + * Timestamp for when the event started. + */ + @JsonProperty(value = "eventStartTime") + private DateTime eventStartTime; + + /** + * Timestamp for when event was submitted/detected. + */ + @JsonProperty(value = "eventStatusLastModifiedTime") + private DateTime eventStatusLastModifiedTime; + + /** + * Correlation id for the event. + */ + @JsonProperty(value = "correlationId") + private String correlationId; + + /** + * Status of the service impacting event. + */ + @JsonProperty(value = "status") + private ServiceImpactingEventStatus status; + + /** + * Properties of the service impacting event. + */ + @JsonProperty(value = "incidentProperties") + private ServiceImpactingEventIncidentProperties incidentProperties; + + /** + * Get timestamp for when the event started. + * + * @return the eventStartTime value + */ + public DateTime eventStartTime() { + return this.eventStartTime; + } + + /** + * Set timestamp for when the event started. + * + * @param eventStartTime the eventStartTime value to set + * @return the ServiceImpactingEvent object itself. + */ + public ServiceImpactingEvent withEventStartTime(DateTime eventStartTime) { + this.eventStartTime = eventStartTime; + return this; + } + + /** + * Get timestamp for when event was submitted/detected. + * + * @return the eventStatusLastModifiedTime value + */ + public DateTime eventStatusLastModifiedTime() { + return this.eventStatusLastModifiedTime; + } + + /** + * Set timestamp for when event was submitted/detected. + * + * @param eventStatusLastModifiedTime the eventStatusLastModifiedTime value to set + * @return the ServiceImpactingEvent object itself. + */ + public ServiceImpactingEvent withEventStatusLastModifiedTime(DateTime eventStatusLastModifiedTime) { + this.eventStatusLastModifiedTime = eventStatusLastModifiedTime; + return this; + } + + /** + * Get correlation id for the event. + * + * @return the correlationId value + */ + public String correlationId() { + return this.correlationId; + } + + /** + * Set correlation id for the event. + * + * @param correlationId the correlationId value to set + * @return the ServiceImpactingEvent object itself. + */ + public ServiceImpactingEvent withCorrelationId(String correlationId) { + this.correlationId = correlationId; + return this; + } + + /** + * Get status of the service impacting event. + * + * @return the status value + */ + public ServiceImpactingEventStatus status() { + return this.status; + } + + /** + * Set status of the service impacting event. + * + * @param status the status value to set + * @return the ServiceImpactingEvent object itself. + */ + public ServiceImpactingEvent withStatus(ServiceImpactingEventStatus status) { + this.status = status; + return this; + } + + /** + * Get properties of the service impacting event. + * + * @return the incidentProperties value + */ + public ServiceImpactingEventIncidentProperties incidentProperties() { + return this.incidentProperties; + } + + /** + * Set properties of the service impacting event. + * + * @param incidentProperties the incidentProperties value to set + * @return the ServiceImpactingEvent object itself. + */ + public ServiceImpactingEvent withIncidentProperties(ServiceImpactingEventIncidentProperties incidentProperties) { + this.incidentProperties = incidentProperties; + return this; + } + +} diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/ServiceImpactingEventIncidentProperties.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/ServiceImpactingEventIncidentProperties.java new file mode 100644 index 000000000000..f18d41860d7f --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/ServiceImpactingEventIncidentProperties.java @@ -0,0 +1,121 @@ +/** + * 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.resourcehealth.v2017_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the service impacting event. + */ +public class ServiceImpactingEventIncidentProperties { + /** + * Title of the incident. + */ + @JsonProperty(value = "title") + private String title; + + /** + * Service impacted by the event. + */ + @JsonProperty(value = "service") + private String service; + + /** + * Region impacted by the event. + */ + @JsonProperty(value = "region") + private String region; + + /** + * Type of Event. + */ + @JsonProperty(value = "incidentType") + private String incidentType; + + /** + * Get title of the incident. + * + * @return the title value + */ + public String title() { + return this.title; + } + + /** + * Set title of the incident. + * + * @param title the title value to set + * @return the ServiceImpactingEventIncidentProperties object itself. + */ + public ServiceImpactingEventIncidentProperties withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get service impacted by the event. + * + * @return the service value + */ + public String service() { + return this.service; + } + + /** + * Set service impacted by the event. + * + * @param service the service value to set + * @return the ServiceImpactingEventIncidentProperties object itself. + */ + public ServiceImpactingEventIncidentProperties withService(String service) { + this.service = service; + return this; + } + + /** + * Get region impacted by the event. + * + * @return the region value + */ + public String region() { + return this.region; + } + + /** + * Set region impacted by the event. + * + * @param region the region value to set + * @return the ServiceImpactingEventIncidentProperties object itself. + */ + public ServiceImpactingEventIncidentProperties withRegion(String region) { + this.region = region; + return this; + } + + /** + * Get type of Event. + * + * @return the incidentType value + */ + public String incidentType() { + return this.incidentType; + } + + /** + * Set type of Event. + * + * @param incidentType the incidentType value to set + * @return the ServiceImpactingEventIncidentProperties object itself. + */ + public ServiceImpactingEventIncidentProperties withIncidentType(String incidentType) { + this.incidentType = incidentType; + return this; + } + +} diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/ServiceImpactingEventStatus.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/ServiceImpactingEventStatus.java new file mode 100644 index 000000000000..4ced39ff7de1 --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/ServiceImpactingEventStatus.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.resourcehealth.v2017_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Status of the service impacting event. + */ +public class ServiceImpactingEventStatus { + /** + * Current status of the event. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get current status of the event. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set current status of the event. + * + * @param value the value value to set + * @return the ServiceImpactingEventStatus object itself. + */ + public ServiceImpactingEventStatus withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/AvailabilityStatusImpl.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/AvailabilityStatusImpl.java new file mode 100644 index 000000000000..79d067abf426 --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/AvailabilityStatusImpl.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.resourcehealth.v2017_07_01.implementation; + +import com.microsoft.azure.management.resourcehealth.v2017_07_01.AvailabilityStatus; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.resourcehealth.v2017_07_01.AvailabilityStatusProperties; + +class AvailabilityStatusImpl extends WrapperImpl implements AvailabilityStatus { + private final ResourceHealthManager manager; + + AvailabilityStatusImpl(AvailabilityStatusInner inner, ResourceHealthManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ResourceHealthManager manager() { + return this.manager; + } + + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public AvailabilityStatusProperties properties() { + return this.inner().properties(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/AvailabilityStatusInner.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/AvailabilityStatusInner.java new file mode 100644 index 000000000000..fe75b832ff34 --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/AvailabilityStatusInner.java @@ -0,0 +1,148 @@ +/** + * 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.resourcehealth.v2017_07_01.implementation; + +import com.microsoft.azure.management.resourcehealth.v2017_07_01.AvailabilityStatusProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * availabilityStatus of a resource. + */ +public class AvailabilityStatusInner { + /** + * Azure Resource Manager Identity for the availabilityStatuses resource. + */ + @JsonProperty(value = "id") + private String id; + + /** + * current. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Microsoft.ResourceHealth/AvailabilityStatuses. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Azure Resource Manager geo location of the resource. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Properties of availability state. + */ + @JsonProperty(value = "properties") + private AvailabilityStatusProperties properties; + + /** + * Get azure Resource Manager Identity for the availabilityStatuses resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set azure Resource Manager Identity for the availabilityStatuses resource. + * + * @param id the id value to set + * @return the AvailabilityStatusInner object itself. + */ + public AvailabilityStatusInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get current. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set current. + * + * @param name the name value to set + * @return the AvailabilityStatusInner object itself. + */ + public AvailabilityStatusInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get microsoft.ResourceHealth/AvailabilityStatuses. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set microsoft.ResourceHealth/AvailabilityStatuses. + * + * @param type the type value to set + * @return the AvailabilityStatusInner object itself. + */ + public AvailabilityStatusInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get azure Resource Manager geo location of the resource. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set azure Resource Manager geo location of the resource. + * + * @param location the location value to set + * @return the AvailabilityStatusInner object itself. + */ + public AvailabilityStatusInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get properties of availability state. + * + * @return the properties value + */ + public AvailabilityStatusProperties properties() { + return this.properties; + } + + /** + * Set properties of availability state. + * + * @param properties the properties value to set + * @return the AvailabilityStatusInner object itself. + */ + public AvailabilityStatusInner withProperties(AvailabilityStatusProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/AvailabilityStatusesImpl.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/AvailabilityStatusesImpl.java new file mode 100644 index 000000000000..6e66d0d4f854 --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/AvailabilityStatusesImpl.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * jkl + */ + +package com.microsoft.azure.management.resourcehealth.v2017_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.resourcehealth.v2017_07_01.AvailabilityStatuses; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.resourcehealth.v2017_07_01.AvailabilityStatus; +import com.microsoft.azure.arm.utils.PagedListConverter; + +class AvailabilityStatusesImpl extends WrapperImpl implements AvailabilityStatuses { + private PagedListConverter converter; + private final ResourceHealthManager manager; + + AvailabilityStatusesImpl(ResourceHealthManager manager) { + super(manager.inner().availabilityStatuses()); + this.manager = manager; + this.converter = new PagedListConverter() { + @Override + public Observable typeConvertAsync(AvailabilityStatusInner inner) { + return Observable.just((AvailabilityStatus) wrapModel(inner)); + } + }; + } + + public ResourceHealthManager manager() { + return this.manager; + } + + private AvailabilityStatusImpl wrapModel(AvailabilityStatusInner inner) { + return new AvailabilityStatusImpl(inner, manager()); + } + + @Override + public Observable getByResourceAsync(String resourceUri) { + AvailabilityStatusesInner client = this.inner(); + return client.getByResourceAsync(resourceUri) + .map(new Func1() { + @Override + public AvailabilityStatus call(AvailabilityStatusInner inner) { + return new AvailabilityStatusImpl(inner, manager()); + } + }); + } + + @Override + public Observable list1Async(final String resourceUri) { + AvailabilityStatusesInner client = this.inner(); + return client.list1Async(resourceUri) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public AvailabilityStatus call(AvailabilityStatusInner inner) { + return new AvailabilityStatusImpl(inner, manager()); + } + }); + } + + @Override + public PagedList list() { + AvailabilityStatusesInner client = this.inner(); + return converter.convert(client.list()); + } + + @Override + public Observable listAsync() { + AvailabilityStatusesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public AvailabilityStatus call(AvailabilityStatusInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + AvailabilityStatusesInner client = this.inner(); + return converter.convert(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + AvailabilityStatusesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public AvailabilityStatus call(AvailabilityStatusInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/AvailabilityStatusesInner.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/AvailabilityStatusesInner.java new file mode 100644 index 000000000000..5684dfdd9f38 --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/AvailabilityStatusesInner.java @@ -0,0 +1,1262 @@ +/** + * 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.resourcehealth.v2017_07_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.resourcehealth.v2017_07_01.ErrorResponseException; +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.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in AvailabilityStatuses. + */ +public class AvailabilityStatusesInner implements InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private AvailabilityStatusesService service; + /** The service client containing this operation class. */ + private MicrosoftResourceHealthImpl client; + + /** + * Initializes an instance of AvailabilityStatusesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AvailabilityStatusesInner(Retrofit retrofit, MicrosoftResourceHealthImpl client) { + this.service = retrofit.create(AvailabilityStatusesService.class); + this.client = client; + } + + /** + * The interface defining all the services for AvailabilityStatuses to be + * used by Retrofit to perform actually REST calls. + */ + interface AvailabilityStatusesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resourcehealth.v2017_07_01.AvailabilityStatuses list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/availabilityStatuses") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$expand") String expand, @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.resourcehealth.v2017_07_01.AvailabilityStatuses listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceHealth/availabilityStatuses") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$expand") String expand, @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.resourcehealth.v2017_07_01.AvailabilityStatuses getByResource" }) + @GET("{resourceUri}/providers/Microsoft.ResourceHealth/availabilityStatuses/current") + Observable> getByResource(@Path(value = "resourceUri", encoded = true) String resourceUri, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$expand") String expand, @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.resourcehealth.v2017_07_01.AvailabilityStatuses list1" }) + @GET("{resourceUri}/providers/Microsoft.ResourceHealth/availabilityStatuses") + Observable> list1(@Path(value = "resourceUri", encoded = true) String resourceUri, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$expand") String expand, @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.resourcehealth.v2017_07_01.AvailabilityStatuses listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @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.resourcehealth.v2017_07_01.AvailabilityStatuses listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @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.resourcehealth.v2017_07_01.AvailabilityStatuses list1Next" }) + @GET + Observable> list1Next(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the response to get the next page of availability statuses. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailabilityStatusInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the response to get the next page of availability statuses. + * + * @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 ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the response to get the next page of availability statuses. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the response to get the next page of availability statuses. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the response to get the next page of availability statuses. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailabilityStatusInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + 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."); + } + final String filter = null; + final String expand = null; + return service.list(this.client.subscriptionId(), this.client.apiVersion(), filter, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailabilityStatusInner> object if successful. + */ + public PagedList list(final String filter, final String expand) { + ServiceResponse> response = listSinglePageAsync(filter, expand).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @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 String filter, final String expand, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(filter, expand), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable> listAsync(final String filter, final String expand) { + return listWithServiceResponseAsync(filter, expand) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable>> listWithServiceResponseAsync(final String filter, final String expand) { + return listSinglePageAsync(filter, expand) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the response to get the next page of availability statuses. + * + ServiceResponse> * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + ServiceResponse> * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailabilityStatusInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String filter, final String expand) { + 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(), filter, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailabilityStatusInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param resourceGroupName The name of the resource group. + * @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> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailabilityStatusInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final 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."); + } + final String filter = null; + final String expand = null; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), filter, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param resourceGroupName The name of the resource group. + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailabilityStatusInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName, final String filter, final String expand) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param resourceGroupName The name of the resource group. + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @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> listByResourceGroupAsync(final String resourceGroupName, final String filter, final String expand, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param resourceGroupName The name of the resource group. + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName, final String filter, final String expand) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName, filter, expand) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param resourceGroupName The name of the resource group. + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String filter, final String expand) { + return listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in the response to get the next page of availability statuses. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + ServiceResponse> * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailabilityStatusInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName, final String filter, final String expand) { + 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(), filter, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AvailabilityStatusInner object if successful. + */ + public AvailabilityStatusInner getByResource(String resourceUri) { + return getByResourceWithServiceResponseAsync(resourceUri).toBlocking().single().body(); + } + + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @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 getByResourceAsync(String resourceUri, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceWithServiceResponseAsync(resourceUri), serviceCallback); + } + + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AvailabilityStatusInner object + */ + public Observable getByResourceAsync(String resourceUri) { + return getByResourceWithServiceResponseAsync(resourceUri).map(new Func1, AvailabilityStatusInner>() { + @Override + public AvailabilityStatusInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AvailabilityStatusInner object + */ + public Observable> getByResourceWithServiceResponseAsync(String resourceUri) { + if (resourceUri == null) { + throw new IllegalArgumentException("Parameter resourceUri 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 String filter = null; + final String expand = null; + return service.getByResource(resourceUri, this.client.apiVersion(), filter, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AvailabilityStatusInner object if successful. + */ + public AvailabilityStatusInner getByResource(String resourceUri, String filter, String expand) { + return getByResourceWithServiceResponseAsync(resourceUri, filter, expand).toBlocking().single().body(); + } + + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @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 getByResourceAsync(String resourceUri, String filter, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceWithServiceResponseAsync(resourceUri, filter, expand), serviceCallback); + } + + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AvailabilityStatusInner object + */ + public Observable getByResourceAsync(String resourceUri, String filter, String expand) { + return getByResourceWithServiceResponseAsync(resourceUri, filter, expand).map(new Func1, AvailabilityStatusInner>() { + @Override + public AvailabilityStatusInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AvailabilityStatusInner object + */ + public Observable> getByResourceWithServiceResponseAsync(String resourceUri, String filter, String expand) { + if (resourceUri == null) { + throw new IllegalArgumentException("Parameter resourceUri 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.getByResource(resourceUri, this.client.apiVersion(), filter, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all historical availability transitions and impacting events for a single resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailabilityStatusInner> object if successful. + */ + public PagedList list1(final String resourceUri) { + ServiceResponse> response = list1SinglePageAsync(resourceUri).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return list1NextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all historical availability transitions and impacting events for a single resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @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> list1Async(final String resourceUri, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + list1SinglePageAsync(resourceUri), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return list1NextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all historical availability transitions and impacting events for a single resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable> list1Async(final String resourceUri) { + return list1WithServiceResponseAsync(resourceUri) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all historical availability transitions and impacting events for a single resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable>> list1WithServiceResponseAsync(final String resourceUri) { + return list1SinglePageAsync(resourceUri) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(list1NextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all historical availability transitions and impacting events for a single resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailabilityStatusInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> list1SinglePageAsync(final String resourceUri) { + if (resourceUri == null) { + throw new IllegalArgumentException("Parameter resourceUri 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 String filter = null; + final String expand = null; + return service.list1(resourceUri, this.client.apiVersion(), filter, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = list1Delegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists all historical availability transitions and impacting events for a single resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailabilityStatusInner> object if successful. + */ + public PagedList list1(final String resourceUri, final String filter, final String expand) { + ServiceResponse> response = list1SinglePageAsync(resourceUri, filter, expand).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return list1NextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all historical availability transitions and impacting events for a single resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @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> list1Async(final String resourceUri, final String filter, final String expand, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + list1SinglePageAsync(resourceUri, filter, expand), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return list1NextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all historical availability transitions and impacting events for a single resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable> list1Async(final String resourceUri, final String filter, final String expand) { + return list1WithServiceResponseAsync(resourceUri, filter, expand) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all historical availability transitions and impacting events for a single resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable>> list1WithServiceResponseAsync(final String resourceUri, final String filter, final String expand) { + return list1SinglePageAsync(resourceUri, filter, expand) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(list1NextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all historical availability transitions and impacting events for a single resource. Use the nextLink property in the response to get the next page of availability status. + * + ServiceResponse> * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API support not nested and one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} and /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + ServiceResponse> * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + ServiceResponse> * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailabilityStatusInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> list1SinglePageAsync(final String resourceUri, final String filter, final String expand) { + if (resourceUri == null) { + throw new IllegalArgumentException("Parameter resourceUri 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.list1(resourceUri, this.client.apiVersion(), filter, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = list1Delegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> list1Delegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailabilityStatusInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the response to get the next page of availability statuses. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailabilityStatusInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailabilityStatusInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in the response to get the next page of availability statuses. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in the response to get the next page of availability statuses. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailabilityStatusInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all historical availability transitions and impacting events for a single resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailabilityStatusInner> object if successful. + */ + public PagedList list1Next(final String nextPageLink) { + ServiceResponse> response = list1NextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return list1NextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all historical availability transitions and impacting events for a single resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> list1NextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + list1NextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return list1NextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all historical availability transitions and impacting events for a single resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable> list1NextAsync(final String nextPageLink) { + return list1NextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all historical availability transitions and impacting events for a single resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable>> list1NextWithServiceResponseAsync(final String nextPageLink) { + return list1NextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(list1NextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all historical availability transitions and impacting events for a single resource. Use the nextLink property in the response to get the next page of availability status. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailabilityStatusInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> list1NextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.list1Next(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = list1NextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> list1NextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/ChildAvailabilityStatusesImpl.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/ChildAvailabilityStatusesImpl.java new file mode 100644 index 000000000000..1e9fe63ba1ec --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/ChildAvailabilityStatusesImpl.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.resourcehealth.v2017_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.resourcehealth.v2017_07_01.ChildAvailabilityStatuses; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.resourcehealth.v2017_07_01.AvailabilityStatus; + +class ChildAvailabilityStatusesImpl extends WrapperImpl implements ChildAvailabilityStatuses { + private final ResourceHealthManager manager; + + ChildAvailabilityStatusesImpl(ResourceHealthManager manager) { + super(manager.inner().childAvailabilityStatuses()); + this.manager = manager; + } + + public ResourceHealthManager manager() { + return this.manager; + } + + @Override + public Observable getByResourceAsync(String resourceUri) { + ChildAvailabilityStatusesInner client = this.inner(); + return client.getByResourceAsync(resourceUri) + .map(new Func1() { + @Override + public AvailabilityStatus call(AvailabilityStatusInner inner) { + return new AvailabilityStatusImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String resourceUri) { + ChildAvailabilityStatusesInner client = this.inner(); + return client.listAsync(resourceUri) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public AvailabilityStatus call(AvailabilityStatusInner inner) { + return new AvailabilityStatusImpl(inner, manager()); + } + }); + } + +} diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/ChildAvailabilityStatusesInner.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/ChildAvailabilityStatusesInner.java new file mode 100644 index 000000000000..fe6588c2215f --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/ChildAvailabilityStatusesInner.java @@ -0,0 +1,569 @@ +/** + * 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.resourcehealth.v2017_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.resourcehealth.v2017_07_01.ErrorResponseException; +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.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ChildAvailabilityStatuses. + */ +public class ChildAvailabilityStatusesInner { + /** The Retrofit service to perform REST calls. */ + private ChildAvailabilityStatusesService service; + /** The service client containing this operation class. */ + private MicrosoftResourceHealthImpl client; + + /** + * Initializes an instance of ChildAvailabilityStatusesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ChildAvailabilityStatusesInner(Retrofit retrofit, MicrosoftResourceHealthImpl client) { + this.service = retrofit.create(ChildAvailabilityStatusesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ChildAvailabilityStatuses to be + * used by Retrofit to perform actually REST calls. + */ + interface ChildAvailabilityStatusesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resourcehealth.v2017_07_01.ChildAvailabilityStatuses getByResource" }) + @GET("{resourceUri}/providers/Microsoft.ResourceHealth/childAvailabilityStatuses/current") + Observable> getByResource(@Path(value = "resourceUri", encoded = true) String resourceUri, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$expand") String expand, @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.resourcehealth.v2017_07_01.ChildAvailabilityStatuses list" }) + @GET("{resourceUri}/providers/Microsoft.ResourceHealth/childAvailabilityStatuses") + Observable> list(@Path(value = "resourceUri", encoded = true) String resourceUri, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$expand") String expand, @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.resourcehealth.v2017_07_01.ChildAvailabilityStatuses listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AvailabilityStatusInner object if successful. + */ + public AvailabilityStatusInner getByResource(String resourceUri) { + return getByResourceWithServiceResponseAsync(resourceUri).toBlocking().single().body(); + } + + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @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 getByResourceAsync(String resourceUri, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceWithServiceResponseAsync(resourceUri), serviceCallback); + } + + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AvailabilityStatusInner object + */ + public Observable getByResourceAsync(String resourceUri) { + return getByResourceWithServiceResponseAsync(resourceUri).map(new Func1, AvailabilityStatusInner>() { + @Override + public AvailabilityStatusInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AvailabilityStatusInner object + */ + public Observable> getByResourceWithServiceResponseAsync(String resourceUri) { + if (resourceUri == null) { + throw new IllegalArgumentException("Parameter resourceUri 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 String filter = null; + final String expand = null; + return service.getByResource(resourceUri, this.client.apiVersion(), filter, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AvailabilityStatusInner object if successful. + */ + public AvailabilityStatusInner getByResource(String resourceUri, String filter, String expand) { + return getByResourceWithServiceResponseAsync(resourceUri, filter, expand).toBlocking().single().body(); + } + + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @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 getByResourceAsync(String resourceUri, String filter, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceWithServiceResponseAsync(resourceUri, filter, expand), serviceCallback); + } + + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AvailabilityStatusInner object + */ + public Observable getByResourceAsync(String resourceUri, String filter, String expand) { + return getByResourceWithServiceResponseAsync(resourceUri, filter, expand).map(new Func1, AvailabilityStatusInner>() { + @Override + public AvailabilityStatusInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AvailabilityStatusInner object + */ + public Observable> getByResourceWithServiceResponseAsync(String resourceUri, String filter, String expand) { + if (resourceUri == null) { + throw new IllegalArgumentException("Parameter resourceUri 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.getByResource(resourceUri, this.client.apiVersion(), filter, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailabilityStatusInner> object if successful. + */ + public PagedList list(final String resourceUri) { + ServiceResponse> response = listSinglePageAsync(resourceUri).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @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 String resourceUri, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceUri), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable> listAsync(final String resourceUri) { + return listWithServiceResponseAsync(resourceUri) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceUri) { + return listSinglePageAsync(resourceUri) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailabilityStatusInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceUri) { + if (resourceUri == null) { + throw new IllegalArgumentException("Parameter resourceUri 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 String filter = null; + final String expand = null; + return service.list(resourceUri, this.client.apiVersion(), filter, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailabilityStatusInner> object if successful. + */ + public PagedList list(final String resourceUri, final String filter, final String expand) { + ServiceResponse> response = listSinglePageAsync(resourceUri, filter, expand).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @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 String resourceUri, final String filter, final String expand, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceUri, filter, expand), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable> listAsync(final String resourceUri, final String filter, final String expand) { + return listWithServiceResponseAsync(resourceUri, filter, expand) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceUri, final String filter, final String expand) { + return listSinglePageAsync(resourceUri, filter, expand) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response to get the next page of availability status. + * + ServiceResponse> * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support one nesting level resource types : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + ServiceResponse> * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + ServiceResponse> * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailabilityStatusInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceUri, final String filter, final String expand) { + if (resourceUri == null) { + throw new IllegalArgumentException("Parameter resourceUri 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(resourceUri, this.client.apiVersion(), filter, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailabilityStatusInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response to get the next page of availability status. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response to get the next page of availability status. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailabilityStatusInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/ChildResourcesImpl.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/ChildResourcesImpl.java new file mode 100644 index 000000000000..9225515a48be --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/ChildResourcesImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.resourcehealth.v2017_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.resourcehealth.v2017_07_01.ChildResources; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.resourcehealth.v2017_07_01.AvailabilityStatus; + +class ChildResourcesImpl extends WrapperImpl implements ChildResources { + private final ResourceHealthManager manager; + + ChildResourcesImpl(ResourceHealthManager manager) { + super(manager.inner().childResources()); + this.manager = manager; + } + + public ResourceHealthManager manager() { + return this.manager; + } + + @Override + public Observable listAsync(final String resourceUri) { + ChildResourcesInner client = this.inner(); + return client.listAsync(resourceUri) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public AvailabilityStatus call(AvailabilityStatusInner inner) { + return new AvailabilityStatusImpl(inner, manager()); + } + }); + } + +} diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/ChildResourcesInner.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/ChildResourcesInner.java new file mode 100644 index 000000000000..c39c6f3b6457 --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/ChildResourcesInner.java @@ -0,0 +1,409 @@ +/** + * 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.resourcehealth.v2017_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.resourcehealth.v2017_07_01.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +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.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ChildResources. + */ +public class ChildResourcesInner { + /** The Retrofit service to perform REST calls. */ + private ChildResourcesService service; + /** The service client containing this operation class. */ + private MicrosoftResourceHealthImpl client; + + /** + * Initializes an instance of ChildResourcesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ChildResourcesInner(Retrofit retrofit, MicrosoftResourceHealthImpl client) { + this.service = retrofit.create(ChildResourcesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ChildResources to be + * used by Retrofit to perform actually REST calls. + */ + interface ChildResourcesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resourcehealth.v2017_07_01.ChildResources list" }) + @GET("{resourceUri}/providers/Microsoft.ResourceHealth/childResources") + Observable> list(@Path(value = "resourceUri", encoded = true) String resourceUri, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$expand") String expand, @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.resourcehealth.v2017_07_01.ChildResources listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the response to get the next page of children current health. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support not nested parent resource type: /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailabilityStatusInner> object if successful. + */ + public PagedList list(final String resourceUri) { + ServiceResponse> response = listSinglePageAsync(resourceUri).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the response to get the next page of children current health. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support not nested parent resource type: /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-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> listAsync(final String resourceUri, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceUri), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the response to get the next page of children current health. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support not nested parent resource type: /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable> listAsync(final String resourceUri) { + return listWithServiceResponseAsync(resourceUri) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the response to get the next page of children current health. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support not nested parent resource type: /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceUri) { + return listSinglePageAsync(resourceUri) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the response to get the next page of children current health. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support not nested parent resource type: /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailabilityStatusInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceUri) { + if (resourceUri == null) { + throw new IllegalArgumentException("Parameter resourceUri 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 String filter = null; + final String expand = null; + return service.list(resourceUri, this.client.apiVersion(), filter, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the response to get the next page of children current health. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support not nested parent resource type: /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailabilityStatusInner> object if successful. + */ + public PagedList list(final String resourceUri, final String filter, final String expand) { + ServiceResponse> response = listSinglePageAsync(resourceUri, filter, expand).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the response to get the next page of children current health. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support not nested parent resource type: /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @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 String resourceUri, final String filter, final String expand, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceUri, filter, expand), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the response to get the next page of children current health. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support not nested parent resource type: /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable> listAsync(final String resourceUri, final String filter, final String expand) { + return listWithServiceResponseAsync(resourceUri, filter, expand) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the response to get the next page of children current health. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support not nested parent resource type: /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} + * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceUri, final String filter, final String expand) { + return listSinglePageAsync(resourceUri, filter, expand) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the response to get the next page of children current health. + * + ServiceResponse> * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. Currently the API only support not nested parent resource type: /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} + ServiceResponse> * @param filter The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN + ServiceResponse> * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailabilityStatusInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceUri, final String filter, final String expand) { + if (resourceUri == null) { + throw new IllegalArgumentException("Parameter resourceUri 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(resourceUri, this.client.apiVersion(), filter, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the response to get the next page of children current health. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AvailabilityStatusInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the response to get the next page of children current health. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the response to get the next page of children current health. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the response to get the next page of children current health. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailabilityStatusInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the response to get the next page of children current health. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailabilityStatusInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/IdParsingUtils.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..55f2df46fe84 --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/IdParsingUtils.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.resourcehealth.v2017_07_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/MicrosoftResourceHealthImpl.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/MicrosoftResourceHealthImpl.java new file mode 100644 index 000000000000..f3d6b06076f4 --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/MicrosoftResourceHealthImpl.java @@ -0,0 +1,238 @@ +/** + * 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.resourcehealth.v2017_07_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the MicrosoftResourceHealthImpl class. + */ +public class MicrosoftResourceHealthImpl extends AzureServiceClient { + /** 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 credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public MicrosoftResourceHealthImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client Api Version. */ + private String apiVersion; + + /** + * Gets Client 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 MicrosoftResourceHealthImpl 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 MicrosoftResourceHealthImpl 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 MicrosoftResourceHealthImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The AvailabilityStatusesInner object to access its operations. + */ + private AvailabilityStatusesInner availabilityStatuses; + + /** + * Gets the AvailabilityStatusesInner object to access its operations. + * @return the AvailabilityStatusesInner object. + */ + public AvailabilityStatusesInner availabilityStatuses() { + return this.availabilityStatuses; + } + + /** + * The ChildAvailabilityStatusesInner object to access its operations. + */ + private ChildAvailabilityStatusesInner childAvailabilityStatuses; + + /** + * Gets the ChildAvailabilityStatusesInner object to access its operations. + * @return the ChildAvailabilityStatusesInner object. + */ + public ChildAvailabilityStatusesInner childAvailabilityStatuses() { + return this.childAvailabilityStatuses; + } + + /** + * The ChildResourcesInner object to access its operations. + */ + private ChildResourcesInner childResources; + + /** + * Gets the ChildResourcesInner object to access its operations. + * @return the ChildResourcesInner object. + */ + public ChildResourcesInner childResources() { + return this.childResources; + } + + /** + * 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; + } + + /** + * Initializes an instance of MicrosoftResourceHealth client. + * + * @param credentials the management credentials for Azure + */ + public MicrosoftResourceHealthImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of MicrosoftResourceHealth client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public MicrosoftResourceHealthImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of MicrosoftResourceHealth client. + * + * @param restClient the REST client to connect to Azure. + */ + public MicrosoftResourceHealthImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2017-07-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.availabilityStatuses = new AvailabilityStatusesInner(restClient().retrofit(), this); + this.childAvailabilityStatuses = new ChildAvailabilityStatusesInner(restClient().retrofit(), this); + this.childResources = new ChildResourcesInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * 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(), "MicrosoftResourceHealth", "2017-07-01"); + } +} diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/OperationInner.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/OperationInner.java new file mode 100644 index 000000000000..df43ff2cc7b1 --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/OperationInner.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.resourcehealth.v2017_07_01.implementation; + +import com.microsoft.azure.management.resourcehealth.v2017_07_01.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Operation available in the resourcehealth resource provider. + */ +public class OperationInner { + /** + * Name of the operation. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Properties of the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Get name of the operation. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the operation. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get properties of the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set properties of the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + +} diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/OperationListResultImpl.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/OperationListResultImpl.java new file mode 100644 index 000000000000..50e59c4cf7bc --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/OperationListResultImpl.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.resourcehealth.v2017_07_01.implementation; + +import com.microsoft.azure.management.resourcehealth.v2017_07_01.OperationListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class OperationListResultImpl extends WrapperImpl implements OperationListResult { + private final ResourceHealthManager manager; + OperationListResultImpl(OperationListResultInner inner, ResourceHealthManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ResourceHealthManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/OperationListResultInner.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/OperationListResultInner.java new file mode 100644 index 000000000000..a817fed9058a --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/OperationListResultInner.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.resourcehealth.v2017_07_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Lists the operations response. + */ +public class OperationListResultInner { + /** + * List of operations available in the resourcehealth resource provider. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get list of operations available in the resourcehealth resource provider. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set list of operations available in the resourcehealth resource provider. + * + * @param value the value value to set + * @return the OperationListResultInner object itself. + */ + public OperationListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/OperationsImpl.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/OperationsImpl.java new file mode 100644 index 000000000000..9a3851f2f4ae --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/OperationsImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.resourcehealth.v2017_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.resourcehealth.v2017_07_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.resourcehealth.v2017_07_01.OperationListResult; + +class OperationsImpl extends WrapperImpl implements Operations { + private final ResourceHealthManager manager; + + OperationsImpl(ResourceHealthManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public ResourceHealthManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .map(new Func1() { + @Override + public OperationListResult call(OperationListResultInner inner) { + return new OperationListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/OperationsInner.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/OperationsInner.java new file mode 100644 index 000000000000..82cad93ce296 --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/OperationsInner.java @@ -0,0 +1,128 @@ +/** + * 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.resourcehealth.v2017_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.resourcehealth.v2017_07_01.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.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 MicrosoftResourceHealthImpl 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, MicrosoftResourceHealthImpl 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.resourcehealth.v2017_07_01.Operations list" }) + @GET("providers/Microsoft.ResourceHealth/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists available operations for the resourcehealth resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OperationListResultInner object if successful. + */ + public OperationListResultInner list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Lists available operations for the resourcehealth resource provider. + * + * @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); + } + + /** + * Lists available operations for the resourcehealth resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListResultInner object + */ + public Observable listAsync() { + return listWithServiceResponseAsync().map(new Func1, OperationListResultInner>() { + @Override + public OperationListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists available operations for the resourcehealth resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListResultInner 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 clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/PageImpl.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/PageImpl.java new file mode 100644 index 000000000000..3c7c61850df5 --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/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.resourcehealth.v2017_07_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 PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + 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/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/ResourceHealthManager.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/ResourceHealthManager.java new file mode 100644 index 000000000000..f858b21a80e8 --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/ResourceHealthManager.java @@ -0,0 +1,135 @@ +/** + * 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.resourcehealth.v2017_07_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.resourcehealth.v2017_07_01.AvailabilityStatuses; +import com.microsoft.azure.management.resourcehealth.v2017_07_01.ChildAvailabilityStatuses; +import com.microsoft.azure.management.resourcehealth.v2017_07_01.ChildResources; +import com.microsoft.azure.management.resourcehealth.v2017_07_01.Operations; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure ResourceHealth resource management. + */ +public final class ResourceHealthManager extends ManagerCore { + private AvailabilityStatuses availabilityStatuses; + private ChildAvailabilityStatuses childAvailabilityStatuses; + private ChildResources childResources; + private Operations operations; + /** + * Get a Configurable instance that can be used to create ResourceHealthManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new ResourceHealthManager.ConfigurableImpl(); + } + /** + * Creates an instance of ResourceHealthManager that exposes ResourceHealth resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the ResourceHealthManager + */ + public static ResourceHealthManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new ResourceHealthManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of ResourceHealthManager that exposes ResourceHealth resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the ResourceHealthManager + */ + public static ResourceHealthManager authenticate(RestClient restClient, String subscriptionId) { + return new ResourceHealthManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of ResourceHealthManager that exposes ResourceHealth management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing ResourceHealth management API entry points that work across subscriptions + */ + ResourceHealthManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage AvailabilityStatuses. + */ + public AvailabilityStatuses availabilityStatuses() { + if (this.availabilityStatuses == null) { + this.availabilityStatuses = new AvailabilityStatusesImpl(this); + } + return this.availabilityStatuses; + } + + /** + * @return Entry point to manage ChildAvailabilityStatuses. + */ + public ChildAvailabilityStatuses childAvailabilityStatuses() { + if (this.childAvailabilityStatuses == null) { + this.childAvailabilityStatuses = new ChildAvailabilityStatusesImpl(this); + } + return this.childAvailabilityStatuses; + } + + /** + * @return Entry point to manage ChildResources. + */ + public ChildResources childResources() { + if (this.childResources == null) { + this.childResources = new ChildResourcesImpl(this); + } + return this.childResources; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public ResourceHealthManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return ResourceHealthManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private ResourceHealthManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new MicrosoftResourceHealthImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/package-info.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/implementation/package-info.java new file mode 100644 index 000000000000..17b32061a968 --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/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 MicrosoftResourceHealth. + * The Resource Health Client. + */ +package com.microsoft.azure.management.resourcehealth.v2017_07_01.implementation; diff --git a/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/package-info.java b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/package-info.java new file mode 100644 index 000000000000..d8a82d89d5df --- /dev/null +++ b/resourcehealth/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/resourcehealth/v2017_07_01/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 MicrosoftResourceHealth. + * The Resource Health Client. + */ +package com.microsoft.azure.management.resourcehealth.v2017_07_01;