From 18b8c2c1310e4901e0c57805eb27a13b839fa37a Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Sun, 8 Nov 2020 15:15:55 +0000 Subject: [PATCH] Generated from fd8fcf1bbb20ba667d09460a8f4183cd418d5d24 --- .../mgmt-2020-08-08-preview/pom.xml | 135 ++ .../2020-08-08-preview/ControllerDetails.java | 43 + .../ControllerResource.java | 17 + .../ControllerResourceUpdateParameters.java | 44 + .../2020-08-08-preview/ControllerState.java | 47 + .../2020-08-08-preview/Controllers.java | 62 + .../DelegatedController.java | 71 + .../2020-08-08-preview/DelegatedNetworks.java | 36 + .../2020-08-08-preview/DelegatedSubnet.java | 136 ++ .../DelegatedSubnetResource.java | 17 + .../DelegatedSubnetServices.java | 25 + .../DelegatedSubnetState.java | 47 + .../2020-08-08-preview/ErrorDefinition.java | 64 + .../2020-08-08-preview/ErrorResponse.java | 43 + .../ErrorResponseException.java | 44 + .../2020-08-08-preview/Operation.java | 45 + .../2020-08-08-preview/OperationDisplay.java | 77 + .../2020-08-08-preview/Operations.java | 27 + .../2020-08-08-preview/Orchestrator.java | 257 ++++ .../OrchestratorIdentity.java | 77 + .../OrchestratorInstanceServices.java | 25 + .../OrchestratorInstanceState.java | 47 + .../OrchestratorResource.java | 77 + .../OrchestratorResourceUpdateParameters.java | 44 + .../ResourceIdentityType.java | 53 + .../ResourceUpdateParameters.java | 44 + .../2020-08-08-preview/SubnetDetails.java | 43 + .../implementation/ControllersImpl.java | 73 + .../implementation/ControllersInner.java | 677 +++++++++ .../implementation/DNCImpl.java | 252 ++++ .../DelegatedControllerImpl.java | 78 + .../DelegatedControllerInner.java | 98 ++ .../DelegatedNetworkManager.java | 147 ++ .../implementation/DelegatedNetworksImpl.java | 67 + .../DelegatedNetworksInner.java | 522 +++++++ .../implementation/DelegatedSubnetImpl.java | 81 ++ .../implementation/DelegatedSubnetInner.java | 106 ++ .../DelegatedSubnetServicesImpl.java | 138 ++ .../DelegatedSubnetServicesInner.java | 1295 +++++++++++++++++ .../implementation/IdParsingUtils.java | 57 + .../implementation/OperationImpl.java | 52 + .../implementation/OperationInner.java | 138 ++ .../implementation/OperationsImpl.java | 49 + .../implementation/OperationsInner.java | 283 ++++ .../implementation/OrchestratorImpl.java | 136 ++ .../implementation/OrchestratorInner.java | 183 +++ .../OrchestratorInstanceServicesImpl.java | 138 ++ .../OrchestratorInstanceServicesInner.java | 1144 +++++++++++++++ .../implementation/PageImpl.java | 75 + .../implementation/package-info.java | 11 + .../2020-08-08-preview/package-info.java | 11 + 51 files changed, 7458 insertions(+) create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/pom.xml create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ControllerDetails.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ControllerResource.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ControllerResourceUpdateParameters.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ControllerState.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/Controllers.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/DelegatedController.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/DelegatedNetworks.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/DelegatedSubnet.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/DelegatedSubnetResource.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/DelegatedSubnetServices.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/DelegatedSubnetState.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ErrorDefinition.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ErrorResponse.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ErrorResponseException.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/Operation.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/OperationDisplay.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/Operations.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/Orchestrator.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/OrchestratorIdentity.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/OrchestratorInstanceServices.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/OrchestratorInstanceState.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/OrchestratorResource.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/OrchestratorResourceUpdateParameters.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ResourceIdentityType.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ResourceUpdateParameters.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/SubnetDetails.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/ControllersImpl.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/ControllersInner.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DNCImpl.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedControllerImpl.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedControllerInner.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedNetworkManager.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedNetworksImpl.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedNetworksInner.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedSubnetImpl.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedSubnetInner.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedSubnetServicesImpl.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedSubnetServicesInner.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/IdParsingUtils.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/OperationImpl.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/OperationInner.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/OperationsImpl.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/OperationsInner.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/OrchestratorImpl.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/OrchestratorInner.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/OrchestratorInstanceServicesImpl.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/OrchestratorInstanceServicesInner.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/PageImpl.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/package-info.java create mode 100644 sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/package-info.java diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/pom.xml b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/pom.xml new file mode 100644 index 000000000000..ab7c391845c9 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.DelegatedNetwork.2020-08-08-preview + + com.microsoft.azure + azure-arm-parent + 1.1.0 + ../../../pom.management.xml + + azure-mgmt-delegatednetwork + 1.0.0-beta + jar + Microsoft Azure SDK for DelegatedNetwork Management + This package contains Microsoft DelegatedNetwork Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + 1.6.5 + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ControllerDetails.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ControllerDetails.java new file mode 100644 index 000000000000..2e2da905f671 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ControllerDetails.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.delegatednetwork.2020-08-08-preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * controller details. + */ +public class ControllerDetails { + /** + * controller arm resource id. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get controller arm resource id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set controller arm resource id. + * + * @param id the id value to set + * @return the ControllerDetails object itself. + */ + public ControllerDetails withId(String id) { + this.id = id; + return this; + } + +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ControllerResource.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ControllerResource.java new file mode 100644 index 000000000000..48ee4ff5e967 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ControllerResource.java @@ -0,0 +1,17 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.delegatednetwork.2020-08-08-preview; + +import com.microsoft.azure.Resource; + +/** + * Represents an instance of a resource. + */ +public class ControllerResource extends Resource { +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ControllerResourceUpdateParameters.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ControllerResourceUpdateParameters.java new file mode 100644 index 000000000000..0f9a8fe96878 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ControllerResourceUpdateParameters.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.delegatednetwork.2020-08-08-preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters for updating a resource. + */ +public class ControllerResourceUpdateParameters { + /** + * The resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the resource tags. + * + * @param tags the tags value to set + * @return the ControllerResourceUpdateParameters object itself. + */ + public ControllerResourceUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ControllerState.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ControllerState.java new file mode 100644 index 000000000000..c2fb174d00a9 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ControllerState.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.delegatednetwork.2020-08-08-preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ControllerState. + */ +public final class ControllerState extends ExpandableStringEnum { + /** Static value Deleting for ControllerState. */ + public static final ControllerState DELETING = fromString("Deleting"); + + /** Static value Succeeded for ControllerState. */ + public static final ControllerState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ControllerState. */ + public static final ControllerState FAILED = fromString("Failed"); + + /** Static value Provisioning for ControllerState. */ + public static final ControllerState PROVISIONING = fromString("Provisioning"); + + /** + * Creates or finds a ControllerState from its string representation. + * @param name a name to look for + * @return the corresponding ControllerState + */ + @JsonCreator + public static ControllerState fromString(String name) { + return fromString(name, ControllerState.class); + } + + /** + * @return known ControllerState values + */ + public static Collection values() { + return values(ControllerState.class); + } +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/Controllers.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/Controllers.java new file mode 100644 index 000000000000..c98bf658aa41 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/Controllers.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.delegatednetwork.2020-08-08-preview; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.implementation.DelegatedControllerInner; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.implementation.ControllersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Controllers. + */ +public interface Controllers extends HasInner { + /** + * Gets details about the specified dnc controller. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getByResourceGroupAsync(String resourceGroupName, String resourceName); + + /** + * Create a dnc controller. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param parameters controller type parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable createAsync(String resourceGroupName, String resourceName, DelegatedControllerInner parameters); + + /** + * Deletes the DNC controller. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String resourceName); + + /** + * Update dnc controller. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable patchAsync(String resourceGroupName, String resourceName); + +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/DelegatedController.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/DelegatedController.java new file mode 100644 index 000000000000..b5cdb8eb1493 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/DelegatedController.java @@ -0,0 +1,71 @@ +/** + * 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.delegatednetwork.2020-08-08-preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.implementation.DelegatedNetworkManager; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.implementation.DelegatedControllerInner; +import java.util.Map; + +/** + * Type representing DelegatedController. + */ +public interface DelegatedController extends HasInner, HasManager { + /** + * @return the dncAppId value. + */ + String dncAppId(); + + /** + * @return the dncEndpoint value. + */ + String dncEndpoint(); + + /** + * @return the dncTenantId value. + */ + String dncTenantId(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ControllerState provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/DelegatedNetworks.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/DelegatedNetworks.java new file mode 100644 index 000000000000..2c969886af47 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/DelegatedNetworks.java @@ -0,0 +1,36 @@ +/** + * 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.delegatednetwork.2020-08-08-preview; + +import rx.Observable; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.implementation.DelegatedNetworksInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing DelegatedNetworks. + */ +public interface DelegatedNetworks extends HasInner { + /** + * Get all the delegatedController resources in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + + /** + * Get all the delegatedController resources in a resource group. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByResourceGroupAsync(final String resourceGroupName); + +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/DelegatedSubnet.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/DelegatedSubnet.java new file mode 100644 index 000000000000..a6b712780900 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/DelegatedSubnet.java @@ -0,0 +1,136 @@ +/** + * 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.delegatednetwork.2020-08-08-preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.implementation.DelegatedNetworkManager; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.implementation.DelegatedSubnetInner; + +/** + * Type representing DelegatedSubnet. + */ +public interface DelegatedSubnet extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the controllerDetails value. + */ + ControllerDetails controllerDetails(); + + /** + * @return the provisioningState value. + */ + DelegatedSubnetState provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the subnetDetails value. + */ + SubnetDetails subnetDetails(); + + /** + * The entirety of the DelegatedSubnet definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of DelegatedSubnet definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a DelegatedSubnet definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the DelegatedSubnet definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the delegatedsubnet definition allowing to specify ControllerDetails. + */ + interface WithControllerDetails { + /** + * Specifies controllerDetails. + * @param controllerDetails controller details + * @return the next definition stage + */ + WithCreate withControllerDetails(ControllerDetails controllerDetails); + } + + /** + * The stage of the delegatedsubnet definition allowing to specify SubnetDetails. + */ + interface WithSubnetDetails { + /** + * Specifies subnetDetails. + * @param subnetDetails orchestrator details + * @return the next definition stage + */ + WithCreate withSubnetDetails(SubnetDetails subnetDetails); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithControllerDetails, DefinitionStages.WithSubnetDetails { + } + } + /** + * The template for a DelegatedSubnet update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithControllerDetails, UpdateStages.WithSubnetDetails { + } + + /** + * Grouping of DelegatedSubnet update stages. + */ + interface UpdateStages { + /** + * The stage of the delegatedsubnet update allowing to specify ControllerDetails. + */ + interface WithControllerDetails { + /** + * Specifies controllerDetails. + * @param controllerDetails controller details + * @return the next update stage + */ + Update withControllerDetails(ControllerDetails controllerDetails); + } + + /** + * The stage of the delegatedsubnet update allowing to specify SubnetDetails. + */ + interface WithSubnetDetails { + /** + * Specifies subnetDetails. + * @param subnetDetails orchestrator details + * @return the next update stage + */ + Update withSubnetDetails(SubnetDetails subnetDetails); + } + + } +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/DelegatedSubnetResource.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/DelegatedSubnetResource.java new file mode 100644 index 000000000000..9e0f95c22e42 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/DelegatedSubnetResource.java @@ -0,0 +1,17 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.delegatednetwork.2020-08-08-preview; + +import com.microsoft.azure.Resource; + +/** + * Represents an instance of a resource. + */ +public class DelegatedSubnetResource extends Resource { +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/DelegatedSubnetServices.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/DelegatedSubnetServices.java new file mode 100644 index 000000000000..766512eaeda4 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/DelegatedSubnetServices.java @@ -0,0 +1,25 @@ +/** + * 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.delegatednetwork.2020-08-08-preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.implementation.DelegatedSubnetServicesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing DelegatedSubnetServices. + */ +public interface DelegatedSubnetServices extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/DelegatedSubnetState.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/DelegatedSubnetState.java new file mode 100644 index 000000000000..120dcb15926a --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/DelegatedSubnetState.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.delegatednetwork.2020-08-08-preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DelegatedSubnetState. + */ +public final class DelegatedSubnetState extends ExpandableStringEnum { + /** Static value Deleting for DelegatedSubnetState. */ + public static final DelegatedSubnetState DELETING = fromString("Deleting"); + + /** Static value Succeeded for DelegatedSubnetState. */ + public static final DelegatedSubnetState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for DelegatedSubnetState. */ + public static final DelegatedSubnetState FAILED = fromString("Failed"); + + /** Static value Provisioning for DelegatedSubnetState. */ + public static final DelegatedSubnetState PROVISIONING = fromString("Provisioning"); + + /** + * Creates or finds a DelegatedSubnetState from its string representation. + * @param name a name to look for + * @return the corresponding DelegatedSubnetState + */ + @JsonCreator + public static DelegatedSubnetState fromString(String name) { + return fromString(name, DelegatedSubnetState.class); + } + + /** + * @return known DelegatedSubnetState values + */ + public static Collection values() { + return values(DelegatedSubnetState.class); + } +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ErrorDefinition.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ErrorDefinition.java new file mode 100644 index 000000000000..f9f488017891 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ErrorDefinition.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.delegatednetwork.2020-08-08-preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error definition. + */ +public class ErrorDefinition { + /** + * Service specific error code which serves as the substatus for the HTTP + * error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * Description of the error. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Internal error details. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /** + * Get service specific error code which serves as the substatus for the HTTP error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get description of the error. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get internal error details. + * + * @return the details value + */ + public List details() { + return this.details; + } + +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ErrorResponse.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ErrorResponse.java new file mode 100644 index 000000000000..009fb4b30748 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ErrorResponse.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.delegatednetwork.2020-08-08-preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error response. + */ +public class ErrorResponse { + /** + * Error description. + */ + @JsonProperty(value = "error") + private ErrorDefinition error; + + /** + * Get error description. + * + * @return the error value + */ + public ErrorDefinition error() { + return this.error; + } + + /** + * Set error description. + * + * @param error the error value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withError(ErrorDefinition error) { + this.error = error; + return this; + } + +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ErrorResponseException.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ErrorResponseException.java new file mode 100644 index 000000000000..87c394cb2bb6 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ErrorResponseException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.delegatednetwork.2020-08-08-preview; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.body(); + } +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/Operation.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/Operation.java new file mode 100644 index 000000000000..04ae2cc9b1bc --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/Operation.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.delegatednetwork.2020-08-08-preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.implementation.DelegatedNetworkManager; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the origin value. + */ + String origin(); + + /** + * @return the properties value. + */ + Object properties(); + +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/OperationDisplay.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/OperationDisplay.java new file mode 100644 index 000000000000..a0993da7daed --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/OperationDisplay.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.delegatednetwork.2020-08-08-preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object that represents the operation. + */ +public class OperationDisplay { + /** + * Service provider: Microsoft.DelegatedNetwork. + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** + * Resource on which the operation is performed: controller, etc. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /** + * Operation type: create, get, delete, etc. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * Friendly description for the operation,. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get service provider: Microsoft.DelegatedNetwork. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Get resource on which the operation is performed: controller, etc. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Get operation type: create, get, delete, etc. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Get friendly description for the operation,. + * + * @return the description value + */ + public String description() { + return this.description; + } + +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/Operations.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/Operations.java new file mode 100644 index 000000000000..54ce8a5d10ed --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.delegatednetwork.2020-08-08-preview; + +import rx.Observable; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available DelegatedNetwork service REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/Orchestrator.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/Orchestrator.java new file mode 100644 index 000000000000..2cb06fe4c281 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/Orchestrator.java @@ -0,0 +1,257 @@ +/** + * 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.delegatednetwork.2020-08-08-preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.implementation.DelegatedNetworkManager; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.implementation.OrchestratorInner; + +/** + * Type representing Orchestrator. + */ +public interface Orchestrator extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the apiServerEndpoint value. + */ + String apiServerEndpoint(); + + /** + * @return the clusterRootCA value. + */ + String clusterRootCA(); + + /** + * @return the controllerDetails value. + */ + ControllerDetails controllerDetails(); + + /** + * @return the identity value. + */ + OrchestratorIdentity identity(); + + /** + * @return the kind value. + */ + String kind(); + + /** + * @return the orchestratorAppId value. + */ + String orchestratorAppId(); + + /** + * @return the orchestratorTenantId value. + */ + String orchestratorTenantId(); + + /** + * @return the provisioningState value. + */ + OrchestratorInstanceState provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * The entirety of the Orchestrator definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithControllerDetails, DefinitionStages.WithKind, DefinitionStages.WithCreate { + } + + /** + * Grouping of Orchestrator definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Orchestrator definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the Orchestrator definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the orchestrator definition allowing to specify ControllerDetails. + */ + interface WithControllerDetails { + /** + * Specifies controllerDetails. + * @param controllerDetails controller details + * @return the next definition stage +*/ + WithKind withControllerDetails(ControllerDetails controllerDetails); + } + + /** + * The stage of the orchestrator definition allowing to specify Kind. + */ + interface WithKind { + /** + * Specifies kind. + * @param kind The kind of workbook. Choices are user and shared + * @return the next definition stage +*/ + WithCreate withKind(String kind); + } + + /** + * The stage of the orchestrator definition allowing to specify ApiServerEndpoint. + */ + interface WithApiServerEndpoint { + /** + * Specifies apiServerEndpoint. + * @param apiServerEndpoint K8s APIServer url + * @return the next definition stage + */ + WithCreate withApiServerEndpoint(String apiServerEndpoint); + } + + /** + * The stage of the orchestrator definition allowing to specify ClusterRootCA. + */ + interface WithClusterRootCA { + /** + * Specifies clusterRootCA. + * @param clusterRootCA RootCA certificate of kubernetes cluster base64 encoded + * @return the next definition stage + */ + WithCreate withClusterRootCA(String clusterRootCA); + } + + /** + * The stage of the orchestrator definition allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity The identity of the orchestrator + * @return the next definition stage + */ + WithCreate withIdentity(OrchestratorIdentity identity); + } + + /** + * The stage of the orchestrator definition allowing to specify OrchestratorAppId. + */ + interface WithOrchestratorAppId { + /** + * Specifies orchestratorAppId. + * @param orchestratorAppId AAD ID used with apiserver + * @return the next definition stage + */ + WithCreate withOrchestratorAppId(String orchestratorAppId); + } + + /** + * The stage of the orchestrator definition allowing to specify OrchestratorTenantId. + */ + interface WithOrchestratorTenantId { + /** + * Specifies orchestratorTenantId. + * @param orchestratorTenantId TenantID of server App ID + * @return the next definition stage + */ + WithCreate withOrchestratorTenantId(String orchestratorTenantId); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithApiServerEndpoint, DefinitionStages.WithClusterRootCA, DefinitionStages.WithIdentity, DefinitionStages.WithOrchestratorAppId, DefinitionStages.WithOrchestratorTenantId { + } + } + /** + * The template for a Orchestrator update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithApiServerEndpoint, UpdateStages.WithClusterRootCA, UpdateStages.WithIdentity, UpdateStages.WithOrchestratorAppId, UpdateStages.WithOrchestratorTenantId { + } + + /** + * Grouping of Orchestrator update stages. + */ + interface UpdateStages { + /** + * The stage of the orchestrator update allowing to specify ApiServerEndpoint. + */ + interface WithApiServerEndpoint { + /** + * Specifies apiServerEndpoint. + * @param apiServerEndpoint K8s APIServer url + * @return the next update stage + */ + Update withApiServerEndpoint(String apiServerEndpoint); + } + + /** + * The stage of the orchestrator update allowing to specify ClusterRootCA. + */ + interface WithClusterRootCA { + /** + * Specifies clusterRootCA. + * @param clusterRootCA RootCA certificate of kubernetes cluster base64 encoded + * @return the next update stage + */ + Update withClusterRootCA(String clusterRootCA); + } + + /** + * The stage of the orchestrator update allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity The identity of the orchestrator + * @return the next update stage + */ + Update withIdentity(OrchestratorIdentity identity); + } + + /** + * The stage of the orchestrator update allowing to specify OrchestratorAppId. + */ + interface WithOrchestratorAppId { + /** + * Specifies orchestratorAppId. + * @param orchestratorAppId AAD ID used with apiserver + * @return the next update stage + */ + Update withOrchestratorAppId(String orchestratorAppId); + } + + /** + * The stage of the orchestrator update allowing to specify OrchestratorTenantId. + */ + interface WithOrchestratorTenantId { + /** + * Specifies orchestratorTenantId. + * @param orchestratorTenantId TenantID of server App ID + * @return the next update stage + */ + Update withOrchestratorTenantId(String orchestratorTenantId); + } + + } +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/OrchestratorIdentity.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/OrchestratorIdentity.java new file mode 100644 index 000000000000..6d371278f9a3 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/OrchestratorIdentity.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.delegatednetwork.2020-08-08-preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The OrchestratorIdentity model. + */ +public class OrchestratorIdentity { + /** + * The principal id of the system assigned identity which is used by + * orchestrator. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /** + * The tenant id of the system assigned identity which is used by + * orchestrator. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /** + * The type of identity used for orchestrator cluster. Type + * 'SystemAssigned' will use an implicitly created identity orchestrator + * clusters. Possible values include: 'SystemAssigned', 'None'. + */ + @JsonProperty(value = "type") + private ResourceIdentityType type; + + /** + * Get the principal id of the system assigned identity which is used by orchestrator. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenant id of the system assigned identity which is used by orchestrator. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type of identity used for orchestrator cluster. Type 'SystemAssigned' will use an implicitly created identity orchestrator clusters. Possible values include: 'SystemAssigned', 'None'. + * + * @return the type value + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the type of identity used for orchestrator cluster. Type 'SystemAssigned' will use an implicitly created identity orchestrator clusters. Possible values include: 'SystemAssigned', 'None'. + * + * @param type the type value to set + * @return the OrchestratorIdentity object itself. + */ + public OrchestratorIdentity withType(ResourceIdentityType type) { + this.type = type; + return this; + } + +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/OrchestratorInstanceServices.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/OrchestratorInstanceServices.java new file mode 100644 index 000000000000..9724290b85ee --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/OrchestratorInstanceServices.java @@ -0,0 +1,25 @@ +/** + * 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.delegatednetwork.2020-08-08-preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.implementation.OrchestratorInstanceServicesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing OrchestratorInstanceServices. + */ +public interface OrchestratorInstanceServices extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/OrchestratorInstanceState.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/OrchestratorInstanceState.java new file mode 100644 index 000000000000..46045aff8b50 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/OrchestratorInstanceState.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.delegatednetwork.2020-08-08-preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for OrchestratorInstanceState. + */ +public final class OrchestratorInstanceState extends ExpandableStringEnum { + /** Static value Deleting for OrchestratorInstanceState. */ + public static final OrchestratorInstanceState DELETING = fromString("Deleting"); + + /** Static value Succeeded for OrchestratorInstanceState. */ + public static final OrchestratorInstanceState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for OrchestratorInstanceState. */ + public static final OrchestratorInstanceState FAILED = fromString("Failed"); + + /** Static value Provisioning for OrchestratorInstanceState. */ + public static final OrchestratorInstanceState PROVISIONING = fromString("Provisioning"); + + /** + * Creates or finds a OrchestratorInstanceState from its string representation. + * @param name a name to look for + * @return the corresponding OrchestratorInstanceState + */ + @JsonCreator + public static OrchestratorInstanceState fromString(String name) { + return fromString(name, OrchestratorInstanceState.class); + } + + /** + * @return known OrchestratorInstanceState values + */ + public static Collection values() { + return values(OrchestratorInstanceState.class); + } +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/OrchestratorResource.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/OrchestratorResource.java new file mode 100644 index 000000000000..7863501d2a69 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/OrchestratorResource.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.delegatednetwork.2020-08-08-preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Resource; + +/** + * Represents an instance of a resource. + */ +public class OrchestratorResource extends Resource { + /** + * The kind of workbook. Choices are user and shared. + */ + @JsonProperty(value = "kind", required = true) + private String kind; + + /** + * The identity of the orchestrator. + */ + @JsonProperty(value = "identity") + private OrchestratorIdentity identity; + + /** + * Creates an instance of OrchestratorResource class. + */ + public OrchestratorResource() { + kind = "Kubernetes"; + } + + /** + * Get the kind of workbook. Choices are user and shared. + * + * @return the kind value + */ + public String kind() { + return this.kind; + } + + /** + * Set the kind of workbook. Choices are user and shared. + * + * @param kind the kind value to set + * @return the OrchestratorResource object itself. + */ + public OrchestratorResource withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the identity of the orchestrator. + * + * @return the identity value + */ + public OrchestratorIdentity identity() { + return this.identity; + } + + /** + * Set the identity of the orchestrator. + * + * @param identity the identity value to set + * @return the OrchestratorResource object itself. + */ + public OrchestratorResource withIdentity(OrchestratorIdentity identity) { + this.identity = identity; + return this; + } + +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/OrchestratorResourceUpdateParameters.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/OrchestratorResourceUpdateParameters.java new file mode 100644 index 000000000000..f55f5c5c64c5 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/OrchestratorResourceUpdateParameters.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.delegatednetwork.2020-08-08-preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters for updating a resource. + */ +public class OrchestratorResourceUpdateParameters { + /** + * The resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the resource tags. + * + * @param tags the tags value to set + * @return the OrchestratorResourceUpdateParameters object itself. + */ + public OrchestratorResourceUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ResourceIdentityType.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ResourceIdentityType.java new file mode 100644 index 000000000000..6dc8538626d3 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ResourceIdentityType.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.delegatednetwork.2020-08-08-preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ResourceIdentityType. + */ +public enum ResourceIdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"), + + /** Enum value None. */ + NONE("None"); + + /** The actual serialized value for a ResourceIdentityType instance. */ + private String value; + + ResourceIdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResourceIdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed ResourceIdentityType object, or null if unable to parse. + */ + @JsonCreator + public static ResourceIdentityType fromString(String value) { + ResourceIdentityType[] items = ResourceIdentityType.values(); + for (ResourceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ResourceUpdateParameters.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ResourceUpdateParameters.java new file mode 100644 index 000000000000..afedd92b3b74 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/ResourceUpdateParameters.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.delegatednetwork.2020-08-08-preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters for updating a resource. + */ +public class ResourceUpdateParameters { + /** + * The resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the resource tags. + * + * @param tags the tags value to set + * @return the ResourceUpdateParameters object itself. + */ + public ResourceUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/SubnetDetails.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/SubnetDetails.java new file mode 100644 index 000000000000..f13a18f912b6 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/SubnetDetails.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.delegatednetwork.2020-08-08-preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of orchestrator. + */ +public class SubnetDetails { + /** + * subnet arm resource id. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get subnet arm resource id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set subnet arm resource id. + * + * @param id the id value to set + * @return the SubnetDetails object itself. + */ + public SubnetDetails withId(String id) { + this.id = id; + return this; + } + +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/ControllersImpl.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/ControllersImpl.java new file mode 100644 index 000000000000..8d6266623ba8 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/ControllersImpl.java @@ -0,0 +1,73 @@ +/** + * 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.delegatednetwork.2020-08-08-preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.Controllers; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.DelegatedController; + +class ControllersImpl extends WrapperImpl implements Controllers { + private final DelegatedNetworkManager manager; + + ControllersImpl(DelegatedNetworkManager manager) { + super(manager.inner().controllers()); + this.manager = manager; + } + + public DelegatedNetworkManager manager() { + return this.manager; + } + + @Override + public Observable getByResourceGroupAsync(String resourceGroupName, String resourceName) { + ControllersInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, resourceName) + .map(new Func1() { + @Override + public DelegatedController call(DelegatedControllerInner inner) { + return new DelegatedControllerImpl(inner, manager()); + } + }); + } + + @Override + public Observable createAsync(String resourceGroupName, String resourceName, DelegatedControllerInner parameters) { + ControllersInner client = this.inner(); + return client.createAsync(resourceGroupName, resourceName, parameters) + .map(new Func1() { + @Override + public DelegatedController call(DelegatedControllerInner inner) { + return new DelegatedControllerImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String resourceName) { + ControllersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, resourceName).toCompletable(); + } + + @Override + public Observable patchAsync(String resourceGroupName, String resourceName) { + ControllersInner client = this.inner(); + return client.patchAsync(resourceGroupName, resourceName) + .map(new Func1() { + @Override + public DelegatedController call(DelegatedControllerInner inner) { + return new DelegatedControllerImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/ControllersInner.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/ControllersInner.java new file mode 100644 index 000000000000..2df32df8a5cf --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/ControllersInner.java @@ -0,0 +1,677 @@ +/** + * 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.delegatednetwork.2020-08-08-preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.ControllerResourceUpdateParameters; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Controllers. + */ +public class ControllersInner implements InnerSupportsGet, InnerSupportsDelete { + /** The Retrofit service to perform REST calls. */ + private ControllersService service; + /** The service client containing this operation class. */ + private DNCImpl client; + + /** + * Initializes an instance of ControllersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ControllersInner(Retrofit retrofit, DNCImpl client) { + this.service = retrofit.create(ControllersService.class); + this.client = client; + } + + /** + * The interface defining all the services for Controllers to be + * used by Retrofit to perform actually REST calls. + */ + interface ControllersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.Controllers getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork/controller/{resourceName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.Controllers create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork/controller/{resourceName}") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body DelegatedControllerInner parameters, @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.delegatednetwork.2020-08-08-preview.Controllers beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork/controller/{resourceName}") + Observable> beginCreate(@Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body DelegatedControllerInner parameters, @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.delegatednetwork.2020-08-08-preview.Controllers delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork/controller/{resourceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.Controllers beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork/controller/{resourceName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.Controllers patch" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork/controller/{resourceName}") + Observable> patch(@Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ControllerResourceUpdateParameters parameters, @Header("User-Agent") String userAgent); + + } + + /** + * Gets details about the specified dnc controller. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DelegatedControllerInner object if successful. + */ + public DelegatedControllerInner getByResourceGroup(String resourceGroupName, String resourceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Gets details about the specified dnc controller. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Gets details about the specified dnc controller. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DelegatedControllerInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String resourceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, DelegatedControllerInner>() { + @Override + public DelegatedControllerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets details about the specified dnc controller. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DelegatedControllerInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(resourceGroupName, resourceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Create a dnc controller. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param parameters controller type parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DelegatedControllerInner object if successful. + */ + public DelegatedControllerInner create(String resourceGroupName, String resourceName, DelegatedControllerInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, resourceName, parameters).toBlocking().last().body(); + } + + /** + * Create a dnc controller. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param parameters controller type parameters + * @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 createAsync(String resourceGroupName, String resourceName, DelegatedControllerInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, resourceName, parameters), serviceCallback); + } + + /** + * Create a dnc controller. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param parameters controller type parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String resourceName, DelegatedControllerInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, resourceName, parameters).map(new Func1, DelegatedControllerInner>() { + @Override + public DelegatedControllerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a dnc controller. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param parameters controller type parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String resourceName, DelegatedControllerInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(resourceGroupName, resourceName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create a dnc controller. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param parameters controller type parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DelegatedControllerInner object if successful. + */ + public DelegatedControllerInner beginCreate(String resourceGroupName, String resourceName, DelegatedControllerInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, resourceName, parameters).toBlocking().single().body(); + } + + /** + * Create a dnc controller. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param parameters controller type parameters + * @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 beginCreateAsync(String resourceGroupName, String resourceName, DelegatedControllerInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, resourceName, parameters), serviceCallback); + } + + /** + * Create a dnc controller. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param parameters controller type parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DelegatedControllerInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String resourceName, DelegatedControllerInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, resourceName, parameters).map(new Func1, DelegatedControllerInner>() { + @Override + public DelegatedControllerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a dnc controller. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param parameters controller type parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DelegatedControllerInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String resourceName, DelegatedControllerInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(resourceGroupName, resourceName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes the DNC controller. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String resourceName) { + deleteWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().last().body(); + } + + /** + * Deletes the DNC controller. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Deletes the DNC controller. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String resourceName) { + return deleteWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the DNC controller. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(resourceGroupName, resourceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the DNC controller. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String resourceName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Deletes the DNC controller. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Deletes the DNC controller. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String resourceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the DNC controller. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(resourceGroupName, resourceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Update dnc controller. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DelegatedControllerInner object if successful. + */ + public DelegatedControllerInner patch(String resourceGroupName, String resourceName) { + return patchWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Update dnc controller. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @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 patchAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patchWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Update dnc controller. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DelegatedControllerInner object + */ + public Observable patchAsync(String resourceGroupName, String resourceName) { + return patchWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, DelegatedControllerInner>() { + @Override + public DelegatedControllerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update dnc controller. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DelegatedControllerInner object + */ + public Observable> patchWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Map tags = null; + ControllerResourceUpdateParameters parameters = new ControllerResourceUpdateParameters(); + parameters.withTags(null); + return service.patch(resourceGroupName, resourceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patchDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Update dnc controller. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param tags The resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DelegatedControllerInner object if successful. + */ + public DelegatedControllerInner patch(String resourceGroupName, String resourceName, Map tags) { + return patchWithServiceResponseAsync(resourceGroupName, resourceName, tags).toBlocking().single().body(); + } + + /** + * Update dnc controller. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param tags The resource tags. + * @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 patchAsync(String resourceGroupName, String resourceName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patchWithServiceResponseAsync(resourceGroupName, resourceName, tags), serviceCallback); + } + + /** + * Update dnc controller. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param tags The resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DelegatedControllerInner object + */ + public Observable patchAsync(String resourceGroupName, String resourceName, Map tags) { + return patchWithServiceResponseAsync(resourceGroupName, resourceName, tags).map(new Func1, DelegatedControllerInner>() { + @Override + public DelegatedControllerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update dnc controller. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param tags The resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DelegatedControllerInner object + */ + public Observable> patchWithServiceResponseAsync(String resourceGroupName, String resourceName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(tags); + ControllerResourceUpdateParameters parameters = new ControllerResourceUpdateParameters(); + parameters.withTags(tags); + return service.patch(resourceGroupName, resourceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patchDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse patchDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DNCImpl.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DNCImpl.java new file mode 100644 index 000000000000..08df68ca441c --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DNCImpl.java @@ -0,0 +1,252 @@ +/** + * 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.delegatednetwork.2020-08-08-preview.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 DNCImpl class. + */ +public class DNCImpl 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; + } + + /** A unique identifier for a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets A unique identifier for a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets A unique identifier for a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public DNCImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The client API version. */ + private String apiVersion; + + /** + * Gets The client API version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public DNCImpl 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 DNCImpl 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 DNCImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ControllersInner object to access its operations. + */ + private ControllersInner controllers; + + /** + * Gets the ControllersInner object to access its operations. + * @return the ControllersInner object. + */ + public ControllersInner controllers() { + return this.controllers; + } + + /** + * The DelegatedNetworksInner object to access its operations. + */ + private DelegatedNetworksInner delegatedNetworks; + + /** + * Gets the DelegatedNetworksInner object to access its operations. + * @return the DelegatedNetworksInner object. + */ + public DelegatedNetworksInner delegatedNetworks() { + return this.delegatedNetworks; + } + + /** + * The OrchestratorInstanceServicesInner object to access its operations. + */ + private OrchestratorInstanceServicesInner orchestratorInstanceServices; + + /** + * Gets the OrchestratorInstanceServicesInner object to access its operations. + * @return the OrchestratorInstanceServicesInner object. + */ + public OrchestratorInstanceServicesInner orchestratorInstanceServices() { + return this.orchestratorInstanceServices; + } + + /** + * The DelegatedSubnetServicesInner object to access its operations. + */ + private DelegatedSubnetServicesInner delegatedSubnetServices; + + /** + * Gets the DelegatedSubnetServicesInner object to access its operations. + * @return the DelegatedSubnetServicesInner object. + */ + public DelegatedSubnetServicesInner delegatedSubnetServices() { + return this.delegatedSubnetServices; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * Initializes an instance of DNC client. + * + * @param credentials the management credentials for Azure + */ + public DNCImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of DNC client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public DNCImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of DNC client. + * + * @param restClient the REST client to connect to Azure. + */ + public DNCImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2020-08-08-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.controllers = new ControllersInner(restClient().retrofit(), this); + this.delegatedNetworks = new DelegatedNetworksInner(restClient().retrofit(), this); + this.orchestratorInstanceServices = new OrchestratorInstanceServicesInner(restClient().retrofit(), this); + this.delegatedSubnetServices = new DelegatedSubnetServicesInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "DNC", "2020-08-08-preview"); + } +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedControllerImpl.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedControllerImpl.java new file mode 100644 index 000000000000..4d0a1e0a5e50 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedControllerImpl.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.implementation; + +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.DelegatedController; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.ControllerState; +import java.util.Map; + +class DelegatedControllerImpl extends WrapperImpl implements DelegatedController { + private final DelegatedNetworkManager manager; + DelegatedControllerImpl(DelegatedControllerInner inner, DelegatedNetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DelegatedNetworkManager manager() { + return this.manager; + } + + @Override + public String dncAppId() { + return this.inner().dncAppId(); + } + + @Override + public String dncEndpoint() { + return this.inner().dncEndpoint(); + } + + @Override + public String dncTenantId() { + return this.inner().dncTenantId(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ControllerState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedControllerInner.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedControllerInner.java new file mode 100644 index 000000000000..910481e2b13b --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedControllerInner.java @@ -0,0 +1,98 @@ +/** + * 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.delegatednetwork.2020-08-08-preview.implementation; + +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.ControllerState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.ControllerResource; + +/** + * Represents an instance of a DNC controller. + */ +@JsonFlatten +public class DelegatedControllerInner extends ControllerResource { + /** + * Resource guid. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /** + * The current state of dnc controller resource. Possible values include: + * 'Deleting', 'Succeeded', 'Failed', 'Provisioning'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ControllerState provisioningState; + + /** + * dnc application id should be used by customer to authenticate with dnc + * gateway. + */ + @JsonProperty(value = "properties.dncAppId", access = JsonProperty.Access.WRITE_ONLY) + private String dncAppId; + + /** + * tenant id of dnc application id. + */ + @JsonProperty(value = "properties.dncTenantId", access = JsonProperty.Access.WRITE_ONLY) + private String dncTenantId; + + /** + * dnc endpoint url that customers can use to connect to. + */ + @JsonProperty(value = "properties.dncEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private String dncEndpoint; + + /** + * Get resource guid. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the current state of dnc controller resource. Possible values include: 'Deleting', 'Succeeded', 'Failed', 'Provisioning'. + * + * @return the provisioningState value + */ + public ControllerState provisioningState() { + return this.provisioningState; + } + + /** + * Get dnc application id should be used by customer to authenticate with dnc gateway. + * + * @return the dncAppId value + */ + public String dncAppId() { + return this.dncAppId; + } + + /** + * Get tenant id of dnc application id. + * + * @return the dncTenantId value + */ + public String dncTenantId() { + return this.dncTenantId; + } + + /** + * Get dnc endpoint url that customers can use to connect to. + * + * @return the dncEndpoint value + */ + public String dncEndpoint() { + return this.dncEndpoint; + } + +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedNetworkManager.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedNetworkManager.java new file mode 100644 index 000000000000..2b81a3bbaeaf --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedNetworkManager.java @@ -0,0 +1,147 @@ +/** + * 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.delegatednetwork.2020-08-08-preview.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.delegatednetwork.2020-08-08-preview.Controllers; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.DelegatedNetworks; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.OrchestratorInstanceServices; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.DelegatedSubnetServices; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.Operations; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure DelegatedNetwork resource management. + */ +public final class DelegatedNetworkManager extends ManagerCore { + private Controllers controllers; + private DelegatedNetworks delegatedNetworks; + private OrchestratorInstanceServices orchestratorInstanceServices; + private DelegatedSubnetServices delegatedSubnetServices; + private Operations operations; + /** + * Get a Configurable instance that can be used to create DelegatedNetworkManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new DelegatedNetworkManager.ConfigurableImpl(); + } + /** + * Creates an instance of DelegatedNetworkManager that exposes DelegatedNetwork resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the DelegatedNetworkManager + */ + public static DelegatedNetworkManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new DelegatedNetworkManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of DelegatedNetworkManager that exposes DelegatedNetwork resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the DelegatedNetworkManager + */ + public static DelegatedNetworkManager authenticate(RestClient restClient, String subscriptionId) { + return new DelegatedNetworkManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of DelegatedNetworkManager that exposes DelegatedNetwork management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing DelegatedNetwork management API entry points that work across subscriptions + */ + DelegatedNetworkManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Controllers. + */ + public Controllers controllers() { + if (this.controllers == null) { + this.controllers = new ControllersImpl(this); + } + return this.controllers; + } + + /** + * @return Entry point to manage DelegatedNetworks. + */ + public DelegatedNetworks delegatedNetworks() { + if (this.delegatedNetworks == null) { + this.delegatedNetworks = new DelegatedNetworksImpl(this); + } + return this.delegatedNetworks; + } + + /** + * @return Entry point to manage OrchestratorInstanceServices. + */ + public OrchestratorInstanceServices orchestratorInstanceServices() { + if (this.orchestratorInstanceServices == null) { + this.orchestratorInstanceServices = new OrchestratorInstanceServicesImpl(this); + } + return this.orchestratorInstanceServices; + } + + /** + * @return Entry point to manage DelegatedSubnetServices. + */ + public DelegatedSubnetServices delegatedSubnetServices() { + if (this.delegatedSubnetServices == null) { + this.delegatedSubnetServices = new DelegatedSubnetServicesImpl(this); + } + return this.delegatedSubnetServices; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public DelegatedNetworkManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return DelegatedNetworkManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private DelegatedNetworkManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new DNCImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedNetworksImpl.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedNetworksImpl.java new file mode 100644 index 000000000000..8d1f4fef78ea --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedNetworksImpl.java @@ -0,0 +1,67 @@ +/** + * 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.delegatednetwork.2020-08-08-preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.DelegatedNetworks; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.DelegatedController; + +class DelegatedNetworksImpl extends WrapperImpl implements DelegatedNetworks { + private final DelegatedNetworkManager manager; + + DelegatedNetworksImpl(DelegatedNetworkManager manager) { + super(manager.inner().delegatedNetworks()); + this.manager = manager; + } + + public DelegatedNetworkManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + DelegatedNetworksInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DelegatedController call(DelegatedControllerInner inner) { + return new DelegatedControllerImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByResourceGroupAsync(final String resourceGroupName) { + DelegatedNetworksInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DelegatedController call(DelegatedControllerInner inner) { + return new DelegatedControllerImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedNetworksInner.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedNetworksInner.java new file mode 100644 index 000000000000..1cf94140ab2f --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedNetworksInner.java @@ -0,0 +1,522 @@ +/** + * 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.delegatednetwork.2020-08-08-preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in DelegatedNetworks. + */ +public class DelegatedNetworksInner implements InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private DelegatedNetworksService service; + /** The service client containing this operation class. */ + private DNCImpl client; + + /** + * Initializes an instance of DelegatedNetworksInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DelegatedNetworksInner(Retrofit retrofit, DNCImpl client) { + this.service = retrofit.create(DelegatedNetworksService.class); + this.client = client; + } + + /** + * The interface defining all the services for DelegatedNetworks to be + * used by Retrofit to perform actually REST calls. + */ + interface DelegatedNetworksService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.DelegatedNetworks list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DelegatedNetwork/controllers") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.DelegatedNetworks listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork/controllers") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.DelegatedNetworks listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.DelegatedNetworks listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get all the delegatedController resources in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DelegatedControllerInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all the delegatedController resources in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all the delegatedController resources in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DelegatedControllerInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all the delegatedController resources in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DelegatedControllerInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all the delegatedController resources in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DelegatedControllerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get all the delegatedController resources in a resource group. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DelegatedControllerInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all the delegatedController resources in a resource group. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all the delegatedController resources in a resource group. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DelegatedControllerInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all the delegatedController resources in a resource group. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DelegatedControllerInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all the delegatedController resources in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DelegatedControllerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get all the delegatedController resources in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DelegatedControllerInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all the delegatedController resources in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all the delegatedController resources in a subscription. + * + * @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<DelegatedControllerInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all the delegatedController resources in a subscription. + * + * @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<DelegatedControllerInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all the delegatedController resources in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DelegatedControllerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get all the delegatedController resources in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DelegatedControllerInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all the delegatedController resources in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all the delegatedController resources in a resource group. + * + * @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<DelegatedControllerInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all the delegatedController resources in a resource group. + * + * @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<DelegatedControllerInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all the delegatedController resources in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DelegatedControllerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedSubnetImpl.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedSubnetImpl.java new file mode 100644 index 000000000000..b13b06cade4f --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedSubnetImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.DelegatedSubnet; +import rx.Observable; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.DelegatedSubnetState; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.SubnetDetails; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.ControllerDetails; + +class DelegatedSubnetImpl extends GroupableResourceCoreImpl implements DelegatedSubnet, DelegatedSubnet.Definition, DelegatedSubnet.Update { + DelegatedSubnetImpl(String name, DelegatedSubnetInner inner, DelegatedNetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + DelegatedSubnetServicesInner client = this.manager().inner().delegatedSubnetServices(); + return client.putDetailsAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DelegatedSubnetServicesInner client = this.manager().inner().delegatedSubnetServices(); + return client.putDetailsAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DelegatedSubnetServicesInner client = this.manager().inner().delegatedSubnetServices(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public ControllerDetails controllerDetails() { + return this.inner().controllerDetails(); + } + + @Override + public DelegatedSubnetState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public SubnetDetails subnetDetails() { + return this.inner().subnetDetails(); + } + + @Override + public DelegatedSubnetImpl withControllerDetails(ControllerDetails controllerDetails) { + this.inner().withControllerDetails(controllerDetails); + return this; + } + + @Override + public DelegatedSubnetImpl withSubnetDetails(SubnetDetails subnetDetails) { + this.inner().withSubnetDetails(subnetDetails); + return this; + } + +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedSubnetInner.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedSubnetInner.java new file mode 100644 index 000000000000..2c2252d1531c --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedSubnetInner.java @@ -0,0 +1,106 @@ +/** + * 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.delegatednetwork.2020-08-08-preview.implementation; + +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.DelegatedSubnetState; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.SubnetDetails; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.ControllerDetails; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.DelegatedSubnetResource; + +/** + * Represents an instance of a orchestrator. + */ +@JsonFlatten +public class DelegatedSubnetInner extends DelegatedSubnetResource { + /** + * Resource guid. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /** + * The current state of dnc delegated subnet resource. Possible values + * include: 'Deleting', 'Succeeded', 'Failed', 'Provisioning'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private DelegatedSubnetState provisioningState; + + /** + * orchestrator details. + */ + @JsonProperty(value = "properties.subnetDetails") + private SubnetDetails subnetDetails; + + /** + * controller details. + */ + @JsonProperty(value = "properties.controllerDetails") + private ControllerDetails controllerDetails; + + /** + * Get resource guid. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the current state of dnc delegated subnet resource. Possible values include: 'Deleting', 'Succeeded', 'Failed', 'Provisioning'. + * + * @return the provisioningState value + */ + public DelegatedSubnetState provisioningState() { + return this.provisioningState; + } + + /** + * Get orchestrator details. + * + * @return the subnetDetails value + */ + public SubnetDetails subnetDetails() { + return this.subnetDetails; + } + + /** + * Set orchestrator details. + * + * @param subnetDetails the subnetDetails value to set + * @return the DelegatedSubnetInner object itself. + */ + public DelegatedSubnetInner withSubnetDetails(SubnetDetails subnetDetails) { + this.subnetDetails = subnetDetails; + return this; + } + + /** + * Get controller details. + * + * @return the controllerDetails value + */ + public ControllerDetails controllerDetails() { + return this.controllerDetails; + } + + /** + * Set controller details. + * + * @param controllerDetails the controllerDetails value to set + * @return the DelegatedSubnetInner object itself. + */ + public DelegatedSubnetInner withControllerDetails(ControllerDetails controllerDetails) { + this.controllerDetails = controllerDetails; + return this; + } + +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedSubnetServicesImpl.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedSubnetServicesImpl.java new file mode 100644 index 000000000000..eadf178727f1 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedSubnetServicesImpl.java @@ -0,0 +1,138 @@ +/** + * 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. + * def + */ + +package com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.DelegatedSubnetServices; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.DelegatedSubnet; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class DelegatedSubnetServicesImpl extends GroupableResourcesCoreImpl implements DelegatedSubnetServices { + protected DelegatedSubnetServicesImpl(DelegatedNetworkManager manager) { + super(manager.inner().delegatedSubnetServices(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + DelegatedSubnetServicesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + DelegatedSubnetServicesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + DelegatedSubnetServicesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + DelegatedSubnetServicesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DelegatedSubnet call(DelegatedSubnetInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + DelegatedSubnetServicesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + DelegatedSubnetServicesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DelegatedSubnet call(DelegatedSubnetInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public DelegatedSubnetImpl define(String name) { + return wrapModel(name); + } + + @Override + protected DelegatedSubnetImpl wrapModel(DelegatedSubnetInner inner) { + return new DelegatedSubnetImpl(inner.name(), inner, manager()); + } + + @Override + protected DelegatedSubnetImpl wrapModel(String name) { + return new DelegatedSubnetImpl(name, new DelegatedSubnetInner(), this.manager()); + } + +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedSubnetServicesInner.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedSubnetServicesInner.java new file mode 100644 index 000000000000..37e874454438 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/DelegatedSubnetServicesInner.java @@ -0,0 +1,1295 @@ +/** + * 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.delegatednetwork.2020-08-08-preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.ErrorResponseException; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.ResourceUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in DelegatedSubnetServices. + */ +public class DelegatedSubnetServicesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private DelegatedSubnetServicesService service; + /** The service client containing this operation class. */ + private DNCImpl client; + + /** + * Initializes an instance of DelegatedSubnetServicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DelegatedSubnetServicesInner(Retrofit retrofit, DNCImpl client) { + this.service = retrofit.create(DelegatedSubnetServicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for DelegatedSubnetServices to be + * used by Retrofit to perform actually REST calls. + */ + interface DelegatedSubnetServicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.DelegatedSubnetServices getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork/delegatedSubnets/{resourceName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.DelegatedSubnetServices putDetails" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork/delegatedSubnets/{resourceName}") + Observable> putDetails(@Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body DelegatedSubnetInner parameters, @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.delegatednetwork.2020-08-08-preview.DelegatedSubnetServices beginPutDetails" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork/delegatedSubnets/{resourceName}") + Observable> beginPutDetails(@Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body DelegatedSubnetInner parameters, @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.delegatednetwork.2020-08-08-preview.DelegatedSubnetServices patchDetails" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork/delegatedSubnets/{resourceName}") + Observable> patchDetails(@Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ResourceUpdateParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.DelegatedSubnetServices beginPatchDetails" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork/delegatedSubnets/{resourceName}") + Observable> beginPatchDetails(@Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ResourceUpdateParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.DelegatedSubnetServices delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork/delegatedSubnets/{resourceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.DelegatedSubnetServices beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork/delegatedSubnets/{resourceName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.DelegatedSubnetServices list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DelegatedNetwork/delegatedSubnets") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.DelegatedSubnetServices listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork/delegatedSubnets") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.DelegatedSubnetServices listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.DelegatedSubnetServices listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets details about the specified dnc DelegatedSubnet Link. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DelegatedSubnetInner object if successful. + */ + public DelegatedSubnetInner getByResourceGroup(String resourceGroupName, String resourceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Gets details about the specified dnc DelegatedSubnet Link. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Gets details about the specified dnc DelegatedSubnet Link. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DelegatedSubnetInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String resourceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, DelegatedSubnetInner>() { + @Override + public DelegatedSubnetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets details about the specified dnc DelegatedSubnet Link. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DelegatedSubnetInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(resourceGroupName, resourceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Put delegated subnet resource. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param parameters Delegated subnet details. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DelegatedSubnetInner object if successful. + */ + public DelegatedSubnetInner putDetails(String resourceGroupName, String resourceName, DelegatedSubnetInner parameters) { + return putDetailsWithServiceResponseAsync(resourceGroupName, resourceName, parameters).toBlocking().last().body(); + } + + /** + * Put delegated subnet resource. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param parameters Delegated subnet details. + * @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 putDetailsAsync(String resourceGroupName, String resourceName, DelegatedSubnetInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putDetailsWithServiceResponseAsync(resourceGroupName, resourceName, parameters), serviceCallback); + } + + /** + * Put delegated subnet resource. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param parameters Delegated subnet details. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putDetailsAsync(String resourceGroupName, String resourceName, DelegatedSubnetInner parameters) { + return putDetailsWithServiceResponseAsync(resourceGroupName, resourceName, parameters).map(new Func1, DelegatedSubnetInner>() { + @Override + public DelegatedSubnetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put delegated subnet resource. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param parameters Delegated subnet details. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putDetailsWithServiceResponseAsync(String resourceGroupName, String resourceName, DelegatedSubnetInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.putDetails(resourceGroupName, resourceName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Put delegated subnet resource. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param parameters Delegated subnet details. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DelegatedSubnetInner object if successful. + */ + public DelegatedSubnetInner beginPutDetails(String resourceGroupName, String resourceName, DelegatedSubnetInner parameters) { + return beginPutDetailsWithServiceResponseAsync(resourceGroupName, resourceName, parameters).toBlocking().single().body(); + } + + /** + * Put delegated subnet resource. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param parameters Delegated subnet details. + * @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 beginPutDetailsAsync(String resourceGroupName, String resourceName, DelegatedSubnetInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutDetailsWithServiceResponseAsync(resourceGroupName, resourceName, parameters), serviceCallback); + } + + /** + * Put delegated subnet resource. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param parameters Delegated subnet details. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DelegatedSubnetInner object + */ + public Observable beginPutDetailsAsync(String resourceGroupName, String resourceName, DelegatedSubnetInner parameters) { + return beginPutDetailsWithServiceResponseAsync(resourceGroupName, resourceName, parameters).map(new Func1, DelegatedSubnetInner>() { + @Override + public DelegatedSubnetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put delegated subnet resource. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param parameters Delegated subnet details. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DelegatedSubnetInner object + */ + public Observable> beginPutDetailsWithServiceResponseAsync(String resourceGroupName, String resourceName, DelegatedSubnetInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginPutDetails(resourceGroupName, resourceName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutDetailsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPutDetailsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Patch delegated subnet resource. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DelegatedSubnetInner object if successful. + */ + public DelegatedSubnetInner patchDetails(String resourceGroupName, String resourceName) { + return patchDetailsWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().last().body(); + } + + /** + * Patch delegated subnet resource. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @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 patchDetailsAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patchDetailsWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Patch delegated subnet resource. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable patchDetailsAsync(String resourceGroupName, String resourceName) { + return patchDetailsWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, DelegatedSubnetInner>() { + @Override + public DelegatedSubnetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch delegated subnet resource. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> patchDetailsWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Map tags = null; + ResourceUpdateParameters parameters = new ResourceUpdateParameters(); + parameters.withTags(null); + Observable> observable = service.patchDetails(resourceGroupName, resourceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Patch delegated subnet resource. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param tags The resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DelegatedSubnetInner object if successful. + */ + public DelegatedSubnetInner patchDetails(String resourceGroupName, String resourceName, Map tags) { + return patchDetailsWithServiceResponseAsync(resourceGroupName, resourceName, tags).toBlocking().last().body(); + } + + /** + * Patch delegated subnet resource. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param tags The resource tags. + * @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 patchDetailsAsync(String resourceGroupName, String resourceName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patchDetailsWithServiceResponseAsync(resourceGroupName, resourceName, tags), serviceCallback); + } + + /** + * Patch delegated subnet resource. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param tags The resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable patchDetailsAsync(String resourceGroupName, String resourceName, Map tags) { + return patchDetailsWithServiceResponseAsync(resourceGroupName, resourceName, tags).map(new Func1, DelegatedSubnetInner>() { + @Override + public DelegatedSubnetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch delegated subnet resource. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param tags The resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> patchDetailsWithServiceResponseAsync(String resourceGroupName, String resourceName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(tags); + ResourceUpdateParameters parameters = new ResourceUpdateParameters(); + parameters.withTags(tags); + Observable> observable = service.patchDetails(resourceGroupName, resourceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Patch delegated subnet resource. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DelegatedSubnetInner object if successful. + */ + public DelegatedSubnetInner beginPatchDetails(String resourceGroupName, String resourceName) { + return beginPatchDetailsWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Patch delegated subnet resource. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @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 beginPatchDetailsAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPatchDetailsWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Patch delegated subnet resource. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DelegatedSubnetInner object + */ + public Observable beginPatchDetailsAsync(String resourceGroupName, String resourceName) { + return beginPatchDetailsWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, DelegatedSubnetInner>() { + @Override + public DelegatedSubnetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch delegated subnet resource. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DelegatedSubnetInner object + */ + public Observable> beginPatchDetailsWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Map tags = null; + ResourceUpdateParameters parameters = new ResourceUpdateParameters(); + parameters.withTags(null); + return service.beginPatchDetails(resourceGroupName, resourceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPatchDetailsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Patch delegated subnet resource. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param tags The resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DelegatedSubnetInner object if successful. + */ + public DelegatedSubnetInner beginPatchDetails(String resourceGroupName, String resourceName, Map tags) { + return beginPatchDetailsWithServiceResponseAsync(resourceGroupName, resourceName, tags).toBlocking().single().body(); + } + + /** + * Patch delegated subnet resource. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param tags The resource tags. + * @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 beginPatchDetailsAsync(String resourceGroupName, String resourceName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPatchDetailsWithServiceResponseAsync(resourceGroupName, resourceName, tags), serviceCallback); + } + + /** + * Patch delegated subnet resource. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param tags The resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DelegatedSubnetInner object + */ + public Observable beginPatchDetailsAsync(String resourceGroupName, String resourceName, Map tags) { + return beginPatchDetailsWithServiceResponseAsync(resourceGroupName, resourceName, tags).map(new Func1, DelegatedSubnetInner>() { + @Override + public DelegatedSubnetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch delegated subnet resource. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param tags The resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DelegatedSubnetInner object + */ + public Observable> beginPatchDetailsWithServiceResponseAsync(String resourceGroupName, String resourceName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(tags); + ResourceUpdateParameters parameters = new ResourceUpdateParameters(); + parameters.withTags(tags); + return service.beginPatchDetails(resourceGroupName, resourceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPatchDetailsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPatchDetailsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Delete dnc DelegatedSubnet. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String resourceName) { + deleteWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().last().body(); + } + + /** + * Delete dnc DelegatedSubnet. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Delete dnc DelegatedSubnet. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String resourceName) { + return deleteWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete dnc DelegatedSubnet. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(resourceGroupName, resourceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete dnc DelegatedSubnet. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String resourceName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Delete dnc DelegatedSubnet. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Delete dnc DelegatedSubnet. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String resourceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete dnc DelegatedSubnet. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(resourceGroupName, resourceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get all the DelegatedSubnets resources in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DelegatedSubnetInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all the DelegatedSubnets resources in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all the DelegatedSubnets resources in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DelegatedSubnetInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all the DelegatedSubnets resources in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DelegatedSubnetInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all the DelegatedSubnets resources in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DelegatedSubnetInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get all the DelegatedSubnets resources in a resource group. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DelegatedSubnetInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all the DelegatedSubnets resources in a resource group. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all the DelegatedSubnets resources in a resource group. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DelegatedSubnetInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all the DelegatedSubnets resources in a resource group. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DelegatedSubnetInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all the DelegatedSubnets resources in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DelegatedSubnetInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get all the DelegatedSubnets resources in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DelegatedSubnetInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all the DelegatedSubnets resources in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all the DelegatedSubnets resources in a subscription. + * + * @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<DelegatedSubnetInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all the DelegatedSubnets resources in a subscription. + * + * @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<DelegatedSubnetInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all the DelegatedSubnets resources in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DelegatedSubnetInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get all the DelegatedSubnets resources in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DelegatedSubnetInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all the DelegatedSubnets resources in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all the DelegatedSubnets resources in a resource group. + * + * @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<DelegatedSubnetInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all the DelegatedSubnets resources in a resource group. + * + * @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<DelegatedSubnetInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all the DelegatedSubnets resources in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DelegatedSubnetInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/IdParsingUtils.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..4e2585fb078e --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/OperationImpl.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/OperationImpl.java new file mode 100644 index 000000000000..72c699a13c33 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/OperationImpl.java @@ -0,0 +1,52 @@ +/** + * 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.delegatednetwork.2020-08-08-preview.implementation; + +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.OperationDisplay; + +class OperationImpl extends WrapperImpl implements Operation { + private final DelegatedNetworkManager manager; + OperationImpl(OperationInner inner, DelegatedNetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DelegatedNetworkManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public Boolean isDataAction() { + return this.inner().isDataAction(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String origin() { + return this.inner().origin(); + } + + @Override + public Object properties() { + return this.inner().properties(); + } + +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/OperationInner.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/OperationInner.java new file mode 100644 index 000000000000..a089bd675315 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/OperationInner.java @@ -0,0 +1,138 @@ +/** + * 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.delegatednetwork.2020-08-08-preview.implementation; + +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Microsoft.DelegatedNetwork REST API operation definition. + */ +public class OperationInner { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Origin of the operation. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * Gets or sets a value indicating whether the operation is a data action + * or not. + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + + /** + * Operation properties display. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Properties of the operation. + */ + @JsonProperty(value = "properties") + private Object properties; + + /** + * Get operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get origin of the operation. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set origin of the operation. + * + * @param origin the origin value to set + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get gets or sets a value indicating whether the operation is a data action or not. + * + * @return the isDataAction value + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set gets or sets a value indicating whether the operation is a data action or not. + * + * @param isDataAction the isDataAction value to set + * @return the OperationInner object itself. + */ + public OperationInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get operation properties display. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set operation properties display. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get properties of the operation. + * + * @return the properties value + */ + public Object properties() { + return this.properties; + } + + /** + * Set properties of the operation. + * + * @param properties the properties value to set + * @return the OperationInner object itself. + */ + public OperationInner withProperties(Object properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/OperationsImpl.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/OperationsImpl.java new file mode 100644 index 000000000000..8fc8e28c9ae8 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final DelegatedNetworkManager manager; + + OperationsImpl(DelegatedNetworkManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public DelegatedNetworkManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/OperationsInner.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/OperationsInner.java new file mode 100644 index 000000000000..cfc93b4f2872 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/OperationsInner.java @@ -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.delegatednetwork.2020-08-08-preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.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 DNCImpl 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, DNCImpl 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.delegatednetwork.2020-08-08-preview.Operations list" }) + @GET("providers/Microsoft.DelegatedNetwork/operations") + Observable> 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.delegatednetwork.2020-08-08-preview.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available DelegatedNetwork service REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available DelegatedNetwork service 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> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available DelegatedNetwork service REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available DelegatedNetwork service REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available DelegatedNetwork service REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> 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, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all of the available DelegatedNetwork service REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available DelegatedNetwork service 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> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available DelegatedNetwork service 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> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available DelegatedNetwork service 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>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available DelegatedNetwork service REST API operations. + * + ServiceResponse> * @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>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/OrchestratorImpl.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/OrchestratorImpl.java new file mode 100644 index 000000000000..cc94d060d423 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/OrchestratorImpl.java @@ -0,0 +1,136 @@ +/** + * 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.delegatednetwork.2020-08-08-preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.Orchestrator; +import rx.Observable; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.OrchestratorIdentity; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.OrchestratorInstanceState; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.ControllerDetails; + +class OrchestratorImpl extends GroupableResourceCoreImpl implements Orchestrator, Orchestrator.Definition, Orchestrator.Update { + OrchestratorImpl(String name, OrchestratorInner inner, DelegatedNetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + OrchestratorInstanceServicesInner client = this.manager().inner().orchestratorInstanceServices(); + return client.createAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + OrchestratorInstanceServicesInner client = this.manager().inner().orchestratorInstanceServices(); + return client.createAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + OrchestratorInstanceServicesInner client = this.manager().inner().orchestratorInstanceServices(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String apiServerEndpoint() { + return this.inner().apiServerEndpoint(); + } + + @Override + public String clusterRootCA() { + return this.inner().clusterRootCA(); + } + + @Override + public ControllerDetails controllerDetails() { + return this.inner().controllerDetails(); + } + + @Override + public OrchestratorIdentity identity() { + return this.inner().identity(); + } + + @Override + public String kind() { + return this.inner().kind(); + } + + @Override + public String orchestratorAppId() { + return this.inner().orchestratorAppId(); + } + + @Override + public String orchestratorTenantId() { + return this.inner().orchestratorTenantId(); + } + + @Override + public OrchestratorInstanceState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public OrchestratorImpl withControllerDetails(ControllerDetails controllerDetails) { + this.inner().withControllerDetails(controllerDetails); + return this; + } + + @Override + public OrchestratorImpl withKind(String kind) { + this.inner().withKind(kind); + return this; + } + + @Override + public OrchestratorImpl withApiServerEndpoint(String apiServerEndpoint) { + this.inner().withApiServerEndpoint(apiServerEndpoint); + return this; + } + + @Override + public OrchestratorImpl withClusterRootCA(String clusterRootCA) { + this.inner().withClusterRootCA(clusterRootCA); + return this; + } + + @Override + public OrchestratorImpl withIdentity(OrchestratorIdentity identity) { + this.inner().withIdentity(identity); + return this; + } + + @Override + public OrchestratorImpl withOrchestratorAppId(String orchestratorAppId) { + this.inner().withOrchestratorAppId(orchestratorAppId); + return this; + } + + @Override + public OrchestratorImpl withOrchestratorTenantId(String orchestratorTenantId) { + this.inner().withOrchestratorTenantId(orchestratorTenantId); + return this; + } + +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/OrchestratorInner.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/OrchestratorInner.java new file mode 100644 index 000000000000..bbcb45b8e2e1 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/OrchestratorInner.java @@ -0,0 +1,183 @@ +/** + * 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.delegatednetwork.2020-08-08-preview.implementation; + +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.OrchestratorInstanceState; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.ControllerDetails; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.OrchestratorResource; + +/** + * Represents an instance of a orchestrator. + */ +@JsonFlatten +public class OrchestratorInner extends OrchestratorResource { + /** + * Resource guid. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /** + * The current state of orchestratorInstance resource. Possible values + * include: 'Deleting', 'Succeeded', 'Failed', 'Provisioning'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private OrchestratorInstanceState provisioningState; + + /** + * AAD ID used with apiserver. + */ + @JsonProperty(value = "properties.orchestratorAppId") + private String orchestratorAppId; + + /** + * TenantID of server App ID. + */ + @JsonProperty(value = "properties.orchestratorTenantId") + private String orchestratorTenantId; + + /** + * RootCA certificate of kubernetes cluster base64 encoded. + */ + @JsonProperty(value = "properties.clusterRootCA") + private String clusterRootCA; + + /** + * K8s APIServer url. + */ + @JsonProperty(value = "properties.apiServerEndpoint") + private String apiServerEndpoint; + + /** + * controller details. + */ + @JsonProperty(value = "properties.controllerDetails", required = true) + private ControllerDetails controllerDetails; + + /** + * Get resource guid. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the current state of orchestratorInstance resource. Possible values include: 'Deleting', 'Succeeded', 'Failed', 'Provisioning'. + * + * @return the provisioningState value + */ + public OrchestratorInstanceState provisioningState() { + return this.provisioningState; + } + + /** + * Get aAD ID used with apiserver. + * + * @return the orchestratorAppId value + */ + public String orchestratorAppId() { + return this.orchestratorAppId; + } + + /** + * Set aAD ID used with apiserver. + * + * @param orchestratorAppId the orchestratorAppId value to set + * @return the OrchestratorInner object itself. + */ + public OrchestratorInner withOrchestratorAppId(String orchestratorAppId) { + this.orchestratorAppId = orchestratorAppId; + return this; + } + + /** + * Get tenantID of server App ID. + * + * @return the orchestratorTenantId value + */ + public String orchestratorTenantId() { + return this.orchestratorTenantId; + } + + /** + * Set tenantID of server App ID. + * + * @param orchestratorTenantId the orchestratorTenantId value to set + * @return the OrchestratorInner object itself. + */ + public OrchestratorInner withOrchestratorTenantId(String orchestratorTenantId) { + this.orchestratorTenantId = orchestratorTenantId; + return this; + } + + /** + * Get rootCA certificate of kubernetes cluster base64 encoded. + * + * @return the clusterRootCA value + */ + public String clusterRootCA() { + return this.clusterRootCA; + } + + /** + * Set rootCA certificate of kubernetes cluster base64 encoded. + * + * @param clusterRootCA the clusterRootCA value to set + * @return the OrchestratorInner object itself. + */ + public OrchestratorInner withClusterRootCA(String clusterRootCA) { + this.clusterRootCA = clusterRootCA; + return this; + } + + /** + * Get k8s APIServer url. + * + * @return the apiServerEndpoint value + */ + public String apiServerEndpoint() { + return this.apiServerEndpoint; + } + + /** + * Set k8s APIServer url. + * + * @param apiServerEndpoint the apiServerEndpoint value to set + * @return the OrchestratorInner object itself. + */ + public OrchestratorInner withApiServerEndpoint(String apiServerEndpoint) { + this.apiServerEndpoint = apiServerEndpoint; + return this; + } + + /** + * Get controller details. + * + * @return the controllerDetails value + */ + public ControllerDetails controllerDetails() { + return this.controllerDetails; + } + + /** + * Set controller details. + * + * @param controllerDetails the controllerDetails value to set + * @return the OrchestratorInner object itself. + */ + public OrchestratorInner withControllerDetails(ControllerDetails controllerDetails) { + this.controllerDetails = controllerDetails; + return this; + } + +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/OrchestratorInstanceServicesImpl.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/OrchestratorInstanceServicesImpl.java new file mode 100644 index 000000000000..a595d2970b07 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/OrchestratorInstanceServicesImpl.java @@ -0,0 +1,138 @@ +/** + * 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. + * def + */ + +package com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.OrchestratorInstanceServices; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.Orchestrator; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class OrchestratorInstanceServicesImpl extends GroupableResourcesCoreImpl implements OrchestratorInstanceServices { + protected OrchestratorInstanceServicesImpl(DelegatedNetworkManager manager) { + super(manager.inner().orchestratorInstanceServices(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + OrchestratorInstanceServicesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + OrchestratorInstanceServicesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + OrchestratorInstanceServicesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + OrchestratorInstanceServicesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Orchestrator call(OrchestratorInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + OrchestratorInstanceServicesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + OrchestratorInstanceServicesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Orchestrator call(OrchestratorInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public OrchestratorImpl define(String name) { + return wrapModel(name); + } + + @Override + protected OrchestratorImpl wrapModel(OrchestratorInner inner) { + return new OrchestratorImpl(inner.name(), inner, manager()); + } + + @Override + protected OrchestratorImpl wrapModel(String name) { + return new OrchestratorImpl(name, new OrchestratorInner(), this.manager()); + } + +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/OrchestratorInstanceServicesInner.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/OrchestratorInstanceServicesInner.java new file mode 100644 index 000000000000..6dd06ced6afa --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/OrchestratorInstanceServicesInner.java @@ -0,0 +1,1144 @@ +/** + * 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.delegatednetwork.2020-08-08-preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.ErrorResponseException; +import com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.OrchestratorResourceUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in OrchestratorInstanceServices. + */ +public class OrchestratorInstanceServicesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private OrchestratorInstanceServicesService service; + /** The service client containing this operation class. */ + private DNCImpl client; + + /** + * Initializes an instance of OrchestratorInstanceServicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OrchestratorInstanceServicesInner(Retrofit retrofit, DNCImpl client) { + this.service = retrofit.create(OrchestratorInstanceServicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for OrchestratorInstanceServices to be + * used by Retrofit to perform actually REST calls. + */ + interface OrchestratorInstanceServicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.OrchestratorInstanceServices getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork/orchestrators/{resourceName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.OrchestratorInstanceServices create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork/orchestrators/{resourceName}") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body OrchestratorInner parameters, @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.delegatednetwork.2020-08-08-preview.OrchestratorInstanceServices beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork/orchestrators/{resourceName}") + Observable> beginCreate(@Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body OrchestratorInner parameters, @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.delegatednetwork.2020-08-08-preview.OrchestratorInstanceServices delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork/orchestrators/{resourceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.OrchestratorInstanceServices beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork/orchestrators/{resourceName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.OrchestratorInstanceServices patch" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork/orchestrators/{resourceName}") + Observable> patch(@Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body OrchestratorResourceUpdateParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.OrchestratorInstanceServices list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DelegatedNetwork/orchestrators") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.OrchestratorInstanceServices listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork/orchestrators") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.OrchestratorInstanceServices listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.OrchestratorInstanceServices listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets details about the orchestrator instance. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OrchestratorInner object if successful. + */ + public OrchestratorInner getByResourceGroup(String resourceGroupName, String resourceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Gets details about the orchestrator instance. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Gets details about the orchestrator instance. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OrchestratorInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String resourceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, OrchestratorInner>() { + @Override + public OrchestratorInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets details about the orchestrator instance. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OrchestratorInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(resourceGroupName, resourceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Create a orchestrator instance. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param parameters OrchestratorInstance type parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OrchestratorInner object if successful. + */ + public OrchestratorInner create(String resourceGroupName, String resourceName, OrchestratorInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, resourceName, parameters).toBlocking().last().body(); + } + + /** + * Create a orchestrator instance. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param parameters OrchestratorInstance type parameters + * @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 createAsync(String resourceGroupName, String resourceName, OrchestratorInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, resourceName, parameters), serviceCallback); + } + + /** + * Create a orchestrator instance. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param parameters OrchestratorInstance type parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String resourceName, OrchestratorInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, resourceName, parameters).map(new Func1, OrchestratorInner>() { + @Override + public OrchestratorInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a orchestrator instance. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param parameters OrchestratorInstance type parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String resourceName, OrchestratorInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(resourceGroupName, resourceName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create a orchestrator instance. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param parameters OrchestratorInstance type parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OrchestratorInner object if successful. + */ + public OrchestratorInner beginCreate(String resourceGroupName, String resourceName, OrchestratorInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, resourceName, parameters).toBlocking().single().body(); + } + + /** + * Create a orchestrator instance. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param parameters OrchestratorInstance type parameters + * @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 beginCreateAsync(String resourceGroupName, String resourceName, OrchestratorInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, resourceName, parameters), serviceCallback); + } + + /** + * Create a orchestrator instance. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param parameters OrchestratorInstance type parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OrchestratorInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String resourceName, OrchestratorInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, resourceName, parameters).map(new Func1, OrchestratorInner>() { + @Override + public OrchestratorInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a orchestrator instance. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param parameters OrchestratorInstance type parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OrchestratorInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String resourceName, OrchestratorInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(resourceGroupName, resourceName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes the Orchestrator Instance. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String resourceName) { + deleteWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().last().body(); + } + + /** + * Deletes the Orchestrator Instance. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Deletes the Orchestrator Instance. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String resourceName) { + return deleteWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the Orchestrator Instance. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(resourceGroupName, resourceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the Orchestrator Instance. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String resourceName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Deletes the Orchestrator Instance. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Deletes the Orchestrator Instance. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String resourceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the Orchestrator Instance. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(resourceGroupName, resourceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Update Orchestrator Instance. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OrchestratorInner object if successful. + */ + public OrchestratorInner patch(String resourceGroupName, String resourceName) { + return patchWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Update Orchestrator Instance. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @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 patchAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patchWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Update Orchestrator Instance. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OrchestratorInner object + */ + public Observable patchAsync(String resourceGroupName, String resourceName) { + return patchWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, OrchestratorInner>() { + @Override + public OrchestratorInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update Orchestrator Instance. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OrchestratorInner object + */ + public Observable> patchWithServiceResponseAsync(String resourceGroupName, String resourceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Map tags = null; + OrchestratorResourceUpdateParameters parameters = new OrchestratorResourceUpdateParameters(); + parameters.withTags(null); + return service.patch(resourceGroupName, resourceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patchDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Update Orchestrator Instance. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param tags The resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OrchestratorInner object if successful. + */ + public OrchestratorInner patch(String resourceGroupName, String resourceName, Map tags) { + return patchWithServiceResponseAsync(resourceGroupName, resourceName, tags).toBlocking().single().body(); + } + + /** + * Update Orchestrator Instance. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param tags The resource tags. + * @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 patchAsync(String resourceGroupName, String resourceName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patchWithServiceResponseAsync(resourceGroupName, resourceName, tags), serviceCallback); + } + + /** + * Update Orchestrator Instance. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param tags The resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OrchestratorInner object + */ + public Observable patchAsync(String resourceGroupName, String resourceName, Map tags) { + return patchWithServiceResponseAsync(resourceGroupName, resourceName, tags).map(new Func1, OrchestratorInner>() { + @Override + public OrchestratorInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update Orchestrator Instance. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param tags The resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OrchestratorInner object + */ + public Observable> patchWithServiceResponseAsync(String resourceGroupName, String resourceName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(tags); + OrchestratorResourceUpdateParameters parameters = new OrchestratorResourceUpdateParameters(); + parameters.withTags(tags); + return service.patch(resourceGroupName, resourceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patchDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse patchDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get all the orchestratorInstance resources in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OrchestratorInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all the orchestratorInstance resources in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all the orchestratorInstance resources in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OrchestratorInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all the orchestratorInstance resources in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OrchestratorInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all the orchestratorInstance resources in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OrchestratorInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get all the OrchestratorInstances resources in a resource group. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OrchestratorInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all the OrchestratorInstances resources in a resource group. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all the OrchestratorInstances resources in a resource group. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OrchestratorInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all the OrchestratorInstances resources in a resource group. + * + * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OrchestratorInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all the OrchestratorInstances resources in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the Azure Resource group of which a given DelegatedNetwork resource is part. This name must be at least 1 character in length, and no more than 90. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OrchestratorInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get all the orchestratorInstance resources in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OrchestratorInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all the orchestratorInstance resources in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all the orchestratorInstance resources in a subscription. + * + * @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<OrchestratorInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all the orchestratorInstance resources in a subscription. + * + * @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<OrchestratorInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all the orchestratorInstance resources in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OrchestratorInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get all the OrchestratorInstances resources in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OrchestratorInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all the OrchestratorInstances resources in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all the OrchestratorInstances resources in a resource group. + * + * @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<OrchestratorInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all the OrchestratorInstances resources in a resource group. + * + * @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<OrchestratorInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all the OrchestratorInstances resources in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OrchestratorInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/PageImpl.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/PageImpl.java new file mode 100644 index 000000000000..c1afc8e6b2e2 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/package-info.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/package-info.java new file mode 100644 index 000000000000..6274e7f01882 --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for DNC. + * DNC web api provides way to create, get and delete dnc controller. + */ +package com.microsoft.azure.management.delegatednetwork.2020-08-08-preview.implementation; diff --git a/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/package-info.java b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/package-info.java new file mode 100644 index 000000000000..bcaeae04788a --- /dev/null +++ b/sdk/DelegatedNetwork/mgmt-2020-08-08-preview/src/main/java/com/microsoft/azure/management/delegatednetwork/2020-08-08-preview/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for DNC. + * DNC web api provides way to create, get and delete dnc controller. + */ +package com.microsoft.azure.management.delegatednetwork.2020-08-08-preview;