forked from Azure/azure-sdk-for-java
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generated from d7aec541537099657f4bd9c2f6ecf50347189c69
fixed prettier error
SDK Automation
committed
Mar 24, 2020
1 parent
222e592
commit a124b40
Showing
33 changed files
with
3,135 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>com.microsoft.azure.resources.v2018_06_01</groupId> | ||
<parent> | ||
<groupId>com.microsoft.azure</groupId> | ||
<artifactId>azure-arm-parent</artifactId> | ||
<version>1.1.0</version> | ||
<relativePath>../../../pom.management.xml</relativePath> | ||
</parent> | ||
<artifactId>azure-mgmt-resources</artifactId> | ||
<version>1.0.0-beta</version> | ||
<packaging>jar</packaging> | ||
<name>Microsoft Azure SDK for Resources Management</name> | ||
<description>This package contains Microsoft Resources Management SDK.</description> | ||
<url>https://github.com/Azure/azure-sdk-for-java</url> | ||
<licenses> | ||
<license> | ||
<name>The MIT License (MIT)</name> | ||
<url>http://opensource.org/licenses/MIT</url> | ||
<distribution>repo</distribution> | ||
</license> | ||
</licenses> | ||
<scm> | ||
<url>scm:git:https://github.com/Azure/azure-sdk-for-java</url> | ||
<connection>scm:git:[email protected]:Azure/azure-sdk-for-java.git</connection> | ||
<tag>HEAD</tag> | ||
</scm> | ||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<legal><![CDATA[[INFO] Any downloads listed may be third party software. Microsoft grants you no rights for third party software.]]></legal> | ||
</properties> | ||
<developers> | ||
<developer> | ||
<id>microsoft</id> | ||
<name>Microsoft</name> | ||
</developer> | ||
</developers> | ||
<dependencies> | ||
<dependency> | ||
<groupId>com.microsoft.azure</groupId> | ||
<artifactId>azure-client-runtime</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.microsoft.azure</groupId> | ||
<artifactId>azure-arm-client-runtime</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.microsoft.azure</groupId> | ||
<artifactId>azure-client-authentication</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.microsoft.azure</groupId> | ||
<artifactId>azure-mgmt-resources</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.microsoft.azure</groupId> | ||
<artifactId>azure-arm-client-runtime</artifactId> | ||
<type>test-jar</type> | ||
<scope>test</scope> | ||
<!--Below version for test jar needs to be removed, this will be done as part of v1-runtime 1.6.7--> | ||
<version>1.6.5</version> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<configuration> | ||
<archive> | ||
<manifest> | ||
<addDefaultImplementationEntries>true</addDefaultImplementationEntries> | ||
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries> | ||
</manifest> | ||
</archive> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>build-helper-maven-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.1</version> | ||
<configuration> | ||
<source>1.7</source> | ||
<target>1.7</target> | ||
<annotationProcessors> | ||
<annotationProcessor> | ||
com.microsoft.azure.management.apigeneration.LangDefinitionProcessor | ||
</annotationProcessor> | ||
</annotationProcessors> | ||
<debug>true</debug> | ||
<optimize>true</optimize> | ||
<compilerArguments> | ||
<AaddGeneratedAnnotation>true</AaddGeneratedAnnotation> | ||
<Adebug>true</Adebug> | ||
</compilerArguments> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-javadoc-plugin</artifactId> | ||
<version>2.8</version> | ||
<configuration> | ||
<excludePackageNames>*.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search</excludePackageNames> | ||
<bottom> | ||
<![CDATA[<code> | ||
/** | ||
<br />* Copyright (c) Microsoft Corporation. All rights reserved. | ||
<br />* Licensed under the MIT License. See License.txt in the project root for | ||
<br />* license information. | ||
<br />*/ | ||
</code>]]> | ||
</bottom> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
50 changes: 50 additions & 0 deletions
50
...18_06_01/src/main/java/com/microsoft/azure/management/resources/v2018_06_01/Location.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
* 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.resources.v2018_06_01; | ||
|
||
import com.microsoft.azure.arm.model.HasInner; | ||
import com.microsoft.azure.management.resources.v2018_06_01.implementation.LocationInner; | ||
import com.microsoft.azure.arm.resources.models.HasManager; | ||
import com.microsoft.azure.management.resources.v2018_06_01.implementation.ResourcesManager; | ||
|
||
/** | ||
* Type representing Location. | ||
*/ | ||
public interface Location extends HasInner<LocationInner>, HasManager<ResourcesManager> { | ||
/** | ||
* @return the displayName value. | ||
*/ | ||
String displayName(); | ||
|
||
/** | ||
* @return the id value. | ||
*/ | ||
String id(); | ||
|
||
/** | ||
* @return the latitude value. | ||
*/ | ||
String latitude(); | ||
|
||
/** | ||
* @return the longitude value. | ||
*/ | ||
String longitude(); | ||
|
||
/** | ||
* @return the name value. | ||
*/ | ||
String name(); | ||
|
||
/** | ||
* @return the subscriptionId value. | ||
*/ | ||
String subscriptionId(); | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
...8_06_01/src/main/java/com/microsoft/azure/management/resources/v2018_06_01/Operation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* 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.resources.v2018_06_01; | ||
|
||
import com.microsoft.azure.arm.model.HasInner; | ||
import com.microsoft.azure.arm.resources.models.HasManager; | ||
import com.microsoft.azure.management.resources.v2018_06_01.implementation.ResourcesManager; | ||
import com.microsoft.azure.management.resources.v2018_06_01.implementation.OperationInner; | ||
|
||
/** | ||
* Type representing Operation. | ||
*/ | ||
public interface Operation extends HasInner<OperationInner>, HasManager<ResourcesManager> { | ||
/** | ||
* @return the display value. | ||
*/ | ||
OperationDisplay display(); | ||
|
||
/** | ||
* @return the name value. | ||
*/ | ||
String name(); | ||
|
||
} |
121 changes: 121 additions & 0 deletions
121
.../src/main/java/com/microsoft/azure/management/resources/v2018_06_01/OperationDisplay.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.resources.v2018_06_01; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** | ||
* The object that represents the operation. | ||
*/ | ||
public class OperationDisplay { | ||
/** | ||
* Service provider: Microsoft.Resources. | ||
*/ | ||
@JsonProperty(value = "provider") | ||
private String provider; | ||
|
||
/** | ||
* Resource on which the operation is performed: Profile, endpoint, etc. | ||
*/ | ||
@JsonProperty(value = "resource") | ||
private String resource; | ||
|
||
/** | ||
* Operation type: Read, write, delete, etc. | ||
*/ | ||
@JsonProperty(value = "operation") | ||
private String operation; | ||
|
||
/** | ||
* Description of the operation. | ||
*/ | ||
@JsonProperty(value = "description") | ||
private String description; | ||
|
||
/** | ||
* Get service provider: Microsoft.Resources. | ||
* | ||
* @return the provider value | ||
*/ | ||
public String provider() { | ||
return this.provider; | ||
} | ||
|
||
/** | ||
* Set service provider: Microsoft.Resources. | ||
* | ||
* @param provider the provider value to set | ||
* @return the OperationDisplay object itself. | ||
*/ | ||
public OperationDisplay withProvider(String provider) { | ||
this.provider = provider; | ||
return this; | ||
} | ||
|
||
/** | ||
* Get resource on which the operation is performed: Profile, endpoint, etc. | ||
* | ||
* @return the resource value | ||
*/ | ||
public String resource() { | ||
return this.resource; | ||
} | ||
|
||
/** | ||
* Set resource on which the operation is performed: Profile, endpoint, etc. | ||
* | ||
* @param resource the resource value to set | ||
* @return the OperationDisplay object itself. | ||
*/ | ||
public OperationDisplay withResource(String resource) { | ||
this.resource = resource; | ||
return this; | ||
} | ||
|
||
/** | ||
* Get operation type: Read, write, delete, etc. | ||
* | ||
* @return the operation value | ||
*/ | ||
public String operation() { | ||
return this.operation; | ||
} | ||
|
||
/** | ||
* Set operation type: Read, write, delete, etc. | ||
* | ||
* @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; | ||
} | ||
|
||
} |
27 changes: 27 additions & 0 deletions
27
..._06_01/src/main/java/com/microsoft/azure/management/resources/v2018_06_01/Operations.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.resources.v2018_06_01; | ||
|
||
import rx.Observable; | ||
import com.microsoft.azure.management.resources.v2018_06_01.implementation.OperationsInner; | ||
import com.microsoft.azure.arm.model.HasInner; | ||
|
||
/** | ||
* Type representing Operations. | ||
*/ | ||
public interface Operations extends HasInner<OperationsInner> { | ||
/** | ||
* Lists all of the available Microsoft.Resources REST API operations. | ||
* | ||
* @throws IllegalArgumentException thrown if parameters fail the validation | ||
* @return the observable for the request | ||
*/ | ||
Observable<Operation> listAsync(); | ||
|
||
} |
56 changes: 56 additions & 0 deletions
56
..._01/src/main/java/com/microsoft/azure/management/resources/v2018_06_01/SpendingLimit.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.resources.v2018_06_01; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonValue; | ||
|
||
/** | ||
* Defines values for SpendingLimit. | ||
*/ | ||
public enum SpendingLimit { | ||
/** Enum value On. */ | ||
ON("On"), | ||
|
||
/** Enum value Off. */ | ||
OFF("Off"), | ||
|
||
/** Enum value CurrentPeriodOff. */ | ||
CURRENT_PERIOD_OFF("CurrentPeriodOff"); | ||
|
||
/** The actual serialized value for a SpendingLimit instance. */ | ||
private String value; | ||
|
||
SpendingLimit(String value) { | ||
this.value = value; | ||
} | ||
|
||
/** | ||
* Parses a serialized value to a SpendingLimit instance. | ||
* | ||
* @param value the serialized value to parse. | ||
* @return the parsed SpendingLimit object, or null if unable to parse. | ||
*/ | ||
@JsonCreator | ||
public static SpendingLimit fromString(String value) { | ||
SpendingLimit[] items = SpendingLimit.values(); | ||
for (SpendingLimit item : items) { | ||
if (item.toString().equalsIgnoreCase(value)) { | ||
return item; | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
@JsonValue | ||
@Override | ||
public String toString() { | ||
return this.value; | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
...6_01/src/main/java/com/microsoft/azure/management/resources/v2018_06_01/Subscription.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** | ||
* 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.resources.v2018_06_01; | ||
|
||
import com.microsoft.azure.arm.model.HasInner; | ||
import com.microsoft.azure.arm.resources.models.HasManager; | ||
import com.microsoft.azure.management.resources.v2018_06_01.implementation.ResourcesManager; | ||
import com.microsoft.azure.management.resources.v2018_06_01.implementation.SubscriptionInner; | ||
|
||
/** | ||
* Type representing Subscription. | ||
*/ | ||
public interface Subscription extends HasInner<SubscriptionInner>, HasManager<ResourcesManager> { | ||
/** | ||
* @return the authorizationSource value. | ||
*/ | ||
String authorizationSource(); | ||
|
||
/** | ||
* @return the displayName value. | ||
*/ | ||
String displayName(); | ||
|
||
/** | ||
* @return the id value. | ||
*/ | ||
String id(); | ||
|
||
/** | ||
* @return the state value. | ||
*/ | ||
SubscriptionState state(); | ||
|
||
/** | ||
* @return the subscriptionId value. | ||
*/ | ||
String subscriptionId(); | ||
|
||
/** | ||
* @return the subscriptionPolicies value. | ||
*/ | ||
SubscriptionPolicies subscriptionPolicies(); | ||
|
||
/** | ||
* @return the tenantId value. | ||
*/ | ||
String tenantId(); | ||
|
||
} |
66 changes: 66 additions & 0 deletions
66
.../main/java/com/microsoft/azure/management/resources/v2018_06_01/SubscriptionPolicies.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/** | ||
* 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.resources.v2018_06_01; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** | ||
* Subscription policies. | ||
*/ | ||
public class SubscriptionPolicies { | ||
/** | ||
* The subscription location placement ID. The ID indicates which regions | ||
* are visible for a subscription. For example, a subscription with a | ||
* location placement Id of Public_2014-09-01 has access to Azure public | ||
* regions. | ||
*/ | ||
@JsonProperty(value = "locationPlacementId", access = JsonProperty.Access.WRITE_ONLY) | ||
private String locationPlacementId; | ||
|
||
/** | ||
* The subscription quota ID. | ||
*/ | ||
@JsonProperty(value = "quotaId", access = JsonProperty.Access.WRITE_ONLY) | ||
private String quotaId; | ||
|
||
/** | ||
* The subscription spending limit. Possible values include: 'On', 'Off', | ||
* 'CurrentPeriodOff'. | ||
*/ | ||
@JsonProperty(value = "spendingLimit", access = JsonProperty.Access.WRITE_ONLY) | ||
private SpendingLimit spendingLimit; | ||
|
||
/** | ||
* Get the subscription location placement ID. The ID indicates which regions are visible for a subscription. For example, a subscription with a location placement Id of Public_2014-09-01 has access to Azure public regions. | ||
* | ||
* @return the locationPlacementId value | ||
*/ | ||
public String locationPlacementId() { | ||
return this.locationPlacementId; | ||
} | ||
|
||
/** | ||
* Get the subscription quota ID. | ||
* | ||
* @return the quotaId value | ||
*/ | ||
public String quotaId() { | ||
return this.quotaId; | ||
} | ||
|
||
/** | ||
* Get the subscription spending limit. Possible values include: 'On', 'Off', 'CurrentPeriodOff'. | ||
* | ||
* @return the spendingLimit value | ||
*/ | ||
public SpendingLimit spendingLimit() { | ||
return this.spendingLimit; | ||
} | ||
|
||
} |
62 changes: 62 additions & 0 deletions
62
...src/main/java/com/microsoft/azure/management/resources/v2018_06_01/SubscriptionState.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.resources.v2018_06_01; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonValue; | ||
|
||
/** | ||
* Defines values for SubscriptionState. | ||
*/ | ||
public enum SubscriptionState { | ||
/** Enum value Enabled. */ | ||
ENABLED("Enabled"), | ||
|
||
/** Enum value Warned. */ | ||
WARNED("Warned"), | ||
|
||
/** Enum value PastDue. */ | ||
PAST_DUE("PastDue"), | ||
|
||
/** Enum value Disabled. */ | ||
DISABLED("Disabled"), | ||
|
||
/** Enum value Deleted. */ | ||
DELETED("Deleted"); | ||
|
||
/** The actual serialized value for a SubscriptionState instance. */ | ||
private String value; | ||
|
||
SubscriptionState(String value) { | ||
this.value = value; | ||
} | ||
|
||
/** | ||
* Parses a serialized value to a SubscriptionState instance. | ||
* | ||
* @param value the serialized value to parse. | ||
* @return the parsed SubscriptionState object, or null if unable to parse. | ||
*/ | ||
@JsonCreator | ||
public static SubscriptionState fromString(String value) { | ||
SubscriptionState[] items = SubscriptionState.values(); | ||
for (SubscriptionState item : items) { | ||
if (item.toString().equalsIgnoreCase(value)) { | ||
return item; | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
@JsonValue | ||
@Override | ||
public String toString() { | ||
return this.value; | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
..._01/src/main/java/com/microsoft/azure/management/resources/v2018_06_01/Subscriptions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for | ||
* license information. | ||
* | ||
* Code generated by Microsoft (R) AutoRest Code Generator. | ||
*/ | ||
|
||
package com.microsoft.azure.management.resources.v2018_06_01; | ||
|
||
import rx.Observable; | ||
import com.microsoft.azure.management.resources.v2018_06_01.implementation.SubscriptionsInner; | ||
import com.microsoft.azure.arm.model.HasInner; | ||
import com.microsoft.azure.management.resources.v2018_06_01.Location; | ||
|
||
/** | ||
* Type representing Subscriptions. | ||
*/ | ||
public interface Subscriptions extends HasInner<SubscriptionsInner> { | ||
/** | ||
* Gets details about a specified subscription. | ||
* | ||
* @param subscriptionId The ID of the target subscription. | ||
* @throws IllegalArgumentException thrown if parameters fail the validation | ||
* @return the observable for the request | ||
*/ | ||
Observable<Subscription> getAsync(String subscriptionId); | ||
|
||
/** | ||
* Gets all subscriptions for a tenant. | ||
* | ||
* @throws IllegalArgumentException thrown if parameters fail the validation | ||
* @return the observable for the request | ||
*/ | ||
Observable<Subscription> listAsync(); | ||
|
||
/** | ||
* Gets all available geo-locations. | ||
* This operation provides all the locations that are available for resource providers; however, each resource provider may support a subset of this list. | ||
* | ||
* @param subscriptionId The ID of the target subscription. | ||
* @throws IllegalArgumentException thrown if parameters fail the validation | ||
* @return the observable for the request | ||
*/ | ||
Observable<Location> listLocationsAsync(String subscriptionId); | ||
|
||
} |
51 changes: 51 additions & 0 deletions
51
...c/main/java/com/microsoft/azure/management/resources/v2018_06_01/TenantIdDescription.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* 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.resources.v2018_06_01; | ||
|
||
import com.microsoft.azure.arm.model.HasInner; | ||
import com.microsoft.azure.arm.resources.models.HasManager; | ||
import com.microsoft.azure.management.resources.v2018_06_01.implementation.ResourcesManager; | ||
import com.microsoft.azure.management.resources.v2018_06_01.implementation.TenantIdDescriptionInner; | ||
import java.util.List; | ||
|
||
/** | ||
* Type representing TenantIdDescription. | ||
*/ | ||
public interface TenantIdDescription extends HasInner<TenantIdDescriptionInner>, HasManager<ResourcesManager> { | ||
/** | ||
* @return the country value. | ||
*/ | ||
String country(); | ||
|
||
/** | ||
* @return the countryCode value. | ||
*/ | ||
String countryCode(); | ||
|
||
/** | ||
* @return the displayName value. | ||
*/ | ||
String displayName(); | ||
|
||
/** | ||
* @return the domains value. | ||
*/ | ||
List<String> domains(); | ||
|
||
/** | ||
* @return the id value. | ||
*/ | ||
String id(); | ||
|
||
/** | ||
* @return the tenantId value. | ||
*/ | ||
String tenantId(); | ||
|
||
} |
27 changes: 27 additions & 0 deletions
27
...018_06_01/src/main/java/com/microsoft/azure/management/resources/v2018_06_01/Tenants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.resources.v2018_06_01; | ||
|
||
import rx.Observable; | ||
import com.microsoft.azure.management.resources.v2018_06_01.implementation.TenantsInner; | ||
import com.microsoft.azure.arm.model.HasInner; | ||
|
||
/** | ||
* Type representing Tenants. | ||
*/ | ||
public interface Tenants extends HasInner<TenantsInner> { | ||
/** | ||
* Gets the tenants for your account. | ||
* | ||
* @throws IllegalArgumentException thrown if parameters fail the validation | ||
* @return the observable for the request | ||
*/ | ||
Observable<TenantIdDescription> listAsync(); | ||
|
||
} |
57 changes: 57 additions & 0 deletions
57
...a/com/microsoft/azure/management/resources/v2018_06_01/implementation/IdParsingUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.resources.v2018_06_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<String> iterable = Arrays.asList(id.split("/")); | ||
Iterator<String> 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<String> iterable = Arrays.asList(id.split("/")); | ||
Iterator <String> 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; | ||
} | ||
} |
60 changes: 60 additions & 0 deletions
60
...ava/com/microsoft/azure/management/resources/v2018_06_01/implementation/LocationImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/** | ||
* 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.resources.v2018_06_01.implementation; | ||
|
||
import com.microsoft.azure.management.resources.v2018_06_01.Location; | ||
import com.microsoft.azure.arm.model.implementation.WrapperImpl; | ||
import rx.Observable; | ||
|
||
class LocationImpl extends WrapperImpl<LocationInner> implements Location { | ||
private final ResourcesManager manager; | ||
|
||
LocationImpl(LocationInner inner, ResourcesManager manager) { | ||
super(inner); | ||
this.manager = manager; | ||
} | ||
|
||
@Override | ||
public ResourcesManager manager() { | ||
return this.manager; | ||
} | ||
|
||
|
||
|
||
@Override | ||
public String displayName() { | ||
return this.inner().displayName(); | ||
} | ||
|
||
@Override | ||
public String id() { | ||
return this.inner().id(); | ||
} | ||
|
||
@Override | ||
public String latitude() { | ||
return this.inner().latitude(); | ||
} | ||
|
||
@Override | ||
public String longitude() { | ||
return this.inner().longitude(); | ||
} | ||
|
||
@Override | ||
public String name() { | ||
return this.inner().name(); | ||
} | ||
|
||
@Override | ||
public String subscriptionId() { | ||
return this.inner().subscriptionId(); | ||
} | ||
|
||
} |
108 changes: 108 additions & 0 deletions
108
...va/com/microsoft/azure/management/resources/v2018_06_01/implementation/LocationInner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
/** | ||
* 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.resources.v2018_06_01.implementation; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** | ||
* Location information. | ||
*/ | ||
public class LocationInner { | ||
/** | ||
* The fully qualified ID of the location. For example, | ||
* /subscriptions/00000000-0000-0000-0000-000000000000/locations/westus. | ||
*/ | ||
@JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) | ||
private String id; | ||
|
||
/** | ||
* The subscription ID. | ||
*/ | ||
@JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) | ||
private String subscriptionId; | ||
|
||
/** | ||
* The location name. | ||
*/ | ||
@JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) | ||
private String name; | ||
|
||
/** | ||
* The display name of the location. | ||
*/ | ||
@JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) | ||
private String displayName; | ||
|
||
/** | ||
* The latitude of the location. | ||
*/ | ||
@JsonProperty(value = "latitude", access = JsonProperty.Access.WRITE_ONLY) | ||
private String latitude; | ||
|
||
/** | ||
* The longitude of the location. | ||
*/ | ||
@JsonProperty(value = "longitude", access = JsonProperty.Access.WRITE_ONLY) | ||
private String longitude; | ||
|
||
/** | ||
* Get the fully qualified ID of the location. For example, /subscriptions/00000000-0000-0000-0000-000000000000/locations/westus. | ||
* | ||
* @return the id value | ||
*/ | ||
public String id() { | ||
return this.id; | ||
} | ||
|
||
/** | ||
* Get the subscription ID. | ||
* | ||
* @return the subscriptionId value | ||
*/ | ||
public String subscriptionId() { | ||
return this.subscriptionId; | ||
} | ||
|
||
/** | ||
* Get the location name. | ||
* | ||
* @return the name value | ||
*/ | ||
public String name() { | ||
return this.name; | ||
} | ||
|
||
/** | ||
* Get the display name of the location. | ||
* | ||
* @return the displayName value | ||
*/ | ||
public String displayName() { | ||
return this.displayName; | ||
} | ||
|
||
/** | ||
* Get the latitude of the location. | ||
* | ||
* @return the latitude value | ||
*/ | ||
public String latitude() { | ||
return this.latitude; | ||
} | ||
|
||
/** | ||
* Get the longitude of the location. | ||
* | ||
* @return the longitude value | ||
*/ | ||
public String longitude() { | ||
return this.longitude; | ||
} | ||
|
||
} |
37 changes: 37 additions & 0 deletions
37
...va/com/microsoft/azure/management/resources/v2018_06_01/implementation/OperationImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.resources.v2018_06_01.implementation; | ||
|
||
import com.microsoft.azure.management.resources.v2018_06_01.Operation; | ||
import com.microsoft.azure.arm.model.implementation.WrapperImpl; | ||
import com.microsoft.azure.management.resources.v2018_06_01.OperationDisplay; | ||
|
||
class OperationImpl extends WrapperImpl<OperationInner> implements Operation { | ||
private final ResourcesManager manager; | ||
OperationImpl(OperationInner inner, ResourcesManager manager) { | ||
super(inner); | ||
this.manager = manager; | ||
} | ||
|
||
@Override | ||
public ResourcesManager manager() { | ||
return this.manager; | ||
} | ||
|
||
@Override | ||
public OperationDisplay display() { | ||
return this.inner().display(); | ||
} | ||
|
||
@Override | ||
public String name() { | ||
return this.inner().name(); | ||
} | ||
|
||
} |
70 changes: 70 additions & 0 deletions
70
...a/com/microsoft/azure/management/resources/v2018_06_01/implementation/OperationInner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.resources.v2018_06_01.implementation; | ||
|
||
import com.microsoft.azure.management.resources.v2018_06_01.OperationDisplay; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** | ||
* Microsoft.Resources operation. | ||
*/ | ||
public class OperationInner { | ||
/** | ||
* Operation name: {provider}/{resource}/{operation}. | ||
*/ | ||
@JsonProperty(value = "name") | ||
private String name; | ||
|
||
/** | ||
* The object that represents the operation. | ||
*/ | ||
@JsonProperty(value = "display") | ||
private OperationDisplay display; | ||
|
||
/** | ||
* Get operation name: {provider}/{resource}/{operation}. | ||
* | ||
* @return the name value | ||
*/ | ||
public String name() { | ||
return this.name; | ||
} | ||
|
||
/** | ||
* Set operation name: {provider}/{resource}/{operation}. | ||
* | ||
* @param name the name value to set | ||
* @return the OperationInner object itself. | ||
*/ | ||
public OperationInner withName(String name) { | ||
this.name = name; | ||
return this; | ||
} | ||
|
||
/** | ||
* Get the object that represents the operation. | ||
* | ||
* @return the display value | ||
*/ | ||
public OperationDisplay display() { | ||
return this.display; | ||
} | ||
|
||
/** | ||
* Set the object that represents the operation. | ||
* | ||
* @param display the display value to set | ||
* @return the OperationInner object itself. | ||
*/ | ||
public OperationInner withDisplay(OperationDisplay display) { | ||
this.display = display; | ||
return this; | ||
} | ||
|
||
} |
49 changes: 49 additions & 0 deletions
49
...a/com/microsoft/azure/management/resources/v2018_06_01/implementation/OperationsImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.resources.v2018_06_01.implementation; | ||
|
||
import com.microsoft.azure.arm.model.implementation.WrapperImpl; | ||
import com.microsoft.azure.management.resources.v2018_06_01.Operations; | ||
import rx.functions.Func1; | ||
import rx.Observable; | ||
import com.microsoft.azure.Page; | ||
import com.microsoft.azure.management.resources.v2018_06_01.Operation; | ||
|
||
class OperationsImpl extends WrapperImpl<OperationsInner> implements Operations { | ||
private final ResourcesManager manager; | ||
|
||
OperationsImpl(ResourcesManager manager) { | ||
super(manager.inner().operations()); | ||
this.manager = manager; | ||
} | ||
|
||
public ResourcesManager manager() { | ||
return this.manager; | ||
} | ||
|
||
@Override | ||
public Observable<Operation> listAsync() { | ||
OperationsInner client = this.inner(); | ||
return client.listAsync() | ||
.flatMapIterable(new Func1<Page<OperationInner>, Iterable<OperationInner>>() { | ||
@Override | ||
public Iterable<OperationInner> call(Page<OperationInner> page) { | ||
return page.items(); | ||
} | ||
}) | ||
.map(new Func1<OperationInner, Operation>() { | ||
@Override | ||
public Operation call(OperationInner inner) { | ||
return new OperationImpl(inner, manager()); | ||
} | ||
}); | ||
} | ||
|
||
} |
283 changes: 283 additions & 0 deletions
283
.../com/microsoft/azure/management/resources/v2018_06_01/implementation/OperationsInner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,283 @@ | ||
/** | ||
* 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.resources.v2018_06_01.implementation; | ||
|
||
import retrofit2.Retrofit; | ||
import com.google.common.reflect.TypeToken; | ||
import com.microsoft.azure.AzureServiceFuture; | ||
import com.microsoft.azure.CloudException; | ||
import com.microsoft.azure.ListOperationCallback; | ||
import com.microsoft.azure.Page; | ||
import com.microsoft.azure.PagedList; | ||
import com.microsoft.rest.ServiceFuture; | ||
import com.microsoft.rest.ServiceResponse; | ||
import java.io.IOException; | ||
import java.util.List; | ||
import okhttp3.ResponseBody; | ||
import retrofit2.http.GET; | ||
import retrofit2.http.Header; | ||
import retrofit2.http.Headers; | ||
import retrofit2.http.Query; | ||
import retrofit2.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 Operations. | ||
*/ | ||
public class OperationsInner { | ||
/** The Retrofit service to perform REST calls. */ | ||
private OperationsService service; | ||
/** The service client containing this operation class. */ | ||
private SubscriptionClientImpl 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, SubscriptionClientImpl 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.resources.v2018_06_01.Operations list" }) | ||
@GET("providers/Microsoft.Resources/operations") | ||
Observable<Response<ResponseBody>> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); | ||
|
||
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.v2018_06_01.Operations listNext" }) | ||
@GET | ||
Observable<Response<ResponseBody>> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); | ||
|
||
} | ||
|
||
/** | ||
* Lists all of the available Microsoft.Resources REST API operations. | ||
* | ||
* @throws IllegalArgumentException thrown if parameters fail the validation | ||
* @throws CloudException thrown if the request is rejected by server | ||
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent | ||
* @return the PagedList<OperationInner> object if successful. | ||
*/ | ||
public PagedList<OperationInner> list() { | ||
ServiceResponse<Page<OperationInner>> response = listSinglePageAsync().toBlocking().single(); | ||
return new PagedList<OperationInner>(response.body()) { | ||
@Override | ||
public Page<OperationInner> nextPage(String nextPageLink) { | ||
return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); | ||
} | ||
}; | ||
} | ||
|
||
/** | ||
* Lists all of the available Microsoft.Resources REST API operations. | ||
* | ||
* @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<List<OperationInner>> listAsync(final ListOperationCallback<OperationInner> serviceCallback) { | ||
return AzureServiceFuture.fromPageResponse( | ||
listSinglePageAsync(), | ||
new Func1<String, Observable<ServiceResponse<Page<OperationInner>>>>() { | ||
@Override | ||
public Observable<ServiceResponse<Page<OperationInner>>> call(String nextPageLink) { | ||
return listNextSinglePageAsync(nextPageLink); | ||
} | ||
}, | ||
serviceCallback); | ||
} | ||
|
||
/** | ||
* Lists all of the available Microsoft.Resources REST API operations. | ||
* | ||
* @throws IllegalArgumentException thrown if parameters fail the validation | ||
* @return the observable to the PagedList<OperationInner> object | ||
*/ | ||
public Observable<Page<OperationInner>> listAsync() { | ||
return listWithServiceResponseAsync() | ||
.map(new Func1<ServiceResponse<Page<OperationInner>>, Page<OperationInner>>() { | ||
@Override | ||
public Page<OperationInner> call(ServiceResponse<Page<OperationInner>> response) { | ||
return response.body(); | ||
} | ||
}); | ||
} | ||
|
||
/** | ||
* Lists all of the available Microsoft.Resources REST API operations. | ||
* | ||
* @throws IllegalArgumentException thrown if parameters fail the validation | ||
* @return the observable to the PagedList<OperationInner> object | ||
*/ | ||
public Observable<ServiceResponse<Page<OperationInner>>> listWithServiceResponseAsync() { | ||
return listSinglePageAsync() | ||
.concatMap(new Func1<ServiceResponse<Page<OperationInner>>, Observable<ServiceResponse<Page<OperationInner>>>>() { | ||
@Override | ||
public Observable<ServiceResponse<Page<OperationInner>>> call(ServiceResponse<Page<OperationInner>> page) { | ||
String nextPageLink = page.body().nextPageLink(); | ||
if (nextPageLink == null) { | ||
return Observable.just(page); | ||
} | ||
return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); | ||
} | ||
}); | ||
} | ||
|
||
/** | ||
* Lists all of the available Microsoft.Resources REST API operations. | ||
* | ||
* @throws IllegalArgumentException thrown if parameters fail the validation | ||
* @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. | ||
*/ | ||
public Observable<ServiceResponse<Page<OperationInner>>> listSinglePageAsync() { | ||
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<Response<ResponseBody>, Observable<ServiceResponse<Page<OperationInner>>>>() { | ||
@Override | ||
public Observable<ServiceResponse<Page<OperationInner>>> call(Response<ResponseBody> response) { | ||
try { | ||
ServiceResponse<PageImpl<OperationInner>> result = listDelegate(response); | ||
return Observable.just(new ServiceResponse<Page<OperationInner>>(result.body(), result.response())); | ||
} catch (Throwable t) { | ||
return Observable.error(t); | ||
} | ||
} | ||
}); | ||
} | ||
|
||
private ServiceResponse<PageImpl<OperationInner>> listDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { | ||
return this.client.restClient().responseBuilderFactory().<PageImpl<OperationInner>, CloudException>newInstance(this.client.serializerAdapter()) | ||
.register(200, new TypeToken<PageImpl<OperationInner>>() { }.getType()) | ||
.registerError(CloudException.class) | ||
.build(response); | ||
} | ||
|
||
/** | ||
* Lists all of the available Microsoft.Resources REST API operations. | ||
* | ||
* @param nextPageLink The NextLink from the previous successful call to List operation. | ||
* @throws IllegalArgumentException thrown if parameters fail the validation | ||
* @throws CloudException thrown if the request is rejected by server | ||
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent | ||
* @return the PagedList<OperationInner> object if successful. | ||
*/ | ||
public PagedList<OperationInner> listNext(final String nextPageLink) { | ||
ServiceResponse<Page<OperationInner>> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); | ||
return new PagedList<OperationInner>(response.body()) { | ||
@Override | ||
public Page<OperationInner> nextPage(String nextPageLink) { | ||
return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); | ||
} | ||
}; | ||
} | ||
|
||
/** | ||
* Lists all of the available Microsoft.Resources REST API operations. | ||
* | ||
* @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<List<OperationInner>> listNextAsync(final String nextPageLink, final ServiceFuture<List<OperationInner>> serviceFuture, final ListOperationCallback<OperationInner> serviceCallback) { | ||
return AzureServiceFuture.fromPageResponse( | ||
listNextSinglePageAsync(nextPageLink), | ||
new Func1<String, Observable<ServiceResponse<Page<OperationInner>>>>() { | ||
@Override | ||
public Observable<ServiceResponse<Page<OperationInner>>> call(String nextPageLink) { | ||
return listNextSinglePageAsync(nextPageLink); | ||
} | ||
}, | ||
serviceCallback); | ||
} | ||
|
||
/** | ||
* Lists all of the available Microsoft.Resources REST API operations. | ||
* | ||
* @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<OperationInner> object | ||
*/ | ||
public Observable<Page<OperationInner>> listNextAsync(final String nextPageLink) { | ||
return listNextWithServiceResponseAsync(nextPageLink) | ||
.map(new Func1<ServiceResponse<Page<OperationInner>>, Page<OperationInner>>() { | ||
@Override | ||
public Page<OperationInner> call(ServiceResponse<Page<OperationInner>> response) { | ||
return response.body(); | ||
} | ||
}); | ||
} | ||
|
||
/** | ||
* Lists all of the available Microsoft.Resources REST API operations. | ||
* | ||
* @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<OperationInner> object | ||
*/ | ||
public Observable<ServiceResponse<Page<OperationInner>>> listNextWithServiceResponseAsync(final String nextPageLink) { | ||
return listNextSinglePageAsync(nextPageLink) | ||
.concatMap(new Func1<ServiceResponse<Page<OperationInner>>, Observable<ServiceResponse<Page<OperationInner>>>>() { | ||
@Override | ||
public Observable<ServiceResponse<Page<OperationInner>>> call(ServiceResponse<Page<OperationInner>> page) { | ||
String nextPageLink = page.body().nextPageLink(); | ||
if (nextPageLink == null) { | ||
return Observable.just(page); | ||
} | ||
return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); | ||
} | ||
}); | ||
} | ||
|
||
/** | ||
* Lists all of the available Microsoft.Resources REST API operations. | ||
* | ||
ServiceResponse<PageImpl<OperationInner>> * @param nextPageLink The NextLink from the previous successful call to List operation. | ||
* @throws IllegalArgumentException thrown if parameters fail the validation | ||
* @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. | ||
*/ | ||
public Observable<ServiceResponse<Page<OperationInner>>> 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<Response<ResponseBody>, Observable<ServiceResponse<Page<OperationInner>>>>() { | ||
@Override | ||
public Observable<ServiceResponse<Page<OperationInner>>> call(Response<ResponseBody> response) { | ||
try { | ||
ServiceResponse<PageImpl<OperationInner>> result = listNextDelegate(response); | ||
return Observable.just(new ServiceResponse<Page<OperationInner>>(result.body(), result.response())); | ||
} catch (Throwable t) { | ||
return Observable.error(t); | ||
} | ||
} | ||
}); | ||
} | ||
|
||
private ServiceResponse<PageImpl<OperationInner>> listNextDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { | ||
return this.client.restClient().responseBuilderFactory().<PageImpl<OperationInner>, CloudException>newInstance(this.client.serializerAdapter()) | ||
.register(200, new TypeToken<PageImpl<OperationInner>>() { }.getType()) | ||
.registerError(CloudException.class) | ||
.build(response); | ||
} | ||
|
||
} |
75 changes: 75 additions & 0 deletions
75
...in/java/com/microsoft/azure/management/resources/v2018_06_01/implementation/PageImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.resources.v2018_06_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 <T> type of Azure resource | ||
*/ | ||
public class PageImpl<T> implements Page<T> { | ||
/** | ||
* The link to the next page. | ||
*/ | ||
@JsonProperty("nextLink") | ||
private String nextPageLink; | ||
|
||
/** | ||
* The list of items. | ||
*/ | ||
@JsonProperty("value") | ||
private List<T> 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<T> 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<T> 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<T> setItems(List<T> items) { | ||
this.items = items; | ||
return this; | ||
} | ||
} |
75 changes: 75 additions & 0 deletions
75
...n/java/com/microsoft/azure/management/resources/v2018_06_01/implementation/PageImpl1.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.resources.v2018_06_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 <T> type of Azure resource | ||
*/ | ||
public class PageImpl1<T> implements Page<T> { | ||
/** | ||
* The link to the next page. | ||
*/ | ||
@JsonProperty("") | ||
private String nextPageLink; | ||
|
||
/** | ||
* The list of items. | ||
*/ | ||
@JsonProperty("value") | ||
private List<T> 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<T> items() { | ||
return items; | ||
} | ||
|
||
/** | ||
* Sets the link to the next page. | ||
* | ||
* @param nextPageLink the link to the next page. | ||
* @return this Page object itself. | ||
*/ | ||
public PageImpl1<T> setNextPageLink(String nextPageLink) { | ||
this.nextPageLink = nextPageLink; | ||
return this; | ||
} | ||
|
||
/** | ||
* Sets the list of items. | ||
* | ||
* @param items the list of items in {@link List}. | ||
* @return this Page object itself. | ||
*/ | ||
public PageImpl1<T> setItems(List<T> items) { | ||
this.items = items; | ||
return this; | ||
} | ||
} |
120 changes: 120 additions & 0 deletions
120
...com/microsoft/azure/management/resources/v2018_06_01/implementation/ResourcesManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
/** | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for | ||
* license information. | ||
* | ||
* Code generated by Microsoft (R) AutoRest Code Generator. | ||
*/ | ||
|
||
package com.microsoft.azure.management.resources.v2018_06_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.resources.v2018_06_01.Operations; | ||
import com.microsoft.azure.management.resources.v2018_06_01.Subscriptions; | ||
import com.microsoft.azure.management.resources.v2018_06_01.Tenants; | ||
import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; | ||
import com.microsoft.azure.arm.resources.implementation.ManagerCore; | ||
|
||
/** | ||
* Entry point to Azure Resources resource management. | ||
*/ | ||
public final class ResourcesManager extends ManagerCore<ResourcesManager, SubscriptionClientImpl> { | ||
private Operations operations; | ||
private Subscriptions subscriptions; | ||
private Tenants tenants; | ||
/** | ||
* Get a Configurable instance that can be used to create ResourcesManager with optional configuration. | ||
* | ||
* @return the instance allowing configurations | ||
*/ | ||
public static Configurable configure() { | ||
return new ResourcesManager.ConfigurableImpl(); | ||
} | ||
/** | ||
* Creates an instance of ResourcesManager that exposes Resources resource management API entry points. | ||
* | ||
* @param credentials the credentials to use | ||
* @return the ResourcesManager | ||
*/ | ||
public static ResourcesManager authenticate(AzureTokenCredentials credentials) { | ||
return new ResourcesManager(new RestClient.Builder() | ||
.withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) | ||
.withCredentials(credentials) | ||
.withSerializerAdapter(new AzureJacksonAdapter()) | ||
.withResponseBuilderFactory(new AzureResponseBuilder.Factory()) | ||
.build()); | ||
} | ||
/** | ||
* Creates an instance of ResourcesManager that exposes Resources resource management API entry points. | ||
* | ||
* @param restClient the RestClient to be used for API calls. | ||
* @return the ResourcesManager | ||
*/ | ||
public static ResourcesManager authenticate(RestClient restClient) { | ||
return new ResourcesManager(restClient); | ||
} | ||
/** | ||
* The interface allowing configurations to be set. | ||
*/ | ||
public interface Configurable extends AzureConfigurable<Configurable> { | ||
/** | ||
* Creates an instance of ResourcesManager that exposes Resources management API entry points. | ||
* | ||
* @param credentials the credentials to use | ||
* @return the interface exposing Resources management API entry points that work across subscriptions | ||
*/ | ||
ResourcesManager authenticate(AzureTokenCredentials credentials); | ||
} | ||
|
||
/** | ||
* @return Entry point to manage Operations. | ||
*/ | ||
public Operations operations() { | ||
if (this.operations == null) { | ||
this.operations = new OperationsImpl(this); | ||
} | ||
return this.operations; | ||
} | ||
|
||
/** | ||
* @return Entry point to manage Subscriptions. | ||
*/ | ||
public Subscriptions subscriptions() { | ||
if (this.subscriptions == null) { | ||
this.subscriptions = new SubscriptionsImpl(this); | ||
} | ||
return this.subscriptions; | ||
} | ||
|
||
/** | ||
* @return Entry point to manage Tenants. | ||
*/ | ||
public Tenants tenants() { | ||
if (this.tenants == null) { | ||
this.tenants = new TenantsImpl(this); | ||
} | ||
return this.tenants; | ||
} | ||
|
||
/** | ||
* The implementation for Configurable interface. | ||
*/ | ||
private static final class ConfigurableImpl extends AzureConfigurableCoreImpl<Configurable> implements Configurable { | ||
public ResourcesManager authenticate(AzureTokenCredentials credentials) { | ||
return ResourcesManager.authenticate(buildRestClient(credentials)); | ||
} | ||
} | ||
private ResourcesManager(RestClient restClient) { | ||
super( | ||
restClient, | ||
null, | ||
new SubscriptionClientImpl(restClient)); | ||
} | ||
} |
201 changes: 201 additions & 0 deletions
201
...crosoft/azure/management/resources/v2018_06_01/implementation/SubscriptionClientImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,201 @@ | ||
/** | ||
* 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.resources.v2018_06_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 SubscriptionClientImpl class. | ||
*/ | ||
public class SubscriptionClientImpl 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; | ||
} | ||
|
||
/** The API version to use for the operation. */ | ||
private String apiVersion; | ||
|
||
/** | ||
* Gets The API version to use for the operation. | ||
* | ||
* @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 SubscriptionClientImpl 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 SubscriptionClientImpl 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 SubscriptionClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { | ||
this.generateClientRequestId = generateClientRequestId; | ||
return this; | ||
} | ||
|
||
/** | ||
* The OperationsInner object to access its operations. | ||
*/ | ||
private OperationsInner operations; | ||
|
||
/** | ||
* Gets the OperationsInner object to access its operations. | ||
* @return the OperationsInner object. | ||
*/ | ||
public OperationsInner operations() { | ||
return this.operations; | ||
} | ||
|
||
/** | ||
* The SubscriptionsInner object to access its operations. | ||
*/ | ||
private SubscriptionsInner subscriptions; | ||
|
||
/** | ||
* Gets the SubscriptionsInner object to access its operations. | ||
* @return the SubscriptionsInner object. | ||
*/ | ||
public SubscriptionsInner subscriptions() { | ||
return this.subscriptions; | ||
} | ||
|
||
/** | ||
* The TenantsInner object to access its operations. | ||
*/ | ||
private TenantsInner tenants; | ||
|
||
/** | ||
* Gets the TenantsInner object to access its operations. | ||
* @return the TenantsInner object. | ||
*/ | ||
public TenantsInner tenants() { | ||
return this.tenants; | ||
} | ||
|
||
/** | ||
* Initializes an instance of SubscriptionClient client. | ||
* | ||
* @param credentials the management credentials for Azure | ||
*/ | ||
public SubscriptionClientImpl(ServiceClientCredentials credentials) { | ||
this("https://management.azure.com", credentials); | ||
} | ||
|
||
/** | ||
* Initializes an instance of SubscriptionClient client. | ||
* | ||
* @param baseUrl the base URL of the host | ||
* @param credentials the management credentials for Azure | ||
*/ | ||
public SubscriptionClientImpl(String baseUrl, ServiceClientCredentials credentials) { | ||
super(baseUrl, credentials); | ||
initialize(); | ||
} | ||
|
||
/** | ||
* Initializes an instance of SubscriptionClient client. | ||
* | ||
* @param restClient the REST client to connect to Azure. | ||
*/ | ||
public SubscriptionClientImpl(RestClient restClient) { | ||
super(restClient); | ||
initialize(); | ||
} | ||
|
||
protected void initialize() { | ||
this.apiVersion = "2018-06-01"; | ||
this.acceptLanguage = "en-US"; | ||
this.longRunningOperationRetryTimeout = 30; | ||
this.generateClientRequestId = true; | ||
this.operations = new OperationsInner(restClient().retrofit(), this); | ||
this.subscriptions = new SubscriptionsInner(restClient().retrofit(), this); | ||
this.tenants = new TenantsInner(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(), "SubscriptionClient", "2018-06-01"); | ||
} | ||
} |
63 changes: 63 additions & 0 deletions
63
...com/microsoft/azure/management/resources/v2018_06_01/implementation/SubscriptionImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/** | ||
* 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.resources.v2018_06_01.implementation; | ||
|
||
import com.microsoft.azure.management.resources.v2018_06_01.Subscription; | ||
import com.microsoft.azure.arm.model.implementation.WrapperImpl; | ||
import com.microsoft.azure.management.resources.v2018_06_01.SubscriptionState; | ||
import com.microsoft.azure.management.resources.v2018_06_01.SubscriptionPolicies; | ||
|
||
class SubscriptionImpl extends WrapperImpl<SubscriptionInner> implements Subscription { | ||
private final ResourcesManager manager; | ||
SubscriptionImpl(SubscriptionInner inner, ResourcesManager manager) { | ||
super(inner); | ||
this.manager = manager; | ||
} | ||
|
||
@Override | ||
public ResourcesManager manager() { | ||
return this.manager; | ||
} | ||
|
||
@Override | ||
public String authorizationSource() { | ||
return this.inner().authorizationSource(); | ||
} | ||
|
||
@Override | ||
public String displayName() { | ||
return this.inner().displayName(); | ||
} | ||
|
||
@Override | ||
public String id() { | ||
return this.inner().id(); | ||
} | ||
|
||
@Override | ||
public SubscriptionState state() { | ||
return this.inner().state(); | ||
} | ||
|
||
@Override | ||
public String subscriptionId() { | ||
return this.inner().subscriptionId(); | ||
} | ||
|
||
@Override | ||
public SubscriptionPolicies subscriptionPolicies() { | ||
return this.inner().subscriptionPolicies(); | ||
} | ||
|
||
@Override | ||
public String tenantId() { | ||
return this.inner().tenantId(); | ||
} | ||
|
||
} |
151 changes: 151 additions & 0 deletions
151
...om/microsoft/azure/management/resources/v2018_06_01/implementation/SubscriptionInner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
/** | ||
* 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.resources.v2018_06_01.implementation; | ||
|
||
import com.microsoft.azure.management.resources.v2018_06_01.SubscriptionState; | ||
import com.microsoft.azure.management.resources.v2018_06_01.SubscriptionPolicies; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** | ||
* Subscription information. | ||
*/ | ||
public class SubscriptionInner { | ||
/** | ||
* The fully qualified ID for the subscription. For example, | ||
* /subscriptions/00000000-0000-0000-0000-000000000000. | ||
*/ | ||
@JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) | ||
private String id; | ||
|
||
/** | ||
* The subscription ID. | ||
*/ | ||
@JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) | ||
private String subscriptionId; | ||
|
||
/** | ||
* The subscription display name. | ||
*/ | ||
@JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) | ||
private String displayName; | ||
|
||
/** | ||
* The subscription tenant ID. | ||
*/ | ||
@JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) | ||
private String tenantId; | ||
|
||
/** | ||
* The subscription state. Possible values are Enabled, Warned, PastDue, | ||
* Disabled, and Deleted. Possible values include: 'Enabled', 'Warned', | ||
* 'PastDue', 'Disabled', 'Deleted'. | ||
*/ | ||
@JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) | ||
private SubscriptionState state; | ||
|
||
/** | ||
* The subscription policies. | ||
*/ | ||
@JsonProperty(value = "subscriptionPolicies") | ||
private SubscriptionPolicies subscriptionPolicies; | ||
|
||
/** | ||
* The authorization source of the request. Valid values are one or more | ||
* combinations of Legacy, RoleBased, Bypassed, Direct and Management. For | ||
* example, 'Legacy, RoleBased'. | ||
*/ | ||
@JsonProperty(value = "authorizationSource") | ||
private String authorizationSource; | ||
|
||
/** | ||
* Get the fully qualified ID for the subscription. For example, /subscriptions/00000000-0000-0000-0000-000000000000. | ||
* | ||
* @return the id value | ||
*/ | ||
public String id() { | ||
return this.id; | ||
} | ||
|
||
/** | ||
* Get the subscription ID. | ||
* | ||
* @return the subscriptionId value | ||
*/ | ||
public String subscriptionId() { | ||
return this.subscriptionId; | ||
} | ||
|
||
/** | ||
* Get the subscription display name. | ||
* | ||
* @return the displayName value | ||
*/ | ||
public String displayName() { | ||
return this.displayName; | ||
} | ||
|
||
/** | ||
* Get the subscription tenant ID. | ||
* | ||
* @return the tenantId value | ||
*/ | ||
public String tenantId() { | ||
return this.tenantId; | ||
} | ||
|
||
/** | ||
* Get the subscription state. Possible values are Enabled, Warned, PastDue, Disabled, and Deleted. Possible values include: 'Enabled', 'Warned', 'PastDue', 'Disabled', 'Deleted'. | ||
* | ||
* @return the state value | ||
*/ | ||
public SubscriptionState state() { | ||
return this.state; | ||
} | ||
|
||
/** | ||
* Get the subscription policies. | ||
* | ||
* @return the subscriptionPolicies value | ||
*/ | ||
public SubscriptionPolicies subscriptionPolicies() { | ||
return this.subscriptionPolicies; | ||
} | ||
|
||
/** | ||
* Set the subscription policies. | ||
* | ||
* @param subscriptionPolicies the subscriptionPolicies value to set | ||
* @return the SubscriptionInner object itself. | ||
*/ | ||
public SubscriptionInner withSubscriptionPolicies(SubscriptionPolicies subscriptionPolicies) { | ||
this.subscriptionPolicies = subscriptionPolicies; | ||
return this; | ||
} | ||
|
||
/** | ||
* Get the authorization source of the request. Valid values are one or more combinations of Legacy, RoleBased, Bypassed, Direct and Management. For example, 'Legacy, RoleBased'. | ||
* | ||
* @return the authorizationSource value | ||
*/ | ||
public String authorizationSource() { | ||
return this.authorizationSource; | ||
} | ||
|
||
/** | ||
* Set the authorization source of the request. Valid values are one or more combinations of Legacy, RoleBased, Bypassed, Direct and Management. For example, 'Legacy, RoleBased'. | ||
* | ||
* @param authorizationSource the authorizationSource value to set | ||
* @return the SubscriptionInner object itself. | ||
*/ | ||
public SubscriptionInner withAuthorizationSource(String authorizationSource) { | ||
this.authorizationSource = authorizationSource; | ||
return this; | ||
} | ||
|
||
} |
85 changes: 85 additions & 0 deletions
85
...om/microsoft/azure/management/resources/v2018_06_01/implementation/SubscriptionsImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/** | ||
* 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.resources.v2018_06_01.implementation; | ||
|
||
import com.microsoft.azure.arm.model.implementation.WrapperImpl; | ||
import com.microsoft.azure.management.resources.v2018_06_01.Subscriptions; | ||
import rx.functions.Func1; | ||
import rx.Observable; | ||
import com.microsoft.azure.Page; | ||
import com.microsoft.azure.management.resources.v2018_06_01.Subscription; | ||
import java.util.List; | ||
import com.microsoft.azure.management.resources.v2018_06_01.Location; | ||
|
||
class SubscriptionsImpl extends WrapperImpl<SubscriptionsInner> implements Subscriptions { | ||
private final ResourcesManager manager; | ||
|
||
SubscriptionsImpl(ResourcesManager manager) { | ||
super(manager.inner().subscriptions()); | ||
this.manager = manager; | ||
} | ||
|
||
public ResourcesManager manager() { | ||
return this.manager; | ||
} | ||
|
||
@Override | ||
public Observable<Subscription> getAsync(String subscriptionId) { | ||
SubscriptionsInner client = this.inner(); | ||
return client.getAsync(subscriptionId) | ||
.map(new Func1<SubscriptionInner, Subscription>() { | ||
@Override | ||
public Subscription call(SubscriptionInner inner) { | ||
return new SubscriptionImpl(inner, manager()); | ||
} | ||
}); | ||
} | ||
|
||
@Override | ||
public Observable<Subscription> listAsync() { | ||
SubscriptionsInner client = this.inner(); | ||
return client.listAsync() | ||
.flatMapIterable(new Func1<Page<SubscriptionInner>, Iterable<SubscriptionInner>>() { | ||
@Override | ||
public Iterable<SubscriptionInner> call(Page<SubscriptionInner> page) { | ||
return page.items(); | ||
} | ||
}) | ||
.map(new Func1<SubscriptionInner, Subscription>() { | ||
@Override | ||
public Subscription call(SubscriptionInner inner) { | ||
return new SubscriptionImpl(inner, manager()); | ||
} | ||
}); | ||
} | ||
|
||
private LocationImpl wrapLocationModel(LocationInner inner) { | ||
return new LocationImpl(inner, manager()); | ||
} | ||
|
||
@Override | ||
public Observable<Location> listLocationsAsync(String subscriptionId) { | ||
SubscriptionsInner client = this.inner(); | ||
return client.listLocationsAsync(subscriptionId) | ||
.flatMap(new Func1<List<LocationInner>, Observable<LocationInner>>() { | ||
@Override | ||
public Observable<LocationInner> call(List<LocationInner> innerList) { | ||
return Observable.from(innerList); | ||
} | ||
}) | ||
.map(new Func1<LocationInner, Location>() { | ||
@Override | ||
public Location call(LocationInner inner) { | ||
return wrapLocationModel(inner); | ||
} | ||
}); | ||
} | ||
|
||
} |
454 changes: 454 additions & 0 deletions
454
...m/microsoft/azure/management/resources/v2018_06_01/implementation/SubscriptionsInner.java
Large diffs are not rendered by default.
Oops, something went wrong.
57 changes: 57 additions & 0 deletions
57
...rosoft/azure/management/resources/v2018_06_01/implementation/TenantIdDescriptionImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.resources.v2018_06_01.implementation; | ||
|
||
import com.microsoft.azure.management.resources.v2018_06_01.TenantIdDescription; | ||
import com.microsoft.azure.arm.model.implementation.WrapperImpl; | ||
import java.util.List; | ||
|
||
class TenantIdDescriptionImpl extends WrapperImpl<TenantIdDescriptionInner> implements TenantIdDescription { | ||
private final ResourcesManager manager; | ||
TenantIdDescriptionImpl(TenantIdDescriptionInner inner, ResourcesManager manager) { | ||
super(inner); | ||
this.manager = manager; | ||
} | ||
|
||
@Override | ||
public ResourcesManager manager() { | ||
return this.manager; | ||
} | ||
|
||
@Override | ||
public String country() { | ||
return this.inner().country(); | ||
} | ||
|
||
@Override | ||
public String countryCode() { | ||
return this.inner().countryCode(); | ||
} | ||
|
||
@Override | ||
public String displayName() { | ||
return this.inner().displayName(); | ||
} | ||
|
||
@Override | ||
public List<String> domains() { | ||
return this.inner().domains(); | ||
} | ||
|
||
@Override | ||
public String id() { | ||
return this.inner().id(); | ||
} | ||
|
||
@Override | ||
public String tenantId() { | ||
return this.inner().tenantId(); | ||
} | ||
|
||
} |
109 changes: 109 additions & 0 deletions
109
...osoft/azure/management/resources/v2018_06_01/implementation/TenantIdDescriptionInner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
/** | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for | ||
* license information. | ||
* | ||
* Code generated by Microsoft (R) AutoRest Code Generator. | ||
*/ | ||
|
||
package com.microsoft.azure.management.resources.v2018_06_01.implementation; | ||
|
||
import java.util.List; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** | ||
* Tenant Id information. | ||
*/ | ||
public class TenantIdDescriptionInner { | ||
/** | ||
* The fully qualified ID of the tenant. For example, | ||
* /tenants/00000000-0000-0000-0000-000000000000. | ||
*/ | ||
@JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) | ||
private String id; | ||
|
||
/** | ||
* The tenant ID. For example, 00000000-0000-0000-0000-000000000000. | ||
*/ | ||
@JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) | ||
private String tenantId; | ||
|
||
/** | ||
* Country/region name of the address for the tenant. | ||
*/ | ||
@JsonProperty(value = "country", access = JsonProperty.Access.WRITE_ONLY) | ||
private String country; | ||
|
||
/** | ||
* Country/region abbreviation for the tenant. | ||
*/ | ||
@JsonProperty(value = "countryCode", access = JsonProperty.Access.WRITE_ONLY) | ||
private String countryCode; | ||
|
||
/** | ||
* The display name of the tenant. | ||
*/ | ||
@JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) | ||
private String displayName; | ||
|
||
/** | ||
* The list of domains for the tenant. | ||
*/ | ||
@JsonProperty(value = "domains", access = JsonProperty.Access.WRITE_ONLY) | ||
private List<String> domains; | ||
|
||
/** | ||
* Get the fully qualified ID of the tenant. For example, /tenants/00000000-0000-0000-0000-000000000000. | ||
* | ||
* @return the id value | ||
*/ | ||
public String id() { | ||
return this.id; | ||
} | ||
|
||
/** | ||
* Get the tenant ID. For example, 00000000-0000-0000-0000-000000000000. | ||
* | ||
* @return the tenantId value | ||
*/ | ||
public String tenantId() { | ||
return this.tenantId; | ||
} | ||
|
||
/** | ||
* Get country/region name of the address for the tenant. | ||
* | ||
* @return the country value | ||
*/ | ||
public String country() { | ||
return this.country; | ||
} | ||
|
||
/** | ||
* Get country/region abbreviation for the tenant. | ||
* | ||
* @return the countryCode value | ||
*/ | ||
public String countryCode() { | ||
return this.countryCode; | ||
} | ||
|
||
/** | ||
* Get the display name of the tenant. | ||
* | ||
* @return the displayName value | ||
*/ | ||
public String displayName() { | ||
return this.displayName; | ||
} | ||
|
||
/** | ||
* Get the list of domains for the tenant. | ||
* | ||
* @return the domains value | ||
*/ | ||
public List<String> domains() { | ||
return this.domains; | ||
} | ||
|
||
} |
49 changes: 49 additions & 0 deletions
49
...java/com/microsoft/azure/management/resources/v2018_06_01/implementation/TenantsImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.resources.v2018_06_01.implementation; | ||
|
||
import com.microsoft.azure.arm.model.implementation.WrapperImpl; | ||
import com.microsoft.azure.management.resources.v2018_06_01.Tenants; | ||
import rx.functions.Func1; | ||
import rx.Observable; | ||
import com.microsoft.azure.Page; | ||
import com.microsoft.azure.management.resources.v2018_06_01.TenantIdDescription; | ||
|
||
class TenantsImpl extends WrapperImpl<TenantsInner> implements Tenants { | ||
private final ResourcesManager manager; | ||
|
||
TenantsImpl(ResourcesManager manager) { | ||
super(manager.inner().tenants()); | ||
this.manager = manager; | ||
} | ||
|
||
public ResourcesManager manager() { | ||
return this.manager; | ||
} | ||
|
||
@Override | ||
public Observable<TenantIdDescription> listAsync() { | ||
TenantsInner client = this.inner(); | ||
return client.listAsync() | ||
.flatMapIterable(new Func1<Page<TenantIdDescriptionInner>, Iterable<TenantIdDescriptionInner>>() { | ||
@Override | ||
public Iterable<TenantIdDescriptionInner> call(Page<TenantIdDescriptionInner> page) { | ||
return page.items(); | ||
} | ||
}) | ||
.map(new Func1<TenantIdDescriptionInner, TenantIdDescription>() { | ||
@Override | ||
public TenantIdDescription call(TenantIdDescriptionInner inner) { | ||
return new TenantIdDescriptionImpl(inner, manager()); | ||
} | ||
}); | ||
} | ||
|
||
} |
283 changes: 283 additions & 0 deletions
283
...ava/com/microsoft/azure/management/resources/v2018_06_01/implementation/TenantsInner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,283 @@ | ||
/** | ||
* 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.resources.v2018_06_01.implementation; | ||
|
||
import retrofit2.Retrofit; | ||
import com.google.common.reflect.TypeToken; | ||
import com.microsoft.azure.AzureServiceFuture; | ||
import com.microsoft.azure.CloudException; | ||
import com.microsoft.azure.ListOperationCallback; | ||
import com.microsoft.azure.Page; | ||
import com.microsoft.azure.PagedList; | ||
import com.microsoft.rest.ServiceFuture; | ||
import com.microsoft.rest.ServiceResponse; | ||
import java.io.IOException; | ||
import java.util.List; | ||
import okhttp3.ResponseBody; | ||
import retrofit2.http.GET; | ||
import retrofit2.http.Header; | ||
import retrofit2.http.Headers; | ||
import retrofit2.http.Query; | ||
import retrofit2.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 Tenants. | ||
*/ | ||
public class TenantsInner { | ||
/** The Retrofit service to perform REST calls. */ | ||
private TenantsService service; | ||
/** The service client containing this operation class. */ | ||
private SubscriptionClientImpl client; | ||
|
||
/** | ||
* Initializes an instance of TenantsInner. | ||
* | ||
* @param retrofit the Retrofit instance built from a Retrofit Builder. | ||
* @param client the instance of the service client containing this operation class. | ||
*/ | ||
public TenantsInner(Retrofit retrofit, SubscriptionClientImpl client) { | ||
this.service = retrofit.create(TenantsService.class); | ||
this.client = client; | ||
} | ||
|
||
/** | ||
* The interface defining all the services for Tenants to be | ||
* used by Retrofit to perform actually REST calls. | ||
*/ | ||
interface TenantsService { | ||
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.v2018_06_01.Tenants list" }) | ||
@GET("tenants") | ||
Observable<Response<ResponseBody>> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); | ||
|
||
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.v2018_06_01.Tenants listNext" }) | ||
@GET | ||
Observable<Response<ResponseBody>> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); | ||
|
||
} | ||
|
||
/** | ||
* Gets the tenants for your account. | ||
* | ||
* @throws IllegalArgumentException thrown if parameters fail the validation | ||
* @throws CloudException thrown if the request is rejected by server | ||
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent | ||
* @return the PagedList<TenantIdDescriptionInner> object if successful. | ||
*/ | ||
public PagedList<TenantIdDescriptionInner> list() { | ||
ServiceResponse<Page<TenantIdDescriptionInner>> response = listSinglePageAsync().toBlocking().single(); | ||
return new PagedList<TenantIdDescriptionInner>(response.body()) { | ||
@Override | ||
public Page<TenantIdDescriptionInner> nextPage(String nextPageLink) { | ||
return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); | ||
} | ||
}; | ||
} | ||
|
||
/** | ||
* Gets the tenants for your account. | ||
* | ||
* @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<List<TenantIdDescriptionInner>> listAsync(final ListOperationCallback<TenantIdDescriptionInner> serviceCallback) { | ||
return AzureServiceFuture.fromPageResponse( | ||
listSinglePageAsync(), | ||
new Func1<String, Observable<ServiceResponse<Page<TenantIdDescriptionInner>>>>() { | ||
@Override | ||
public Observable<ServiceResponse<Page<TenantIdDescriptionInner>>> call(String nextPageLink) { | ||
return listNextSinglePageAsync(nextPageLink); | ||
} | ||
}, | ||
serviceCallback); | ||
} | ||
|
||
/** | ||
* Gets the tenants for your account. | ||
* | ||
* @throws IllegalArgumentException thrown if parameters fail the validation | ||
* @return the observable to the PagedList<TenantIdDescriptionInner> object | ||
*/ | ||
public Observable<Page<TenantIdDescriptionInner>> listAsync() { | ||
return listWithServiceResponseAsync() | ||
.map(new Func1<ServiceResponse<Page<TenantIdDescriptionInner>>, Page<TenantIdDescriptionInner>>() { | ||
@Override | ||
public Page<TenantIdDescriptionInner> call(ServiceResponse<Page<TenantIdDescriptionInner>> response) { | ||
return response.body(); | ||
} | ||
}); | ||
} | ||
|
||
/** | ||
* Gets the tenants for your account. | ||
* | ||
* @throws IllegalArgumentException thrown if parameters fail the validation | ||
* @return the observable to the PagedList<TenantIdDescriptionInner> object | ||
*/ | ||
public Observable<ServiceResponse<Page<TenantIdDescriptionInner>>> listWithServiceResponseAsync() { | ||
return listSinglePageAsync() | ||
.concatMap(new Func1<ServiceResponse<Page<TenantIdDescriptionInner>>, Observable<ServiceResponse<Page<TenantIdDescriptionInner>>>>() { | ||
@Override | ||
public Observable<ServiceResponse<Page<TenantIdDescriptionInner>>> call(ServiceResponse<Page<TenantIdDescriptionInner>> page) { | ||
String nextPageLink = page.body().nextPageLink(); | ||
if (nextPageLink == null) { | ||
return Observable.just(page); | ||
} | ||
return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); | ||
} | ||
}); | ||
} | ||
|
||
/** | ||
* Gets the tenants for your account. | ||
* | ||
* @throws IllegalArgumentException thrown if parameters fail the validation | ||
* @return the PagedList<TenantIdDescriptionInner> object wrapped in {@link ServiceResponse} if successful. | ||
*/ | ||
public Observable<ServiceResponse<Page<TenantIdDescriptionInner>>> listSinglePageAsync() { | ||
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<Response<ResponseBody>, Observable<ServiceResponse<Page<TenantIdDescriptionInner>>>>() { | ||
@Override | ||
public Observable<ServiceResponse<Page<TenantIdDescriptionInner>>> call(Response<ResponseBody> response) { | ||
try { | ||
ServiceResponse<PageImpl<TenantIdDescriptionInner>> result = listDelegate(response); | ||
return Observable.just(new ServiceResponse<Page<TenantIdDescriptionInner>>(result.body(), result.response())); | ||
} catch (Throwable t) { | ||
return Observable.error(t); | ||
} | ||
} | ||
}); | ||
} | ||
|
||
private ServiceResponse<PageImpl<TenantIdDescriptionInner>> listDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { | ||
return this.client.restClient().responseBuilderFactory().<PageImpl<TenantIdDescriptionInner>, CloudException>newInstance(this.client.serializerAdapter()) | ||
.register(200, new TypeToken<PageImpl<TenantIdDescriptionInner>>() { }.getType()) | ||
.registerError(CloudException.class) | ||
.build(response); | ||
} | ||
|
||
/** | ||
* Gets the tenants for your account. | ||
* | ||
* @param nextPageLink The NextLink from the previous successful call to List operation. | ||
* @throws IllegalArgumentException thrown if parameters fail the validation | ||
* @throws CloudException thrown if the request is rejected by server | ||
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent | ||
* @return the PagedList<TenantIdDescriptionInner> object if successful. | ||
*/ | ||
public PagedList<TenantIdDescriptionInner> listNext(final String nextPageLink) { | ||
ServiceResponse<Page<TenantIdDescriptionInner>> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); | ||
return new PagedList<TenantIdDescriptionInner>(response.body()) { | ||
@Override | ||
public Page<TenantIdDescriptionInner> nextPage(String nextPageLink) { | ||
return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); | ||
} | ||
}; | ||
} | ||
|
||
/** | ||
* Gets the tenants for your account. | ||
* | ||
* @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<List<TenantIdDescriptionInner>> listNextAsync(final String nextPageLink, final ServiceFuture<List<TenantIdDescriptionInner>> serviceFuture, final ListOperationCallback<TenantIdDescriptionInner> serviceCallback) { | ||
return AzureServiceFuture.fromPageResponse( | ||
listNextSinglePageAsync(nextPageLink), | ||
new Func1<String, Observable<ServiceResponse<Page<TenantIdDescriptionInner>>>>() { | ||
@Override | ||
public Observable<ServiceResponse<Page<TenantIdDescriptionInner>>> call(String nextPageLink) { | ||
return listNextSinglePageAsync(nextPageLink); | ||
} | ||
}, | ||
serviceCallback); | ||
} | ||
|
||
/** | ||
* Gets the tenants for your account. | ||
* | ||
* @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<TenantIdDescriptionInner> object | ||
*/ | ||
public Observable<Page<TenantIdDescriptionInner>> listNextAsync(final String nextPageLink) { | ||
return listNextWithServiceResponseAsync(nextPageLink) | ||
.map(new Func1<ServiceResponse<Page<TenantIdDescriptionInner>>, Page<TenantIdDescriptionInner>>() { | ||
@Override | ||
public Page<TenantIdDescriptionInner> call(ServiceResponse<Page<TenantIdDescriptionInner>> response) { | ||
return response.body(); | ||
} | ||
}); | ||
} | ||
|
||
/** | ||
* Gets the tenants for your account. | ||
* | ||
* @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<TenantIdDescriptionInner> object | ||
*/ | ||
public Observable<ServiceResponse<Page<TenantIdDescriptionInner>>> listNextWithServiceResponseAsync(final String nextPageLink) { | ||
return listNextSinglePageAsync(nextPageLink) | ||
.concatMap(new Func1<ServiceResponse<Page<TenantIdDescriptionInner>>, Observable<ServiceResponse<Page<TenantIdDescriptionInner>>>>() { | ||
@Override | ||
public Observable<ServiceResponse<Page<TenantIdDescriptionInner>>> call(ServiceResponse<Page<TenantIdDescriptionInner>> page) { | ||
String nextPageLink = page.body().nextPageLink(); | ||
if (nextPageLink == null) { | ||
return Observable.just(page); | ||
} | ||
return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); | ||
} | ||
}); | ||
} | ||
|
||
/** | ||
* Gets the tenants for your account. | ||
* | ||
ServiceResponse<PageImpl<TenantIdDescriptionInner>> * @param nextPageLink The NextLink from the previous successful call to List operation. | ||
* @throws IllegalArgumentException thrown if parameters fail the validation | ||
* @return the PagedList<TenantIdDescriptionInner> object wrapped in {@link ServiceResponse} if successful. | ||
*/ | ||
public Observable<ServiceResponse<Page<TenantIdDescriptionInner>>> 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<Response<ResponseBody>, Observable<ServiceResponse<Page<TenantIdDescriptionInner>>>>() { | ||
@Override | ||
public Observable<ServiceResponse<Page<TenantIdDescriptionInner>>> call(Response<ResponseBody> response) { | ||
try { | ||
ServiceResponse<PageImpl<TenantIdDescriptionInner>> result = listNextDelegate(response); | ||
return Observable.just(new ServiceResponse<Page<TenantIdDescriptionInner>>(result.body(), result.response())); | ||
} catch (Throwable t) { | ||
return Observable.error(t); | ||
} | ||
} | ||
}); | ||
} | ||
|
||
private ServiceResponse<PageImpl<TenantIdDescriptionInner>> listNextDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { | ||
return this.client.restClient().responseBuilderFactory().<PageImpl<TenantIdDescriptionInner>, CloudException>newInstance(this.client.serializerAdapter()) | ||
.register(200, new TypeToken<PageImpl<TenantIdDescriptionInner>>() { }.getType()) | ||
.registerError(CloudException.class) | ||
.build(response); | ||
} | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
...ava/com/microsoft/azure/management/resources/v2018_06_01/implementation/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 SubscriptionClient. | ||
* All resource groups and resources exist within subscriptions. These operation enable you get information about your subscriptions and tenants. A tenant is a dedicated instance of Azure Active Directory (Azure AD) for your organization. | ||
*/ | ||
package com.microsoft.azure.management.resources.v2018_06_01.implementation; |
11 changes: 11 additions & 0 deletions
11
...6_01/src/main/java/com/microsoft/azure/management/resources/v2018_06_01/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 SubscriptionClient. | ||
* All resource groups and resources exist within subscriptions. These operation enable you get information about your subscriptions and tenants. A tenant is a dedicated instance of Azure Active Directory (Azure AD) for your organization. | ||
*/ | ||
package com.microsoft.azure.management.resources.v2018_06_01; |