From 158552201ebf37bd372614d4edd5ba98e60de6a1 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 17 Feb 2021 08:11:50 +0000 Subject: [PATCH] CodeGen from PR 13004 in Azure/azure-rest-api-specs Merge ebcdd698d2c1d3de94796f8a4bc3bfd6b7995c73 into a2a3da0d9f4a26b317fc15eb1cf34557c2a8d05a --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../README.md | 99 + .../pom.xml | 67 + .../DelegatednetworkManager.java | 264 +++ .../fluent/ControllersClient.java | 201 ++ .../fluent/DelegatedNetworksClient.java | 63 + .../fluent/DelegatedSubnetServicesClient.java | 302 +++ .../delegatednetwork/fluent/Dnc.java | 82 + .../fluent/OperationsClient.java | 36 + .../OrchestratorInstanceServicesClient.java | 254 +++ .../models/DelegatedControllerInner.java | 121 ++ .../fluent/models/DelegatedSubnetInner.java | 135 ++ .../fluent/models/OperationInner.java | 148 ++ .../fluent/models/OrchestratorInner.java | 225 +++ .../fluent/models/package-info.java | 8 + .../delegatednetwork/fluent/package-info.java | 8 + .../implementation/ControllersClientImpl.java | 971 ++++++++++ .../implementation/ControllersImpl.java | 149 ++ .../DelegatedControllerImpl.java | 194 ++ .../DelegatedNetworksClientImpl.java | 563 ++++++ .../implementation/DelegatedNetworksImpl.java | 57 + .../implementation/DelegatedSubnetImpl.java | 199 ++ .../DelegatedSubnetServicesClientImpl.java | 1635 +++++++++++++++++ .../DelegatedSubnetServicesImpl.java | 185 ++ .../implementation/DncBuilder.java | 147 ++ .../implementation/DncImpl.java | 354 ++++ .../implementation/OperationImpl.java | 49 + .../implementation/OperationsClientImpl.java | 268 +++ .../implementation/OperationsImpl.java | 46 + .../implementation/OrchestratorImpl.java | 247 +++ ...rchestratorInstanceServicesClientImpl.java | 1477 +++++++++++++++ .../OrchestratorInstanceServicesImpl.java | 171 ++ .../implementation/Utils.java | 196 ++ .../implementation/package-info.java | 8 + .../models/ControllerDetails.java | 50 + .../models/ControllerResource.java | 39 + .../ControllerResourceUpdateParameters.java | 51 + .../models/ControllerState.java | 40 + .../delegatednetwork/models/Controllers.java | 116 ++ .../models/DelegatedController.java | 228 +++ .../models/DelegatedControllers.java | 74 + .../models/DelegatedNetworks.java | 56 + .../models/DelegatedSubnet.java | 244 +++ .../models/DelegatedSubnetResource.java | 39 + .../models/DelegatedSubnetServices.java | 177 ++ .../models/DelegatedSubnetState.java | 40 + .../models/DelegatedSubnets.java | 74 + .../delegatednetwork/models/Operation.java | 52 + .../models/OperationDisplay.java | 84 + .../models/OperationListResult.java | 74 + .../delegatednetwork/models/Operations.java | 31 + .../delegatednetwork/models/Orchestrator.java | 334 ++++ .../models/OrchestratorIdentity.java | 86 + .../models/OrchestratorInstanceServices.java | 162 ++ .../models/OrchestratorInstanceState.java | 40 + .../models/OrchestratorKind.java | 31 + .../models/OrchestratorResource.java | 100 + .../OrchestratorResourceUpdateParameters.java | 51 + .../models/Orchestrators.java | 74 + .../models/ResourceIdentityType.java | 47 + .../models/ResourceUpdateParameters.java | 51 + .../models/SubnetDetails.java | 50 + .../delegatednetwork/models/package-info.java | 6 + .../delegatednetwork/package-info.java | 6 + .../src/main/java/module-info.java | 19 + sdk/delegatednetwork/ci.yml | 31 + sdk/delegatednetwork/pom.xml | 53 + 69 files changed, 11546 insertions(+) create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/CHANGELOG.md create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/README.md create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/pom.xml create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/DelegatednetworkManager.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/ControllersClient.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/DelegatedNetworksClient.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/DelegatedSubnetServicesClient.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/Dnc.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/OperationsClient.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/OrchestratorInstanceServicesClient.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/DelegatedControllerInner.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/DelegatedSubnetInner.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/OperationInner.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/OrchestratorInner.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/package-info.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/package-info.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/ControllersClientImpl.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/ControllersImpl.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedControllerImpl.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedNetworksClientImpl.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedNetworksImpl.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedSubnetImpl.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedSubnetServicesClientImpl.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedSubnetServicesImpl.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DncBuilder.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DncImpl.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OperationImpl.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OperationsClientImpl.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OperationsImpl.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorImpl.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorInstanceServicesClientImpl.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorInstanceServicesImpl.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/Utils.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/package-info.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ControllerDetails.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ControllerResource.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ControllerResourceUpdateParameters.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ControllerState.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Controllers.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedController.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedControllers.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedNetworks.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnet.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnetResource.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnetServices.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnetState.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnets.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Operation.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OperationDisplay.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OperationListResult.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Operations.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Orchestrator.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorIdentity.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorInstanceServices.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorInstanceState.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorKind.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorResource.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorResourceUpdateParameters.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Orchestrators.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ResourceIdentityType.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ResourceUpdateParameters.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/SubnetDetails.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/package-info.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/package-info.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/module-info.java create mode 100644 sdk/delegatednetwork/ci.yml create mode 100644 sdk/delegatednetwork/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index ce4155a584c42..9626a6a8b7148 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -202,6 +202,7 @@ com.azure.resourcemanager:azure-resourcemanager-eventgrid;1.0.0-beta.1;1.0.0-bet com.azure.resourcemanager:azure-resourcemanager-healthbot;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-confluent;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-digitaltwins;1.0.0-beta.1;1.0.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-delegatednetwork;1.0.0-beta.1;1.0.0-beta.1 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current # version. Unreleased dependencies are only valid for dependency versions. diff --git a/pom.xml b/pom.xml index c6f2da27340d4..5837115332bc6 100644 --- a/pom.xml +++ b/pom.xml @@ -575,6 +575,7 @@ sdk/core sdk/cosmos sdk/costmanagement + sdk/delegatednetwork sdk/digitaltwins sdk/eventgrid sdk/eventhubs diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/CHANGELOG.md b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/CHANGELOG.md new file mode 100644 index 0000000000000..cef90926d9b5c --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2021-02-17) + +- Azure Resource Manager Delegatednetwork client library for Java. This package contains Microsoft Azure SDK for Delegatednetwork Management SDK. DNC web api provides way to create, get and delete dnc controller. Package tag package-2020-08-08-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/README.md b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/README.md new file mode 100644 index 0000000000000..b687772927ff8 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/README.md @@ -0,0 +1,99 @@ +# Azure Resource Manager Delegatednetwork client library for Java + +Azure Resource Manager Delegatednetwork client library for Java. + +This package contains Microsoft Azure SDK for Delegatednetwork Management SDK. DNC web api provides way to create, get and delete dnc controller. Package tag package-2020-08-08-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-delegatednetwork;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-delegatednetwork + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +DelegatednetworkManager manager = DelegatednetworkManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/master/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/pom.xml b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/pom.xml new file mode 100644 index 0000000000000..e4334dbf1859d --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/pom.xml @@ -0,0 +1,67 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-delegatednetwork + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Delegatednetwork Management + This package contains Microsoft Azure SDK for Delegatednetwork Management SDK. DNC web api provides way to create, get and delete dnc controller. Package tag package-2020-08-08-preview. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + + com.azure + azure-core + 1.13.0 + + + com.azure + azure-core-management + 1.1.1 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + + diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/DelegatednetworkManager.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/DelegatednetworkManager.java new file mode 100644 index 0000000000000..f4d52351b1ebe --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/DelegatednetworkManager.java @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.delegatednetwork.fluent.Dnc; +import com.azure.resourcemanager.delegatednetwork.implementation.ControllersImpl; +import com.azure.resourcemanager.delegatednetwork.implementation.DelegatedNetworksImpl; +import com.azure.resourcemanager.delegatednetwork.implementation.DelegatedSubnetServicesImpl; +import com.azure.resourcemanager.delegatednetwork.implementation.DncBuilder; +import com.azure.resourcemanager.delegatednetwork.implementation.OperationsImpl; +import com.azure.resourcemanager.delegatednetwork.implementation.OrchestratorInstanceServicesImpl; +import com.azure.resourcemanager.delegatednetwork.models.Controllers; +import com.azure.resourcemanager.delegatednetwork.models.DelegatedNetworks; +import com.azure.resourcemanager.delegatednetwork.models.DelegatedSubnetServices; +import com.azure.resourcemanager.delegatednetwork.models.Operations; +import com.azure.resourcemanager.delegatednetwork.models.OrchestratorInstanceServices; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Entry point to DelegatednetworkManager. DNC web api provides way to create, get and delete dnc controller. */ +public final class DelegatednetworkManager { + private Controllers controllers; + + private DelegatedNetworks delegatedNetworks; + + private OrchestratorInstanceServices orchestratorInstanceServices; + + private DelegatedSubnetServices delegatedSubnetServices; + + private Operations operations; + + private final Dnc clientObject; + + private DelegatednetworkManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new DncBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Delegatednetwork service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Delegatednetwork service API instance. + */ + public static DelegatednetworkManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Gets a Configurable instance that can be used to create DelegatednetworkManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new DelegatednetworkManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private final ClientLogger logger = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private RetryPolicy retryPolicy; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of Delegatednetwork service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Delegatednetwork service API instance. + */ + public DelegatednetworkManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.delegatednetwork") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new RequestIdPolicy()); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies + .add( + new BearerTokenAuthenticationPolicy( + credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new DelegatednetworkManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of Controllers. */ + public Controllers controllers() { + if (this.controllers == null) { + this.controllers = new ControllersImpl(clientObject.getControllers(), this); + } + return controllers; + } + + /** @return Resource collection API of DelegatedNetworks. */ + public DelegatedNetworks delegatedNetworks() { + if (this.delegatedNetworks == null) { + this.delegatedNetworks = new DelegatedNetworksImpl(clientObject.getDelegatedNetworks(), this); + } + return delegatedNetworks; + } + + /** @return Resource collection API of OrchestratorInstanceServices. */ + public OrchestratorInstanceServices orchestratorInstanceServices() { + if (this.orchestratorInstanceServices == null) { + this.orchestratorInstanceServices = + new OrchestratorInstanceServicesImpl(clientObject.getOrchestratorInstanceServices(), this); + } + return orchestratorInstanceServices; + } + + /** @return Resource collection API of DelegatedSubnetServices. */ + public DelegatedSubnetServices delegatedSubnetServices() { + if (this.delegatedSubnetServices == null) { + this.delegatedSubnetServices = + new DelegatedSubnetServicesImpl(clientObject.getDelegatedSubnetServices(), this); + } + return delegatedSubnetServices; + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * @return Wrapped service client Dnc providing direct access to the underlying auto-generated API implementation, + * based on Azure REST API. + */ + public Dnc serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/ControllersClient.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/ControllersClient.java new file mode 100644 index 0000000000000..9f4c589488f32 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/ControllersClient.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.delegatednetwork.fluent.models.DelegatedControllerInner; +import com.azure.resourcemanager.delegatednetwork.models.ControllerResourceUpdateParameters; + +/** An instance of this class provides access to all the operations defined in ControllersClient. */ +public interface ControllersClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified dnc controller. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DelegatedControllerInner getByResourceGroup(String resourceGroupName, String resourceName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified dnc controller. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a DNC controller. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DelegatedControllerInner> beginCreate( + String resourceGroupName, String resourceName, DelegatedControllerInner parameters); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a DNC controller. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DelegatedControllerInner> beginCreate( + String resourceGroupName, String resourceName, DelegatedControllerInner parameters, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a DNC controller. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DelegatedControllerInner create(String resourceGroupName, String resourceName, DelegatedControllerInner parameters); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a DNC controller. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DelegatedControllerInner create( + String resourceGroupName, String resourceName, DelegatedControllerInner parameters, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String resourceName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String resourceName, Context context); + + /** + * 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 parameters controller type parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a DNC controller. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DelegatedControllerInner patch( + String resourceGroupName, String resourceName, ControllerResourceUpdateParameters parameters); + + /** + * 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 parameters controller type parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a DNC controller. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response patchWithResponse( + String resourceGroupName, String resourceName, ControllerResourceUpdateParameters parameters, Context context); +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/DelegatedNetworksClient.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/DelegatedNetworksClient.java new file mode 100644 index 0000000000000..d0eba965e8feb --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/DelegatedNetworksClient.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.delegatednetwork.fluent.models.DelegatedControllerInner; + +/** An instance of this class provides access to all the operations defined in DelegatedNetworksClient. */ +public interface DelegatedNetworksClient { + /** + * Get all the delegatedController resources in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the delegatedController resources in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Get all the delegatedController resources in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the delegatedController resources in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the delegatedController resources in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the delegatedController resources in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/DelegatedSubnetServicesClient.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/DelegatedSubnetServicesClient.java new file mode 100644 index 0000000000000..ebe0a333f12a1 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/DelegatedSubnetServicesClient.java @@ -0,0 +1,302 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.delegatednetwork.fluent.models.DelegatedSubnetInner; +import com.azure.resourcemanager.delegatednetwork.models.ResourceUpdateParameters; + +/** An instance of this class provides access to all the operations defined in DelegatedSubnetServicesClient. */ +public interface DelegatedSubnetServicesClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified dnc DelegatedSubnet Link. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DelegatedSubnetInner getByResourceGroup(String resourceGroupName, String resourceName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified dnc DelegatedSubnet Link. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DelegatedSubnetInner> beginPutDetails( + String resourceGroupName, String resourceName, DelegatedSubnetInner parameters); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DelegatedSubnetInner> beginPutDetails( + String resourceGroupName, String resourceName, DelegatedSubnetInner parameters, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DelegatedSubnetInner putDetails(String resourceGroupName, String resourceName, DelegatedSubnetInner parameters); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DelegatedSubnetInner putDetails( + String resourceGroupName, String resourceName, DelegatedSubnetInner parameters, Context context); + + /** + * 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 parameters Delegated subnet details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DelegatedSubnetInner> beginPatchDetails( + String resourceGroupName, String resourceName, ResourceUpdateParameters parameters); + + /** + * 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 parameters Delegated subnet details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DelegatedSubnetInner> beginPatchDetails( + String resourceGroupName, String resourceName, ResourceUpdateParameters parameters, Context context); + + /** + * 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 parameters Delegated subnet details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DelegatedSubnetInner patchDetails( + String resourceGroupName, String resourceName, ResourceUpdateParameters parameters); + + /** + * 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 parameters Delegated subnet details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DelegatedSubnetInner patchDetails( + String resourceGroupName, String resourceName, ResourceUpdateParameters parameters, Context context); + + /** + * Delete 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 forceDelete Force delete resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, Boolean forceDelete); + + /** + * Delete 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 forceDelete Force delete resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String resourceName, Boolean forceDelete, Context context); + + /** + * Delete 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 forceDelete Force delete resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String resourceName, Boolean forceDelete); + + /** + * Delete 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String resourceName); + + /** + * Delete 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 forceDelete Force delete resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String resourceName, Boolean forceDelete, Context context); + + /** + * Get all the DelegatedSubnets resources in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the DelegatedSubnets resources in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Get all the DelegatedSubnets resources in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the DelegatedSubnets resources in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the DelegatedSubnets resources in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the DelegatedSubnets resources in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/Dnc.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/Dnc.java new file mode 100644 index 0000000000000..042a1dff42b81 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/Dnc.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for Dnc class. */ +public interface Dnc { + /** + * 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. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the ControllersClient object to access its operations. + * + * @return the ControllersClient object. + */ + ControllersClient getControllers(); + + /** + * Gets the DelegatedNetworksClient object to access its operations. + * + * @return the DelegatedNetworksClient object. + */ + DelegatedNetworksClient getDelegatedNetworks(); + + /** + * Gets the OrchestratorInstanceServicesClient object to access its operations. + * + * @return the OrchestratorInstanceServicesClient object. + */ + OrchestratorInstanceServicesClient getOrchestratorInstanceServices(); + + /** + * Gets the DelegatedSubnetServicesClient object to access its operations. + * + * @return the DelegatedSubnetServicesClient object. + */ + DelegatedSubnetServicesClient getDelegatedSubnetServices(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/OperationsClient.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/OperationsClient.java new file mode 100644 index 0000000000000..2bbd5fce629c7 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/OperationsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.delegatednetwork.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists all of the available DelegatedNetwork service REST API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of request to list controller operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the available DelegatedNetwork service REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of request to list controller operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/OrchestratorInstanceServicesClient.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/OrchestratorInstanceServicesClient.java new file mode 100644 index 0000000000000..1e2ddc2786bc3 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/OrchestratorInstanceServicesClient.java @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.delegatednetwork.fluent.models.OrchestratorInner; +import com.azure.resourcemanager.delegatednetwork.models.OrchestratorResourceUpdateParameters; + +/** An instance of this class provides access to all the operations defined in OrchestratorInstanceServicesClient. */ +public interface OrchestratorInstanceServicesClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the orchestrator instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrchestratorInner getByResourceGroup(String resourceGroupName, String resourceName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the orchestrator instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, OrchestratorInner> beginCreate( + String resourceGroupName, String resourceName, OrchestratorInner parameters); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, OrchestratorInner> beginCreate( + String resourceGroupName, String resourceName, OrchestratorInner parameters, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrchestratorInner create(String resourceGroupName, String resourceName, OrchestratorInner parameters); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrchestratorInner create( + String resourceGroupName, String resourceName, OrchestratorInner parameters, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String resourceName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String resourceName, Context context); + + /** + * 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 parameters OrchestratorInstance update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrchestratorInner patch( + String resourceGroupName, String resourceName, OrchestratorResourceUpdateParameters parameters); + + /** + * 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 parameters OrchestratorInstance update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response patchWithResponse( + String resourceGroupName, + String resourceName, + OrchestratorResourceUpdateParameters parameters, + Context context); + + /** + * Get all the orchestratorInstance resources in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the orchestratorInstance resources in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Get all the orchestratorInstance resources in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the orchestratorInstance resources in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the OrchestratorInstances resources in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the OrchestratorInstances resources in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/DelegatedControllerInner.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/DelegatedControllerInner.java new file mode 100644 index 0000000000000..0caf85444ff84 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/DelegatedControllerInner.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.delegatednetwork.models.ControllerResource; +import com.azure.resourcemanager.delegatednetwork.models.ControllerState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Represents an instance of a DNC controller. */ +@JsonFlatten +@Immutable +public class DelegatedControllerInner extends ControllerResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DelegatedControllerInner.class); + + /* + * Resource guid. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The current state of dnc controller resource. + */ + @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 the resourceGuid property: Resource guid. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioningState property: The current state of dnc controller resource. + * + * @return the provisioningState value. + */ + public ControllerState provisioningState() { + return this.provisioningState; + } + + /** + * Get the dncAppId property: dnc application id should be used by customer to authenticate with dnc gateway. + * + * @return the dncAppId value. + */ + public String dncAppId() { + return this.dncAppId; + } + + /** + * Get the dncTenantId property: tenant id of dnc application id. + * + * @return the dncTenantId value. + */ + public String dncTenantId() { + return this.dncTenantId; + } + + /** + * Get the dncEndpoint property: dnc endpoint url that customers can use to connect to. + * + * @return the dncEndpoint value. + */ + public String dncEndpoint() { + return this.dncEndpoint; + } + + /** {@inheritDoc} */ + @Override + public DelegatedControllerInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public DelegatedControllerInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/DelegatedSubnetInner.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/DelegatedSubnetInner.java new file mode 100644 index 0000000000000..c0de9e6ebbf76 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/DelegatedSubnetInner.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.delegatednetwork.models.ControllerDetails; +import com.azure.resourcemanager.delegatednetwork.models.DelegatedSubnetResource; +import com.azure.resourcemanager.delegatednetwork.models.DelegatedSubnetState; +import com.azure.resourcemanager.delegatednetwork.models.SubnetDetails; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Represents an instance of a orchestrator. */ +@JsonFlatten +@Fluent +public class DelegatedSubnetInner extends DelegatedSubnetResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DelegatedSubnetInner.class); + + /* + * Resource guid. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The current state of dnc delegated subnet resource. + */ + @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 the resourceGuid property: Resource guid. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioningState property: The current state of dnc delegated subnet resource. + * + * @return the provisioningState value. + */ + public DelegatedSubnetState provisioningState() { + return this.provisioningState; + } + + /** + * Get the subnetDetails property: orchestrator details. + * + * @return the subnetDetails value. + */ + public SubnetDetails subnetDetails() { + return this.subnetDetails; + } + + /** + * Set the subnetDetails property: 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 the controllerDetails property: controller details. + * + * @return the controllerDetails value. + */ + public ControllerDetails controllerDetails() { + return this.controllerDetails; + } + + /** + * Set the controllerDetails property: controller details. + * + * @param controllerDetails the controllerDetails value to set. + * @return the DelegatedSubnetInner object itself. + */ + public DelegatedSubnetInner withControllerDetails(ControllerDetails controllerDetails) { + this.controllerDetails = controllerDetails; + return this; + } + + /** {@inheritDoc} */ + @Override + public DelegatedSubnetInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public DelegatedSubnetInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (subnetDetails() != null) { + subnetDetails().validate(); + } + if (controllerDetails() != null) { + controllerDetails().validate(); + } + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/OperationInner.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/OperationInner.java new file mode 100644 index 0000000000000..e0bfb6b02b432 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/OperationInner.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.delegatednetwork.models.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Microsoft.DelegatedNetwork REST API operation definition. */ +@Fluent +public final class OperationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); + + /* + * 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 the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the origin property: Origin of the operation. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: 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 the isDataAction property: 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 the isDataAction property: 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 the display property: Operation properties display. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: 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 the properties property: Properties of the operation. + * + * @return the properties value. + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/OrchestratorInner.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/OrchestratorInner.java new file mode 100644 index 0000000000000..1e3eba37bc600 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/OrchestratorInner.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.delegatednetwork.models.ControllerDetails; +import com.azure.resourcemanager.delegatednetwork.models.OrchestratorIdentity; +import com.azure.resourcemanager.delegatednetwork.models.OrchestratorInstanceState; +import com.azure.resourcemanager.delegatednetwork.models.OrchestratorKind; +import com.azure.resourcemanager.delegatednetwork.models.OrchestratorResource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Represents an instance of a orchestrator. */ +@JsonFlatten +@Fluent +public class OrchestratorInner extends OrchestratorResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OrchestratorInner.class); + + /* + * Resource guid. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The current state of orchestratorInstance resource. + */ + @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") + private ControllerDetails controllerDetails; + + /** + * Get the resourceGuid property: Resource guid. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioningState property: The current state of orchestratorInstance resource. + * + * @return the provisioningState value. + */ + public OrchestratorInstanceState provisioningState() { + return this.provisioningState; + } + + /** + * Get the orchestratorAppId property: AAD ID used with apiserver. + * + * @return the orchestratorAppId value. + */ + public String orchestratorAppId() { + return this.orchestratorAppId; + } + + /** + * Set the orchestratorAppId property: 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 the orchestratorTenantId property: TenantID of server App ID. + * + * @return the orchestratorTenantId value. + */ + public String orchestratorTenantId() { + return this.orchestratorTenantId; + } + + /** + * Set the orchestratorTenantId property: 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 the clusterRootCA property: RootCA certificate of kubernetes cluster base64 encoded. + * + * @return the clusterRootCA value. + */ + public String clusterRootCA() { + return this.clusterRootCA; + } + + /** + * Set the clusterRootCA property: 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 the apiServerEndpoint property: K8s APIServer url. + * + * @return the apiServerEndpoint value. + */ + public String apiServerEndpoint() { + return this.apiServerEndpoint; + } + + /** + * Set the apiServerEndpoint property: 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 the controllerDetails property: controller details. + * + * @return the controllerDetails value. + */ + public ControllerDetails controllerDetails() { + return this.controllerDetails; + } + + /** + * Set the controllerDetails property: controller details. + * + * @param controllerDetails the controllerDetails value to set. + * @return the OrchestratorInner object itself. + */ + public OrchestratorInner withControllerDetails(ControllerDetails controllerDetails) { + this.controllerDetails = controllerDetails; + return this; + } + + /** {@inheritDoc} */ + @Override + public OrchestratorInner withKind(OrchestratorKind kind) { + super.withKind(kind); + return this; + } + + /** {@inheritDoc} */ + @Override + public OrchestratorInner withIdentity(OrchestratorIdentity identity) { + super.withIdentity(identity); + return this; + } + + /** {@inheritDoc} */ + @Override + public OrchestratorInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public OrchestratorInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (controllerDetails() != null) { + controllerDetails().validate(); + } + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/package-info.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/package-info.java new file mode 100644 index 0000000000000..7150fdfee7178 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the inner data models for Dnc. DNC web api provides way to create, get and delete dnc controller. + */ +package com.azure.resourcemanager.delegatednetwork.fluent.models; diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/package-info.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/package-info.java new file mode 100644 index 0000000000000..dc99933b81b4b --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the service clients for Dnc. DNC web api provides way to create, get and delete dnc controller. + */ +package com.azure.resourcemanager.delegatednetwork.fluent; diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/ControllersClientImpl.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/ControllersClientImpl.java new file mode 100644 index 0000000000000..8e6d93088a521 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/ControllersClientImpl.java @@ -0,0 +1,971 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.delegatednetwork.fluent.ControllersClient; +import com.azure.resourcemanager.delegatednetwork.fluent.models.DelegatedControllerInner; +import com.azure.resourcemanager.delegatednetwork.models.ControllerResourceUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ControllersClient. */ +public final class ControllersClientImpl implements ControllersClient { + private final ClientLogger logger = new ClientLogger(ControllersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ControllersService service; + + /** The service client containing this operation class. */ + private final DncImpl client; + + /** + * Initializes an instance of ControllersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ControllersClientImpl(DncImpl client) { + this.service = + RestProxy.create(ControllersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DncControllers to be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DncControllers") + private interface ControllersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork" + + "/controller/{resourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork" + + "/controller/{resourceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") DelegatedControllerInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork" + + "/controller/{resourceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork" + + "/controller/{resourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> patch( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ControllerResourceUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified dnc controller. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String resourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + resourceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified dnc controller. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String resourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + resourceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified dnc controller. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String resourceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified dnc controller. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DelegatedControllerInner getByResourceGroup(String resourceGroupName, String resourceName) { + return getByResourceGroupAsync(resourceGroupName, resourceName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified dnc controller. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a DNC controller. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String resourceName, DelegatedControllerInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + resourceGroupName, + resourceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a DNC controller. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String resourceName, DelegatedControllerInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + resourceGroupName, + resourceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a DNC controller. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DelegatedControllerInner> beginCreateAsync( + String resourceGroupName, String resourceName, DelegatedControllerInner parameters) { + Mono>> mono = createWithResponseAsync(resourceGroupName, resourceName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DelegatedControllerInner.class, + DelegatedControllerInner.class, + Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a DNC controller. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DelegatedControllerInner> beginCreateAsync( + String resourceGroupName, String resourceName, DelegatedControllerInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, resourceName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DelegatedControllerInner.class, + DelegatedControllerInner.class, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a DNC controller. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DelegatedControllerInner> beginCreate( + String resourceGroupName, String resourceName, DelegatedControllerInner parameters) { + return beginCreateAsync(resourceGroupName, resourceName, parameters).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a DNC controller. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DelegatedControllerInner> beginCreate( + String resourceGroupName, String resourceName, DelegatedControllerInner parameters, Context context) { + return beginCreateAsync(resourceGroupName, resourceName, parameters, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a DNC controller. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String resourceName, DelegatedControllerInner parameters) { + return beginCreateAsync(resourceGroupName, resourceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a DNC controller. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String resourceName, DelegatedControllerInner parameters, Context context) { + return beginCreateAsync(resourceGroupName, resourceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a DNC controller. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DelegatedControllerInner create( + String resourceGroupName, String resourceName, DelegatedControllerInner parameters) { + return createAsync(resourceGroupName, resourceName, parameters).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a DNC controller. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DelegatedControllerInner create( + String resourceGroupName, String resourceName, DelegatedControllerInner parameters, Context context) { + return createAsync(resourceGroupName, resourceName, parameters, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + resourceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String resourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + resourceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String resourceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName) { + return beginDeleteAsync(resourceGroupName, resourceName).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String resourceName, Context context) { + return beginDeleteAsync(resourceGroupName, resourceName, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String resourceName) { + return beginDeleteAsync(resourceGroupName, resourceName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String resourceName, Context context) { + return beginDeleteAsync(resourceGroupName, resourceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String resourceName) { + deleteAsync(resourceGroupName, resourceName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String resourceName, Context context) { + deleteAsync(resourceGroupName, resourceName, context).block(); + } + + /** + * 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 parameters controller type parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a DNC controller. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> patchWithResponseAsync( + String resourceGroupName, String resourceName, ControllerResourceUpdateParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .patch( + this.client.getEndpoint(), + resourceGroupName, + resourceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 parameters controller type parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a DNC controller. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> patchWithResponseAsync( + String resourceGroupName, String resourceName, ControllerResourceUpdateParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .patch( + this.client.getEndpoint(), + resourceGroupName, + resourceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * 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 parameters controller type parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a DNC controller. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono patchAsync( + String resourceGroupName, String resourceName, ControllerResourceUpdateParameters parameters) { + return patchWithResponseAsync(resourceGroupName, resourceName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 parameters controller type parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a DNC controller. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DelegatedControllerInner patch( + String resourceGroupName, String resourceName, ControllerResourceUpdateParameters parameters) { + return patchAsync(resourceGroupName, resourceName, parameters).block(); + } + + /** + * 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 parameters controller type parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a DNC controller. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response patchWithResponse( + String resourceGroupName, String resourceName, ControllerResourceUpdateParameters parameters, Context context) { + return patchWithResponseAsync(resourceGroupName, resourceName, parameters, context).block(); + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/ControllersImpl.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/ControllersImpl.java new file mode 100644 index 0000000000000..6adc7c3b59c37 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/ControllersImpl.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.delegatednetwork.DelegatednetworkManager; +import com.azure.resourcemanager.delegatednetwork.fluent.ControllersClient; +import com.azure.resourcemanager.delegatednetwork.fluent.models.DelegatedControllerInner; +import com.azure.resourcemanager.delegatednetwork.models.Controllers; +import com.azure.resourcemanager.delegatednetwork.models.DelegatedController; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ControllersImpl implements Controllers { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ControllersImpl.class); + + private final ControllersClient innerClient; + + private final DelegatednetworkManager serviceManager; + + public ControllersImpl(ControllersClient innerClient, DelegatednetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public DelegatedController getByResourceGroup(String resourceGroupName, String resourceName) { + DelegatedControllerInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, resourceName); + if (inner != null) { + return new DelegatedControllerImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, resourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DelegatedControllerImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String resourceName) { + this.serviceClient().delete(resourceGroupName, resourceName); + } + + public void delete(String resourceGroupName, String resourceName, Context context) { + this.serviceClient().delete(resourceGroupName, resourceName, context); + } + + public DelegatedController getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = Utils.getValueFromIdByName(id, "controller"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'controller'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = Utils.getValueFromIdByName(id, "controller"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'controller'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, resourceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = Utils.getValueFromIdByName(id, "controller"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'controller'.", id))); + } + this.delete(resourceGroupName, resourceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = Utils.getValueFromIdByName(id, "controller"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'controller'.", id))); + } + this.delete(resourceGroupName, resourceName, context); + } + + private ControllersClient serviceClient() { + return this.innerClient; + } + + private DelegatednetworkManager manager() { + return this.serviceManager; + } + + public DelegatedControllerImpl define(String name) { + return new DelegatedControllerImpl(name, this.manager()); + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedControllerImpl.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedControllerImpl.java new file mode 100644 index 0000000000000..674342b506926 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedControllerImpl.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.delegatednetwork.DelegatednetworkManager; +import com.azure.resourcemanager.delegatednetwork.fluent.models.DelegatedControllerInner; +import com.azure.resourcemanager.delegatednetwork.models.ControllerResourceUpdateParameters; +import com.azure.resourcemanager.delegatednetwork.models.ControllerState; +import com.azure.resourcemanager.delegatednetwork.models.DelegatedController; +import java.util.Collections; +import java.util.Map; + +public final class DelegatedControllerImpl + implements DelegatedController, DelegatedController.Definition, DelegatedController.Update { + private DelegatedControllerInner innerObject; + + private final DelegatednetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public ControllerState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String dncAppId() { + return this.innerModel().dncAppId(); + } + + public String dncTenantId() { + return this.innerModel().dncTenantId(); + } + + public String dncEndpoint() { + return this.innerModel().dncEndpoint(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public DelegatedControllerInner innerModel() { + return this.innerObject; + } + + private DelegatednetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String resourceName; + + private ControllerResourceUpdateParameters updateParameters; + + public DelegatedControllerImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public DelegatedController create() { + this.innerObject = + serviceManager + .serviceClient() + .getControllers() + .create(resourceGroupName, resourceName, this.innerModel(), Context.NONE); + return this; + } + + public DelegatedController create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getControllers() + .create(resourceGroupName, resourceName, this.innerModel(), context); + return this; + } + + DelegatedControllerImpl(String name, DelegatednetworkManager serviceManager) { + this.innerObject = new DelegatedControllerInner(); + this.serviceManager = serviceManager; + this.resourceName = name; + } + + public DelegatedControllerImpl update() { + this.updateParameters = new ControllerResourceUpdateParameters(); + return this; + } + + public DelegatedController apply() { + this.innerObject = + serviceManager + .serviceClient() + .getControllers() + .patchWithResponse(resourceGroupName, resourceName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public DelegatedController apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getControllers() + .patchWithResponse(resourceGroupName, resourceName, updateParameters, context) + .getValue(); + return this; + } + + DelegatedControllerImpl(DelegatedControllerInner innerObject, DelegatednetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.resourceName = Utils.getValueFromIdByName(innerObject.id(), "controller"); + } + + public DelegatedController refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getControllers() + .getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE) + .getValue(); + return this; + } + + public DelegatedController refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getControllers() + .getByResourceGroupWithResponse(resourceGroupName, resourceName, context) + .getValue(); + return this; + } + + public DelegatedControllerImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public DelegatedControllerImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public DelegatedControllerImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedNetworksClientImpl.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedNetworksClientImpl.java new file mode 100644 index 0000000000000..3dcc2a59d916a --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedNetworksClientImpl.java @@ -0,0 +1,563 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.delegatednetwork.fluent.DelegatedNetworksClient; +import com.azure.resourcemanager.delegatednetwork.fluent.models.DelegatedControllerInner; +import com.azure.resourcemanager.delegatednetwork.models.DelegatedControllers; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DelegatedNetworksClient. */ +public final class DelegatedNetworksClientImpl implements DelegatedNetworksClient { + private final ClientLogger logger = new ClientLogger(DelegatedNetworksClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DelegatedNetworksService service; + + /** The service client containing this operation class. */ + private final DncImpl client; + + /** + * Initializes an instance of DelegatedNetworksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DelegatedNetworksClientImpl(DncImpl client) { + this.service = + RestProxy.create(DelegatedNetworksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DncDelegatedNetworks to be used by the proxy service to perform REST + * calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DncDelegatedNetworks") + private interface DelegatedNetworksService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DelegatedNetwork/controllers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork" + + "/controllers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get all the delegatedController resources in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the delegatedController resources in a subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get all the delegatedController resources in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the delegatedController resources in a subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get all the delegatedController resources in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the delegatedController resources in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Get all the delegatedController resources in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the delegatedController resources in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Get all the delegatedController resources in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the delegatedController resources in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Get all the delegatedController resources in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the delegatedController resources in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the delegatedController resources in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the delegatedController resources in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the delegatedController resources in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the delegatedController resources in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the delegatedController resources in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the delegatedController resources in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of Delegated controller resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of Delegated controller resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of Delegated controller resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of Delegated controller resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedNetworksImpl.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedNetworksImpl.java new file mode 100644 index 0000000000000..9d583b8e9bd87 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedNetworksImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.delegatednetwork.DelegatednetworkManager; +import com.azure.resourcemanager.delegatednetwork.fluent.DelegatedNetworksClient; +import com.azure.resourcemanager.delegatednetwork.fluent.models.DelegatedControllerInner; +import com.azure.resourcemanager.delegatednetwork.models.DelegatedController; +import com.azure.resourcemanager.delegatednetwork.models.DelegatedNetworks; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DelegatedNetworksImpl implements DelegatedNetworks { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DelegatedNetworksImpl.class); + + private final DelegatedNetworksClient innerClient; + + private final DelegatednetworkManager serviceManager; + + public DelegatedNetworksImpl(DelegatedNetworksClient innerClient, DelegatednetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new DelegatedControllerImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new DelegatedControllerImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new DelegatedControllerImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new DelegatedControllerImpl(inner1, this.manager())); + } + + private DelegatedNetworksClient serviceClient() { + return this.innerClient; + } + + private DelegatednetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedSubnetImpl.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedSubnetImpl.java new file mode 100644 index 0000000000000..fbe5801e88107 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedSubnetImpl.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.delegatednetwork.DelegatednetworkManager; +import com.azure.resourcemanager.delegatednetwork.fluent.models.DelegatedSubnetInner; +import com.azure.resourcemanager.delegatednetwork.models.ControllerDetails; +import com.azure.resourcemanager.delegatednetwork.models.DelegatedSubnet; +import com.azure.resourcemanager.delegatednetwork.models.DelegatedSubnetState; +import com.azure.resourcemanager.delegatednetwork.models.ResourceUpdateParameters; +import com.azure.resourcemanager.delegatednetwork.models.SubnetDetails; +import java.util.Collections; +import java.util.Map; + +public final class DelegatedSubnetImpl implements DelegatedSubnet, DelegatedSubnet.Definition, DelegatedSubnet.Update { + private DelegatedSubnetInner innerObject; + + private final DelegatednetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public DelegatedSubnetState provisioningState() { + return this.innerModel().provisioningState(); + } + + public SubnetDetails subnetDetails() { + return this.innerModel().subnetDetails(); + } + + public ControllerDetails controllerDetails() { + return this.innerModel().controllerDetails(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public DelegatedSubnetInner innerModel() { + return this.innerObject; + } + + private DelegatednetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String resourceName; + + private ResourceUpdateParameters updateParameters; + + public DelegatedSubnetImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public DelegatedSubnet create() { + this.innerObject = + serviceManager + .serviceClient() + .getDelegatedSubnetServices() + .putDetails(resourceGroupName, resourceName, this.innerModel(), Context.NONE); + return this; + } + + public DelegatedSubnet create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDelegatedSubnetServices() + .putDetails(resourceGroupName, resourceName, this.innerModel(), context); + return this; + } + + DelegatedSubnetImpl(String name, DelegatednetworkManager serviceManager) { + this.innerObject = new DelegatedSubnetInner(); + this.serviceManager = serviceManager; + this.resourceName = name; + } + + public DelegatedSubnetImpl update() { + this.updateParameters = new ResourceUpdateParameters(); + return this; + } + + public DelegatedSubnet apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDelegatedSubnetServices() + .patchDetails(resourceGroupName, resourceName, updateParameters, Context.NONE); + return this; + } + + public DelegatedSubnet apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDelegatedSubnetServices() + .patchDetails(resourceGroupName, resourceName, updateParameters, context); + return this; + } + + DelegatedSubnetImpl(DelegatedSubnetInner innerObject, DelegatednetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.resourceName = Utils.getValueFromIdByName(innerObject.id(), "delegatedSubnets"); + } + + public DelegatedSubnet refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDelegatedSubnetServices() + .getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE) + .getValue(); + return this; + } + + public DelegatedSubnet refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDelegatedSubnetServices() + .getByResourceGroupWithResponse(resourceGroupName, resourceName, context) + .getValue(); + return this; + } + + public DelegatedSubnetImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public DelegatedSubnetImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public DelegatedSubnetImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public DelegatedSubnetImpl withSubnetDetails(SubnetDetails subnetDetails) { + this.innerModel().withSubnetDetails(subnetDetails); + return this; + } + + public DelegatedSubnetImpl withControllerDetails(ControllerDetails controllerDetails) { + this.innerModel().withControllerDetails(controllerDetails); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedSubnetServicesClientImpl.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedSubnetServicesClientImpl.java new file mode 100644 index 0000000000000..4f11c7b339052 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedSubnetServicesClientImpl.java @@ -0,0 +1,1635 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.delegatednetwork.fluent.DelegatedSubnetServicesClient; +import com.azure.resourcemanager.delegatednetwork.fluent.models.DelegatedSubnetInner; +import com.azure.resourcemanager.delegatednetwork.models.DelegatedSubnets; +import com.azure.resourcemanager.delegatednetwork.models.ResourceUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DelegatedSubnetServicesClient. */ +public final class DelegatedSubnetServicesClientImpl implements DelegatedSubnetServicesClient { + private final ClientLogger logger = new ClientLogger(DelegatedSubnetServicesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DelegatedSubnetServicesService service; + + /** The service client containing this operation class. */ + private final DncImpl client; + + /** + * Initializes an instance of DelegatedSubnetServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DelegatedSubnetServicesClientImpl(DncImpl client) { + this.service = + RestProxy + .create(DelegatedSubnetServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DncDelegatedSubnetServices to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DncDelegatedSubnetSe") + private interface DelegatedSubnetServicesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork" + + "/delegatedSubnets/{resourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork" + + "/delegatedSubnets/{resourceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> putDetails( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") DelegatedSubnetInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork" + + "/delegatedSubnets/{resourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> patchDetails( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ResourceUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork" + + "/delegatedSubnets/{resourceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("forceDelete") Boolean forceDelete, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DelegatedNetwork/delegatedSubnets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork" + + "/delegatedSubnets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified dnc DelegatedSubnet Link. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String resourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + resourceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified dnc DelegatedSubnet Link. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String resourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + resourceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified dnc DelegatedSubnet Link. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String resourceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified dnc DelegatedSubnet Link. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DelegatedSubnetInner getByResourceGroup(String resourceGroupName, String resourceName) { + return getByResourceGroupAsync(resourceGroupName, resourceName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified dnc DelegatedSubnet Link. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> putDetailsWithResponseAsync( + String resourceGroupName, String resourceName, DelegatedSubnetInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .putDetails( + this.client.getEndpoint(), + resourceGroupName, + resourceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> putDetailsWithResponseAsync( + String resourceGroupName, String resourceName, DelegatedSubnetInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .putDetails( + this.client.getEndpoint(), + resourceGroupName, + resourceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DelegatedSubnetInner> beginPutDetailsAsync( + String resourceGroupName, String resourceName, DelegatedSubnetInner parameters) { + Mono>> mono = + putDetailsWithResponseAsync(resourceGroupName, resourceName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DelegatedSubnetInner.class, + DelegatedSubnetInner.class, + Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DelegatedSubnetInner> beginPutDetailsAsync( + String resourceGroupName, String resourceName, DelegatedSubnetInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + putDetailsWithResponseAsync(resourceGroupName, resourceName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DelegatedSubnetInner.class, DelegatedSubnetInner.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DelegatedSubnetInner> beginPutDetails( + String resourceGroupName, String resourceName, DelegatedSubnetInner parameters) { + return beginPutDetailsAsync(resourceGroupName, resourceName, parameters).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DelegatedSubnetInner> beginPutDetails( + String resourceGroupName, String resourceName, DelegatedSubnetInner parameters, Context context) { + return beginPutDetailsAsync(resourceGroupName, resourceName, parameters, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putDetailsAsync( + String resourceGroupName, String resourceName, DelegatedSubnetInner parameters) { + return beginPutDetailsAsync(resourceGroupName, resourceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putDetailsAsync( + String resourceGroupName, String resourceName, DelegatedSubnetInner parameters, Context context) { + return beginPutDetailsAsync(resourceGroupName, resourceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DelegatedSubnetInner putDetails( + String resourceGroupName, String resourceName, DelegatedSubnetInner parameters) { + return putDetailsAsync(resourceGroupName, resourceName, parameters).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DelegatedSubnetInner putDetails( + String resourceGroupName, String resourceName, DelegatedSubnetInner parameters, Context context) { + return putDetailsAsync(resourceGroupName, resourceName, parameters, context).block(); + } + + /** + * 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 parameters Delegated subnet details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> patchDetailsWithResponseAsync( + String resourceGroupName, String resourceName, ResourceUpdateParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .patchDetails( + this.client.getEndpoint(), + resourceGroupName, + resourceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 parameters Delegated subnet details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> patchDetailsWithResponseAsync( + String resourceGroupName, String resourceName, ResourceUpdateParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .patchDetails( + this.client.getEndpoint(), + resourceGroupName, + resourceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * 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 parameters Delegated subnet details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DelegatedSubnetInner> beginPatchDetailsAsync( + String resourceGroupName, String resourceName, ResourceUpdateParameters parameters) { + Mono>> mono = + patchDetailsWithResponseAsync(resourceGroupName, resourceName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DelegatedSubnetInner.class, + DelegatedSubnetInner.class, + Context.NONE); + } + + /** + * 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 parameters Delegated subnet details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DelegatedSubnetInner> beginPatchDetailsAsync( + String resourceGroupName, String resourceName, ResourceUpdateParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + patchDetailsWithResponseAsync(resourceGroupName, resourceName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DelegatedSubnetInner.class, DelegatedSubnetInner.class, context); + } + + /** + * 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 parameters Delegated subnet details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DelegatedSubnetInner> beginPatchDetails( + String resourceGroupName, String resourceName, ResourceUpdateParameters parameters) { + return beginPatchDetailsAsync(resourceGroupName, resourceName, parameters).getSyncPoller(); + } + + /** + * 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 parameters Delegated subnet details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DelegatedSubnetInner> beginPatchDetails( + String resourceGroupName, String resourceName, ResourceUpdateParameters parameters, Context context) { + return beginPatchDetailsAsync(resourceGroupName, resourceName, parameters, context).getSyncPoller(); + } + + /** + * 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 parameters Delegated subnet details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono patchDetailsAsync( + String resourceGroupName, String resourceName, ResourceUpdateParameters parameters) { + return beginPatchDetailsAsync(resourceGroupName, resourceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 parameters Delegated subnet details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono patchDetailsAsync( + String resourceGroupName, String resourceName, ResourceUpdateParameters parameters, Context context) { + return beginPatchDetailsAsync(resourceGroupName, resourceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 parameters Delegated subnet details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DelegatedSubnetInner patchDetails( + String resourceGroupName, String resourceName, ResourceUpdateParameters parameters) { + return patchDetailsAsync(resourceGroupName, resourceName, parameters).block(); + } + + /** + * 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 parameters Delegated subnet details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DelegatedSubnetInner patchDetails( + String resourceGroupName, String resourceName, ResourceUpdateParameters parameters, Context context) { + return patchDetailsAsync(resourceGroupName, resourceName, parameters, context).block(); + } + + /** + * Delete 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 forceDelete Force delete resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String resourceName, Boolean forceDelete) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + resourceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + forceDelete, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Delete 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 forceDelete Force delete resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String resourceName, Boolean forceDelete, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + resourceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + forceDelete, + accept, + context); + } + + /** + * Delete 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 forceDelete Force delete resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String resourceName, Boolean forceDelete) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName, forceDelete); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete 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 forceDelete Force delete resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String resourceName, Boolean forceDelete, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, resourceName, forceDelete, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete 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 forceDelete Force delete resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String resourceName, Boolean forceDelete) { + return beginDeleteAsync(resourceGroupName, resourceName, forceDelete).getSyncPoller(); + } + + /** + * Delete 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 forceDelete Force delete resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String resourceName, Boolean forceDelete, Context context) { + return beginDeleteAsync(resourceGroupName, resourceName, forceDelete, context).getSyncPoller(); + } + + /** + * Delete 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 forceDelete Force delete resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String resourceName, Boolean forceDelete) { + return beginDeleteAsync(resourceGroupName, resourceName, forceDelete) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String resourceName) { + final Boolean forceDelete = null; + return beginDeleteAsync(resourceGroupName, resourceName, forceDelete) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete 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 forceDelete Force delete resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String resourceName, Boolean forceDelete, Context context) { + return beginDeleteAsync(resourceGroupName, resourceName, forceDelete, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete 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 forceDelete Force delete resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String resourceName, Boolean forceDelete) { + deleteAsync(resourceGroupName, resourceName, forceDelete).block(); + } + + /** + * Delete 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String resourceName) { + final Boolean forceDelete = null; + deleteAsync(resourceGroupName, resourceName, forceDelete).block(); + } + + /** + * Delete 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 forceDelete Force delete resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String resourceName, Boolean forceDelete, Context context) { + deleteAsync(resourceGroupName, resourceName, forceDelete, context).block(); + } + + /** + * Get all the DelegatedSubnets resources in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the DelegatedSubnets resources in a subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get all the DelegatedSubnets resources in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the DelegatedSubnets resources in a subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get all the DelegatedSubnets resources in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the DelegatedSubnets resources in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Get all the DelegatedSubnets resources in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the DelegatedSubnets resources in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Get all the DelegatedSubnets resources in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the DelegatedSubnets resources in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Get all the DelegatedSubnets resources in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the DelegatedSubnets resources in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the DelegatedSubnets resources in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the DelegatedSubnets resources in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the DelegatedSubnets resources in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the DelegatedSubnets resources in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the DelegatedSubnets resources in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the DelegatedSubnets resources in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of DelegatedSubnet resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of DelegatedSubnet resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of DelegatedSubnet resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of DelegatedSubnet resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedSubnetServicesImpl.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedSubnetServicesImpl.java new file mode 100644 index 0000000000000..8e1717a5922a8 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedSubnetServicesImpl.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.delegatednetwork.DelegatednetworkManager; +import com.azure.resourcemanager.delegatednetwork.fluent.DelegatedSubnetServicesClient; +import com.azure.resourcemanager.delegatednetwork.fluent.models.DelegatedSubnetInner; +import com.azure.resourcemanager.delegatednetwork.models.DelegatedSubnet; +import com.azure.resourcemanager.delegatednetwork.models.DelegatedSubnetServices; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DelegatedSubnetServicesImpl implements DelegatedSubnetServices { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DelegatedSubnetServicesImpl.class); + + private final DelegatedSubnetServicesClient innerClient; + + private final DelegatednetworkManager serviceManager; + + public DelegatedSubnetServicesImpl( + DelegatedSubnetServicesClient innerClient, DelegatednetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public DelegatedSubnet getByResourceGroup(String resourceGroupName, String resourceName) { + DelegatedSubnetInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, resourceName); + if (inner != null) { + return new DelegatedSubnetImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, resourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DelegatedSubnetImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String resourceName, Boolean forceDelete) { + this.serviceClient().delete(resourceGroupName, resourceName, forceDelete); + } + + public void delete(String resourceGroupName, String resourceName) { + this.serviceClient().delete(resourceGroupName, resourceName); + } + + public void delete(String resourceGroupName, String resourceName, Boolean forceDelete, Context context) { + this.serviceClient().delete(resourceGroupName, resourceName, forceDelete, context); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new DelegatedSubnetImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new DelegatedSubnetImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new DelegatedSubnetImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new DelegatedSubnetImpl(inner1, this.manager())); + } + + public DelegatedSubnet getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = Utils.getValueFromIdByName(id, "delegatedSubnets"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'delegatedSubnets'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = Utils.getValueFromIdByName(id, "delegatedSubnets"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'delegatedSubnets'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, resourceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = Utils.getValueFromIdByName(id, "delegatedSubnets"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'delegatedSubnets'.", id))); + } + Boolean localForceDelete = null; + this.delete(resourceGroupName, resourceName, localForceDelete, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Boolean forceDelete, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = Utils.getValueFromIdByName(id, "delegatedSubnets"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'delegatedSubnets'.", id))); + } + this.delete(resourceGroupName, resourceName, forceDelete, context); + } + + private DelegatedSubnetServicesClient serviceClient() { + return this.innerClient; + } + + private DelegatednetworkManager manager() { + return this.serviceManager; + } + + public DelegatedSubnetImpl define(String name) { + return new DelegatedSubnetImpl(name, this.manager()); + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DncBuilder.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DncBuilder.java new file mode 100644 index 0000000000000..2f363a5654c4c --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DncBuilder.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the DncImpl type. */ +@ServiceClientBuilder(serviceClients = {DncImpl.class}) +public final class DncBuilder { + /* + * A unique identifier for a Microsoft Azure subscription. The subscription + * ID forms part of the URI for every service call. + */ + private String 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 DncBuilder. + */ + public DncBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the DncBuilder. + */ + public DncBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the DncBuilder. + */ + public DncBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the DncBuilder. + */ + public DncBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the DncBuilder. + */ + public DncBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the DncBuilder. + */ + public DncBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of DncImpl with the provided parameters. + * + * @return an instance of DncImpl. + */ + public DncImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + DncImpl client = + new DncImpl(pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DncImpl.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DncImpl.java new file mode 100644 index 0000000000000..b6ea7b9cfc49c --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DncImpl.java @@ -0,0 +1,354 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.delegatednetwork.fluent.ControllersClient; +import com.azure.resourcemanager.delegatednetwork.fluent.DelegatedNetworksClient; +import com.azure.resourcemanager.delegatednetwork.fluent.DelegatedSubnetServicesClient; +import com.azure.resourcemanager.delegatednetwork.fluent.Dnc; +import com.azure.resourcemanager.delegatednetwork.fluent.OperationsClient; +import com.azure.resourcemanager.delegatednetwork.fluent.OrchestratorInstanceServicesClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the DncImpl type. */ +@ServiceClient(builder = DncBuilder.class) +public final class DncImpl implements Dnc { + private final ClientLogger logger = new ClientLogger(DncImpl.class); + + /** + * A unique identifier for a Microsoft Azure subscription. The subscription ID forms part of the URI for every + * service call. + */ + private final 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 getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The ControllersClient object to access its operations. */ + private final ControllersClient controllers; + + /** + * Gets the ControllersClient object to access its operations. + * + * @return the ControllersClient object. + */ + public ControllersClient getControllers() { + return this.controllers; + } + + /** The DelegatedNetworksClient object to access its operations. */ + private final DelegatedNetworksClient delegatedNetworks; + + /** + * Gets the DelegatedNetworksClient object to access its operations. + * + * @return the DelegatedNetworksClient object. + */ + public DelegatedNetworksClient getDelegatedNetworks() { + return this.delegatedNetworks; + } + + /** The OrchestratorInstanceServicesClient object to access its operations. */ + private final OrchestratorInstanceServicesClient orchestratorInstanceServices; + + /** + * Gets the OrchestratorInstanceServicesClient object to access its operations. + * + * @return the OrchestratorInstanceServicesClient object. + */ + public OrchestratorInstanceServicesClient getOrchestratorInstanceServices() { + return this.orchestratorInstanceServices; + } + + /** The DelegatedSubnetServicesClient object to access its operations. */ + private final DelegatedSubnetServicesClient delegatedSubnetServices; + + /** + * Gets the DelegatedSubnetServicesClient object to access its operations. + * + * @return the DelegatedSubnetServicesClient object. + */ + public DelegatedSubnetServicesClient getDelegatedSubnetServices() { + return this.delegatedSubnetServices; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** + * Initializes an instance of Dnc client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId A unique identifier for a Microsoft Azure subscription. The subscription ID forms part of + * the URI for every service call. + * @param endpoint server parameter. + */ + DncImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2020-08-08-preview"; + this.controllers = new ControllersClientImpl(this); + this.delegatedNetworks = new DelegatedNetworksClientImpl(this); + this.orchestratorInstanceServices = new OrchestratorInstanceServicesClientImpl(this); + this.delegatedSubnetServices = new DelegatedSubnetServicesClientImpl(this); + this.operations = new OperationsClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + logger.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OperationImpl.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OperationImpl.java new file mode 100644 index 0000000000000..13ad508dfdc38 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OperationImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.implementation; + +import com.azure.resourcemanager.delegatednetwork.DelegatednetworkManager; +import com.azure.resourcemanager.delegatednetwork.fluent.models.OperationInner; +import com.azure.resourcemanager.delegatednetwork.models.Operation; +import com.azure.resourcemanager.delegatednetwork.models.OperationDisplay; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final DelegatednetworkManager serviceManager; + + OperationImpl(OperationInner innerObject, DelegatednetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public Object properties() { + return this.innerModel().properties(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private DelegatednetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OperationsClientImpl.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..1b948a63c0f0e --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OperationsClientImpl.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.delegatednetwork.fluent.OperationsClient; +import com.azure.resourcemanager.delegatednetwork.fluent.models.OperationInner; +import com.azure.resourcemanager.delegatednetwork.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final DncImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(DncImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DncOperations to be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DncOperations") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.DelegatedNetwork/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the available DelegatedNetwork service REST API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of request to list controller operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all of the available DelegatedNetwork service REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of request to list controller operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the available DelegatedNetwork service REST API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of request to list controller operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available DelegatedNetwork service REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of request to list controller operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the available DelegatedNetwork service REST API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of request to list controller operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available DelegatedNetwork service REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of request to list controller operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of request to list controller operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of request to list controller operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OperationsImpl.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..ad582111328ce --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OperationsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.delegatednetwork.DelegatednetworkManager; +import com.azure.resourcemanager.delegatednetwork.fluent.OperationsClient; +import com.azure.resourcemanager.delegatednetwork.fluent.models.OperationInner; +import com.azure.resourcemanager.delegatednetwork.models.Operation; +import com.azure.resourcemanager.delegatednetwork.models.Operations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final DelegatednetworkManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, DelegatednetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private DelegatednetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorImpl.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorImpl.java new file mode 100644 index 0000000000000..c75d5459e8ece --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorImpl.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.delegatednetwork.DelegatednetworkManager; +import com.azure.resourcemanager.delegatednetwork.fluent.models.OrchestratorInner; +import com.azure.resourcemanager.delegatednetwork.models.ControllerDetails; +import com.azure.resourcemanager.delegatednetwork.models.Orchestrator; +import com.azure.resourcemanager.delegatednetwork.models.OrchestratorIdentity; +import com.azure.resourcemanager.delegatednetwork.models.OrchestratorInstanceState; +import com.azure.resourcemanager.delegatednetwork.models.OrchestratorKind; +import com.azure.resourcemanager.delegatednetwork.models.OrchestratorResourceUpdateParameters; +import java.util.Collections; +import java.util.Map; + +public final class OrchestratorImpl implements Orchestrator, Orchestrator.Definition, Orchestrator.Update { + private OrchestratorInner innerObject; + + private final DelegatednetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public OrchestratorKind kind() { + return this.innerModel().kind(); + } + + public OrchestratorIdentity identity() { + return this.innerModel().identity(); + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public OrchestratorInstanceState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String orchestratorAppId() { + return this.innerModel().orchestratorAppId(); + } + + public String orchestratorTenantId() { + return this.innerModel().orchestratorTenantId(); + } + + public String clusterRootCA() { + return this.innerModel().clusterRootCA(); + } + + public String apiServerEndpoint() { + return this.innerModel().apiServerEndpoint(); + } + + public ControllerDetails controllerDetails() { + return this.innerModel().controllerDetails(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public OrchestratorInner innerModel() { + return this.innerObject; + } + + private DelegatednetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String resourceName; + + private OrchestratorResourceUpdateParameters updateParameters; + + public OrchestratorImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Orchestrator create() { + this.innerObject = + serviceManager + .serviceClient() + .getOrchestratorInstanceServices() + .create(resourceGroupName, resourceName, this.innerModel(), Context.NONE); + return this; + } + + public Orchestrator create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getOrchestratorInstanceServices() + .create(resourceGroupName, resourceName, this.innerModel(), context); + return this; + } + + OrchestratorImpl(String name, DelegatednetworkManager serviceManager) { + this.innerObject = new OrchestratorInner(); + this.serviceManager = serviceManager; + this.resourceName = name; + } + + public OrchestratorImpl update() { + this.updateParameters = new OrchestratorResourceUpdateParameters(); + return this; + } + + public Orchestrator apply() { + this.innerObject = + serviceManager + .serviceClient() + .getOrchestratorInstanceServices() + .patchWithResponse(resourceGroupName, resourceName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public Orchestrator apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getOrchestratorInstanceServices() + .patchWithResponse(resourceGroupName, resourceName, updateParameters, context) + .getValue(); + return this; + } + + OrchestratorImpl(OrchestratorInner innerObject, DelegatednetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.resourceName = Utils.getValueFromIdByName(innerObject.id(), "orchestrators"); + } + + public Orchestrator refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getOrchestratorInstanceServices() + .getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE) + .getValue(); + return this; + } + + public Orchestrator refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getOrchestratorInstanceServices() + .getByResourceGroupWithResponse(resourceGroupName, resourceName, context) + .getValue(); + return this; + } + + public OrchestratorImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public OrchestratorImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public OrchestratorImpl withKind(OrchestratorKind kind) { + this.innerModel().withKind(kind); + return this; + } + + public OrchestratorImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public OrchestratorImpl withIdentity(OrchestratorIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public OrchestratorImpl withOrchestratorAppId(String orchestratorAppId) { + this.innerModel().withOrchestratorAppId(orchestratorAppId); + return this; + } + + public OrchestratorImpl withOrchestratorTenantId(String orchestratorTenantId) { + this.innerModel().withOrchestratorTenantId(orchestratorTenantId); + return this; + } + + public OrchestratorImpl withClusterRootCA(String clusterRootCA) { + this.innerModel().withClusterRootCA(clusterRootCA); + return this; + } + + public OrchestratorImpl withApiServerEndpoint(String apiServerEndpoint) { + this.innerModel().withApiServerEndpoint(apiServerEndpoint); + return this; + } + + public OrchestratorImpl withControllerDetails(ControllerDetails controllerDetails) { + this.innerModel().withControllerDetails(controllerDetails); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorInstanceServicesClientImpl.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorInstanceServicesClientImpl.java new file mode 100644 index 0000000000000..bbbef0405aa9e --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorInstanceServicesClientImpl.java @@ -0,0 +1,1477 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.delegatednetwork.fluent.OrchestratorInstanceServicesClient; +import com.azure.resourcemanager.delegatednetwork.fluent.models.OrchestratorInner; +import com.azure.resourcemanager.delegatednetwork.models.OrchestratorResourceUpdateParameters; +import com.azure.resourcemanager.delegatednetwork.models.Orchestrators; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OrchestratorInstanceServicesClient. */ +public final class OrchestratorInstanceServicesClientImpl implements OrchestratorInstanceServicesClient { + private final ClientLogger logger = new ClientLogger(OrchestratorInstanceServicesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OrchestratorInstanceServicesService service; + + /** The service client containing this operation class. */ + private final DncImpl client; + + /** + * Initializes an instance of OrchestratorInstanceServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OrchestratorInstanceServicesClientImpl(DncImpl client) { + this.service = + RestProxy + .create( + OrchestratorInstanceServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DncOrchestratorInstanceServices to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DncOrchestratorInsta") + private interface OrchestratorInstanceServicesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork" + + "/orchestrators/{resourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork" + + "/orchestrators/{resourceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") OrchestratorInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork" + + "/orchestrators/{resourceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork" + + "/orchestrators/{resourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> patch( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") OrchestratorResourceUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DelegatedNetwork/orchestrators") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DelegatedNetwork" + + "/orchestrators") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the orchestrator instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String resourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + resourceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the orchestrator instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String resourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + resourceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the orchestrator instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String resourceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the orchestrator instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrchestratorInner getByResourceGroup(String resourceGroupName, String resourceName) { + return getByResourceGroupAsync(resourceGroupName, resourceName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the orchestrator instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String resourceName, OrchestratorInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + resourceGroupName, + resourceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String resourceName, OrchestratorInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + resourceGroupName, + resourceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, OrchestratorInner> beginCreateAsync( + String resourceGroupName, String resourceName, OrchestratorInner parameters) { + Mono>> mono = createWithResponseAsync(resourceGroupName, resourceName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), OrchestratorInner.class, OrchestratorInner.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, OrchestratorInner> beginCreateAsync( + String resourceGroupName, String resourceName, OrchestratorInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, resourceName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), OrchestratorInner.class, OrchestratorInner.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OrchestratorInner> beginCreate( + String resourceGroupName, String resourceName, OrchestratorInner parameters) { + return beginCreateAsync(resourceGroupName, resourceName, parameters).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OrchestratorInner> beginCreate( + String resourceGroupName, String resourceName, OrchestratorInner parameters, Context context) { + return beginCreateAsync(resourceGroupName, resourceName, parameters, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String resourceName, OrchestratorInner parameters) { + return beginCreateAsync(resourceGroupName, resourceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String resourceName, OrchestratorInner parameters, Context context) { + return beginCreateAsync(resourceGroupName, resourceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrchestratorInner create(String resourceGroupName, String resourceName, OrchestratorInner parameters) { + return createAsync(resourceGroupName, resourceName, parameters).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrchestratorInner create( + String resourceGroupName, String resourceName, OrchestratorInner parameters, Context context) { + return createAsync(resourceGroupName, resourceName, parameters, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + resourceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String resourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + resourceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String resourceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName) { + return beginDeleteAsync(resourceGroupName, resourceName).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String resourceName, Context context) { + return beginDeleteAsync(resourceGroupName, resourceName, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String resourceName) { + return beginDeleteAsync(resourceGroupName, resourceName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String resourceName, Context context) { + return beginDeleteAsync(resourceGroupName, resourceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String resourceName) { + deleteAsync(resourceGroupName, resourceName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String resourceName, Context context) { + deleteAsync(resourceGroupName, resourceName, context).block(); + } + + /** + * 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 parameters OrchestratorInstance update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> patchWithResponseAsync( + String resourceGroupName, String resourceName, OrchestratorResourceUpdateParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .patch( + this.client.getEndpoint(), + resourceGroupName, + resourceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 parameters OrchestratorInstance update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> patchWithResponseAsync( + String resourceGroupName, + String resourceName, + OrchestratorResourceUpdateParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .patch( + this.client.getEndpoint(), + resourceGroupName, + resourceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * 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 parameters OrchestratorInstance update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono patchAsync( + String resourceGroupName, String resourceName, OrchestratorResourceUpdateParameters parameters) { + return patchWithResponseAsync(resourceGroupName, resourceName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 parameters OrchestratorInstance update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrchestratorInner patch( + String resourceGroupName, String resourceName, OrchestratorResourceUpdateParameters parameters) { + return patchAsync(resourceGroupName, resourceName, parameters).block(); + } + + /** + * 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 parameters OrchestratorInstance update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an instance of a orchestrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response patchWithResponse( + String resourceGroupName, + String resourceName, + OrchestratorResourceUpdateParameters parameters, + Context context) { + return patchWithResponseAsync(resourceGroupName, resourceName, parameters, context).block(); + } + + /** + * Get all the orchestratorInstance resources in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the orchestratorInstance resources in a subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get all the orchestratorInstance resources in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the orchestratorInstance resources in a subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get all the orchestratorInstance resources in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the orchestratorInstance resources in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Get all the orchestratorInstance resources in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the orchestratorInstance resources in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Get all the orchestratorInstance resources in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the orchestratorInstance resources in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Get all the orchestratorInstance resources in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the orchestratorInstance resources in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the OrchestratorInstances resources in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the OrchestratorInstances resources in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the OrchestratorInstances resources in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the OrchestratorInstances resources in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the OrchestratorInstances resources in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the OrchestratorInstances resources in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of OrchestratorInstance resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of OrchestratorInstance resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of OrchestratorInstance resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of OrchestratorInstance resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorInstanceServicesImpl.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorInstanceServicesImpl.java new file mode 100644 index 0000000000000..feda89de8f252 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorInstanceServicesImpl.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.delegatednetwork.DelegatednetworkManager; +import com.azure.resourcemanager.delegatednetwork.fluent.OrchestratorInstanceServicesClient; +import com.azure.resourcemanager.delegatednetwork.fluent.models.OrchestratorInner; +import com.azure.resourcemanager.delegatednetwork.models.Orchestrator; +import com.azure.resourcemanager.delegatednetwork.models.OrchestratorInstanceServices; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OrchestratorInstanceServicesImpl implements OrchestratorInstanceServices { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OrchestratorInstanceServicesImpl.class); + + private final OrchestratorInstanceServicesClient innerClient; + + private final DelegatednetworkManager serviceManager; + + public OrchestratorInstanceServicesImpl( + OrchestratorInstanceServicesClient innerClient, DelegatednetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Orchestrator getByResourceGroup(String resourceGroupName, String resourceName) { + OrchestratorInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, resourceName); + if (inner != null) { + return new OrchestratorImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, resourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OrchestratorImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String resourceName) { + this.serviceClient().delete(resourceGroupName, resourceName); + } + + public void delete(String resourceGroupName, String resourceName, Context context) { + this.serviceClient().delete(resourceGroupName, resourceName, context); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OrchestratorImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OrchestratorImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new OrchestratorImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new OrchestratorImpl(inner1, this.manager())); + } + + public Orchestrator getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = Utils.getValueFromIdByName(id, "orchestrators"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'orchestrators'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = Utils.getValueFromIdByName(id, "orchestrators"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'orchestrators'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, resourceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = Utils.getValueFromIdByName(id, "orchestrators"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'orchestrators'.", id))); + } + this.delete(resourceGroupName, resourceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = Utils.getValueFromIdByName(id, "orchestrators"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'orchestrators'.", id))); + } + this.delete(resourceGroupName, resourceName, context); + } + + private OrchestratorInstanceServicesClient serviceClient() { + return this.innerClient; + } + + private DelegatednetworkManager manager() { + return this.serviceManager; + } + + public OrchestratorImpl define(String name) { + return new OrchestratorImpl(name, this.manager()); + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/Utils.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/Utils.java new file mode 100644 index 0000000000000..2461e3a95d714 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/Utils.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Mono; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pageIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pageIterable, Function mapper) { + super(new PagedFlux(Mono::empty)); + this.pageIterable = pageIterable; + this.mapper = mapper; + this.pageMapper = + page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pageIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pageIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pageIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pageIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pageIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pageIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pageIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pageIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pageIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pageIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/package-info.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/package-info.java new file mode 100644 index 0000000000000..44dce83d63777 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the implementations for Dnc. DNC web api provides way to create, get and delete dnc controller. + */ +package com.azure.resourcemanager.delegatednetwork.implementation; diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ControllerDetails.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ControllerDetails.java new file mode 100644 index 0000000000000..ab570a3762b23 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ControllerDetails.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** controller details. */ +@Fluent +public final class ControllerDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ControllerDetails.class); + + /* + * controller arm resource id + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: controller arm resource id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ControllerResource.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ControllerResource.java new file mode 100644 index 0000000000000..6202737e7b144 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ControllerResource.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Map; + +/** Represents an instance of a resource. */ +@Immutable +public class ControllerResource extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ControllerResource.class); + + /** {@inheritDoc} */ + @Override + public ControllerResource withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ControllerResource withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ControllerResourceUpdateParameters.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ControllerResourceUpdateParameters.java new file mode 100644 index 0000000000000..d34df2af712ea --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ControllerResourceUpdateParameters.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Parameters for updating a resource. */ +@Fluent +public final class ControllerResourceUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ControllerResourceUpdateParameters.class); + + /* + * The resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the tags property: The resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ControllerState.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ControllerState.java new file mode 100644 index 0000000000000..285ec4fe3ddf0 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ControllerState.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Controllers.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Controllers.java new file mode 100644 index 0000000000000..9d7c19a8a0652 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Controllers.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Controllers. */ +public interface Controllers { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified dnc controller. + */ + DelegatedController getByResourceGroup(String resourceGroupName, String resourceName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified dnc controller. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String resourceName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String resourceName, Context context); + + /** + * Gets details about the specified dnc controller. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified dnc controller. + */ + DelegatedController getById(String id); + + /** + * Gets details about the specified dnc controller. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified dnc controller. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the DNC controller. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the DNC controller. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new DelegatedController resource. + * + * @param name resource name. + * @return the first stage of the new DelegatedController definition. + */ + DelegatedController.DefinitionStages.Blank define(String name); +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedController.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedController.java new file mode 100644 index 0000000000000..b089ff5c7b89c --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedController.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.delegatednetwork.fluent.models.DelegatedControllerInner; +import java.util.Map; + +/** An immutable client-side representation of DelegatedController. */ +public interface DelegatedController { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the resourceGuid property: Resource guid. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the provisioningState property: The current state of dnc controller resource. + * + * @return the provisioningState value. + */ + ControllerState provisioningState(); + + /** + * Gets the dncAppId property: dnc application id should be used by customer to authenticate with dnc gateway. + * + * @return the dncAppId value. + */ + String dncAppId(); + + /** + * Gets the dncTenantId property: tenant id of dnc application id. + * + * @return the dncTenantId value. + */ + String dncTenantId(); + + /** + * Gets the dncEndpoint property: dnc endpoint url that customers can use to connect to. + * + * @return the dncEndpoint value. + */ + String dncEndpoint(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.delegatednetwork.fluent.models.DelegatedControllerInner object. + * + * @return the inner object. + */ + DelegatedControllerInner innerModel(); + + /** The entirety of the DelegatedController definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The DelegatedController definition stages. */ + interface DefinitionStages { + /** The first stage of the DelegatedController definition. */ + interface Blank extends WithLocation { + } + /** The stage of the DelegatedController definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the DelegatedController definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @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. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the DelegatedController definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags { + /** + * Executes the create request. + * + * @return the created resource. + */ + DelegatedController create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DelegatedController create(Context context); + } + /** The stage of the DelegatedController definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + } + /** + * Begins update for the DelegatedController resource. + * + * @return the stage of resource update. + */ + DelegatedController.Update update(); + + /** The template for DelegatedController update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DelegatedController apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DelegatedController apply(Context context); + } + /** The DelegatedController update stages. */ + interface UpdateStages { + /** The stage of the DelegatedController update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The resource tags.. + * + * @param tags The resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DelegatedController refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DelegatedController refresh(Context context); +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedControllers.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedControllers.java new file mode 100644 index 0000000000000..328c0dbc0459e --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedControllers.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.delegatednetwork.fluent.models.DelegatedControllerInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** An array of Delegated controller resources. */ +@Fluent +public final class DelegatedControllers { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DelegatedControllers.class); + + /* + * An array of Delegated controller resources. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The URL to get the next set of controllers. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: An array of Delegated controller resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of Delegated controller resources. + * + * @param value the value value to set. + * @return the DelegatedControllers object itself. + */ + public DelegatedControllers withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of controllers. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model DelegatedControllers")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedNetworks.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedNetworks.java new file mode 100644 index 0000000000000..c6c23f3df680b --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedNetworks.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of DelegatedNetworks. */ +public interface DelegatedNetworks { + /** + * Get all the delegatedController resources in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the delegatedController resources in a subscription. + */ + PagedIterable list(); + + /** + * Get all the delegatedController resources in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the delegatedController resources in a subscription. + */ + PagedIterable list(Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the delegatedController resources in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the delegatedController resources in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnet.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnet.java new file mode 100644 index 0000000000000..3ace9441e7c61 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnet.java @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.delegatednetwork.fluent.models.DelegatedSubnetInner; +import java.util.Map; + +/** An immutable client-side representation of DelegatedSubnet. */ +public interface DelegatedSubnet { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the resourceGuid property: Resource guid. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the provisioningState property: The current state of dnc delegated subnet resource. + * + * @return the provisioningState value. + */ + DelegatedSubnetState provisioningState(); + + /** + * Gets the subnetDetails property: orchestrator details. + * + * @return the subnetDetails value. + */ + SubnetDetails subnetDetails(); + + /** + * Gets the controllerDetails property: controller details. + * + * @return the controllerDetails value. + */ + ControllerDetails controllerDetails(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.delegatednetwork.fluent.models.DelegatedSubnetInner object. + * + * @return the inner object. + */ + DelegatedSubnetInner innerModel(); + + /** The entirety of the DelegatedSubnet definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The DelegatedSubnet definition stages. */ + interface DefinitionStages { + /** The first stage of the DelegatedSubnet definition. */ + interface Blank extends WithLocation { + } + /** The stage of the DelegatedSubnet definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the DelegatedSubnet definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @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. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the DelegatedSubnet definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithSubnetDetails, + DefinitionStages.WithControllerDetails { + /** + * Executes the create request. + * + * @return the created resource. + */ + DelegatedSubnet create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DelegatedSubnet create(Context context); + } + /** The stage of the DelegatedSubnet definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the DelegatedSubnet definition allowing to specify subnetDetails. */ + interface WithSubnetDetails { + /** + * Specifies the subnetDetails property: orchestrator details. + * + * @param subnetDetails orchestrator details. + * @return the next definition stage. + */ + WithCreate withSubnetDetails(SubnetDetails subnetDetails); + } + /** The stage of the DelegatedSubnet definition allowing to specify controllerDetails. */ + interface WithControllerDetails { + /** + * Specifies the controllerDetails property: controller details. + * + * @param controllerDetails controller details. + * @return the next definition stage. + */ + WithCreate withControllerDetails(ControllerDetails controllerDetails); + } + } + /** + * Begins update for the DelegatedSubnet resource. + * + * @return the stage of resource update. + */ + DelegatedSubnet.Update update(); + + /** The template for DelegatedSubnet update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DelegatedSubnet apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DelegatedSubnet apply(Context context); + } + /** The DelegatedSubnet update stages. */ + interface UpdateStages { + /** The stage of the DelegatedSubnet update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The resource tags.. + * + * @param tags The resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DelegatedSubnet refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DelegatedSubnet refresh(Context context); +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnetResource.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnetResource.java new file mode 100644 index 0000000000000..9fb78eb638a1a --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnetResource.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Map; + +/** Represents an instance of a resource. */ +@Immutable +public class DelegatedSubnetResource extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DelegatedSubnetResource.class); + + /** {@inheritDoc} */ + @Override + public DelegatedSubnetResource withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public DelegatedSubnetResource withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnetServices.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnetServices.java new file mode 100644 index 0000000000000..463c7f6cf438f --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnetServices.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of DelegatedSubnetServices. */ +public interface DelegatedSubnetServices { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified dnc DelegatedSubnet Link. + */ + DelegatedSubnet getByResourceGroup(String resourceGroupName, String resourceName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified dnc DelegatedSubnet Link. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context); + + /** + * Delete 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 forceDelete Force delete resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String resourceName, Boolean forceDelete); + + /** + * Delete 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String resourceName); + + /** + * Delete 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 forceDelete Force delete resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String resourceName, Boolean forceDelete, Context context); + + /** + * Get all the DelegatedSubnets resources in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the DelegatedSubnets resources in a subscription. + */ + PagedIterable list(); + + /** + * Get all the DelegatedSubnets resources in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the DelegatedSubnets resources in a subscription. + */ + PagedIterable list(Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the DelegatedSubnets resources in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the DelegatedSubnets resources in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets details about the specified dnc DelegatedSubnet Link. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified dnc DelegatedSubnet Link. + */ + DelegatedSubnet getById(String id); + + /** + * Gets details about the specified dnc DelegatedSubnet Link. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified dnc DelegatedSubnet Link. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete DelegatedSubnet. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete DelegatedSubnet. + * + * @param id the resource ID. + * @param forceDelete Force delete resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Boolean forceDelete, Context context); + + /** + * Begins definition for a new DelegatedSubnet resource. + * + * @param name resource name. + * @return the first stage of the new DelegatedSubnet definition. + */ + DelegatedSubnet.DefinitionStages.Blank define(String name); +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnetState.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnetState.java new file mode 100644 index 0000000000000..13479c13e7ccf --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnetState.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnets.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnets.java new file mode 100644 index 0000000000000..afaed5e418dde --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnets.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.delegatednetwork.fluent.models.DelegatedSubnetInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** An array of DelegatedSubnet resources. */ +@Fluent +public final class DelegatedSubnets { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DelegatedSubnets.class); + + /* + * An array of DelegatedSubnet resources. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The URL to get the next set of DelegatedSubnet resources. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: An array of DelegatedSubnet resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of DelegatedSubnet resources. + * + * @param value the value value to set. + * @return the DelegatedSubnets object itself. + */ + public DelegatedSubnets withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of DelegatedSubnet resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model DelegatedSubnets")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Operation.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Operation.java new file mode 100644 index 0000000000000..2853367140f04 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Operation.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.models; + +import com.azure.resourcemanager.delegatednetwork.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + String name(); + + /** + * Gets the origin property: Origin of the operation. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the isDataAction property: Gets or sets a value indicating whether the operation is a data action or not. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Operation properties display. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the properties property: Properties of the operation. + * + * @return the properties value. + */ + Object properties(); + + /** + * Gets the inner com.azure.resourcemanager.delegatednetwork.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OperationDisplay.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OperationDisplay.java new file mode 100644 index 0000000000000..fc36ebf525a38 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OperationDisplay.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The object that represents the operation. */ +@Immutable +public final class OperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); + + /* + * 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 the provider property: Service provider: Microsoft.DelegatedNetwork. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: Resource on which the operation is performed: controller, etc. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: Operation type: create, get, delete, etc. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: Friendly description for the operation,. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OperationListResult.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OperationListResult.java new file mode 100644 index 0000000000000..47e223a3b378a --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OperationListResult.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.delegatednetwork.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of request to list controller operations.It contains a list of operations and a URL link to get the next set + * of results. + */ +@Fluent +public final class OperationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); + + /* + * List of operations supported by the Microsoft.DelegatedNetwork resource + * provider. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of operations supported by the Microsoft.DelegatedNetwork resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Operations.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Operations.java new file mode 100644 index 0000000000000..d2409435e8d9a --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Operations.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists all of the available DelegatedNetwork service REST API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of request to list controller operations. + */ + PagedIterable list(); + + /** + * Lists all of the available DelegatedNetwork service REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of request to list controller operations. + */ + PagedIterable list(Context context); +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Orchestrator.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Orchestrator.java new file mode 100644 index 0000000000000..16db4c4b3363e --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Orchestrator.java @@ -0,0 +1,334 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.delegatednetwork.fluent.models.OrchestratorInner; +import java.util.Map; + +/** An immutable client-side representation of Orchestrator. */ +public interface Orchestrator { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the kind property: The kind of workbook. Choices are user and shared. + * + * @return the kind value. + */ + OrchestratorKind kind(); + + /** + * Gets the identity property: The identity of the orchestrator. + * + * @return the identity value. + */ + OrchestratorIdentity identity(); + + /** + * Gets the resourceGuid property: Resource guid. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the provisioningState property: The current state of orchestratorInstance resource. + * + * @return the provisioningState value. + */ + OrchestratorInstanceState provisioningState(); + + /** + * Gets the orchestratorAppId property: AAD ID used with apiserver. + * + * @return the orchestratorAppId value. + */ + String orchestratorAppId(); + + /** + * Gets the orchestratorTenantId property: TenantID of server App ID. + * + * @return the orchestratorTenantId value. + */ + String orchestratorTenantId(); + + /** + * Gets the clusterRootCA property: RootCA certificate of kubernetes cluster base64 encoded. + * + * @return the clusterRootCA value. + */ + String clusterRootCA(); + + /** + * Gets the apiServerEndpoint property: K8s APIServer url. + * + * @return the apiServerEndpoint value. + */ + String apiServerEndpoint(); + + /** + * Gets the controllerDetails property: controller details. + * + * @return the controllerDetails value. + */ + ControllerDetails controllerDetails(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.delegatednetwork.fluent.models.OrchestratorInner object. + * + * @return the inner object. + */ + OrchestratorInner innerModel(); + + /** The entirety of the Orchestrator definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithKind, + DefinitionStages.WithCreate { + } + /** The Orchestrator definition stages. */ + interface DefinitionStages { + /** The first stage of the Orchestrator definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Orchestrator definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the Orchestrator definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @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. + * @return the next definition stage. + */ + WithKind withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the Orchestrator definition allowing to specify kind. */ + interface WithKind { + /** + * Specifies the kind property: The kind of workbook. Choices are user and shared.. + * + * @param kind The kind of workbook. Choices are user and shared. + * @return the next definition stage. + */ + WithCreate withKind(OrchestratorKind kind); + } + /** + * The stage of the Orchestrator definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithIdentity, + DefinitionStages.WithOrchestratorAppId, + DefinitionStages.WithOrchestratorTenantId, + DefinitionStages.WithClusterRootCA, + DefinitionStages.WithApiServerEndpoint, + DefinitionStages.WithControllerDetails { + /** + * Executes the create request. + * + * @return the created resource. + */ + Orchestrator create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Orchestrator create(Context context); + } + /** The stage of the Orchestrator definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the Orchestrator definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the orchestrator. + * + * @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 the orchestratorAppId property: AAD ID used with apiserver. + * + * @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 the orchestratorTenantId property: TenantID of server App ID. + * + * @param orchestratorTenantId TenantID of server App ID. + * @return the next definition stage. + */ + WithCreate withOrchestratorTenantId(String orchestratorTenantId); + } + /** The stage of the Orchestrator definition allowing to specify clusterRootCA. */ + interface WithClusterRootCA { + /** + * Specifies the clusterRootCA property: RootCA certificate of kubernetes cluster base64 encoded. + * + * @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 apiServerEndpoint. */ + interface WithApiServerEndpoint { + /** + * Specifies the apiServerEndpoint property: K8s APIServer url. + * + * @param apiServerEndpoint K8s APIServer url. + * @return the next definition stage. + */ + WithCreate withApiServerEndpoint(String apiServerEndpoint); + } + /** The stage of the Orchestrator definition allowing to specify controllerDetails. */ + interface WithControllerDetails { + /** + * Specifies the controllerDetails property: controller details. + * + * @param controllerDetails controller details. + * @return the next definition stage. + */ + WithCreate withControllerDetails(ControllerDetails controllerDetails); + } + } + /** + * Begins update for the Orchestrator resource. + * + * @return the stage of resource update. + */ + Orchestrator.Update update(); + + /** The template for Orchestrator update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Orchestrator apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Orchestrator apply(Context context); + } + /** The Orchestrator update stages. */ + interface UpdateStages { + /** The stage of the Orchestrator update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The resource tags.. + * + * @param tags The resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Orchestrator refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Orchestrator refresh(Context context); +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorIdentity.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorIdentity.java new file mode 100644 index 0000000000000..cc455ecf86a5f --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorIdentity.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The OrchestratorIdentity model. */ +@Fluent +public class OrchestratorIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OrchestratorIdentity.class); + + /* + * 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 + */ + @JsonProperty(value = "type") + private ResourceIdentityType type; + + /** + * Get the principalId property: 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 tenantId property: 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 property: The type of identity used for orchestrator cluster. Type 'SystemAssigned' will use an + * implicitly created identity orchestrator clusters. + * + * @return the type value. + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of identity used for orchestrator cluster. Type 'SystemAssigned' will use an + * implicitly created identity orchestrator clusters. + * + * @param type the type value to set. + * @return the OrchestratorIdentity object itself. + */ + public OrchestratorIdentity withType(ResourceIdentityType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorInstanceServices.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorInstanceServices.java new file mode 100644 index 0000000000000..4f1b9007db11e --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorInstanceServices.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of OrchestratorInstanceServices. */ +public interface OrchestratorInstanceServices { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the orchestrator instance. + */ + Orchestrator getByResourceGroup(String resourceGroupName, String resourceName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the orchestrator instance. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String resourceName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String resourceName, Context context); + + /** + * Get all the orchestratorInstance resources in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the orchestratorInstance resources in a subscription. + */ + PagedIterable list(); + + /** + * Get all the orchestratorInstance resources in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the orchestratorInstance resources in a subscription. + */ + PagedIterable list(Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the OrchestratorInstances resources in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the OrchestratorInstances resources in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets details about the orchestrator instance. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the orchestrator instance. + */ + Orchestrator getById(String id); + + /** + * Gets details about the orchestrator instance. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the orchestrator instance. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the Orchestrator Instance. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the Orchestrator Instance. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Orchestrator resource. + * + * @param name resource name. + * @return the first stage of the new Orchestrator definition. + */ + Orchestrator.DefinitionStages.Blank define(String name); +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorInstanceState.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorInstanceState.java new file mode 100644 index 0000000000000..295c3428329d0 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorInstanceState.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorKind.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorKind.java new file mode 100644 index 0000000000000..f0789d404eb4d --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorKind.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OrchestratorKind. */ +public final class OrchestratorKind extends ExpandableStringEnum { + /** Static value Kubernetes for OrchestratorKind. */ + public static final OrchestratorKind KUBERNETES = fromString("Kubernetes"); + + /** + * Creates or finds a OrchestratorKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding OrchestratorKind. + */ + @JsonCreator + public static OrchestratorKind fromString(String name) { + return fromString(name, OrchestratorKind.class); + } + + /** @return known OrchestratorKind values. */ + public static Collection values() { + return values(OrchestratorKind.class); + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorResource.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorResource.java new file mode 100644 index 0000000000000..e47694c446d9e --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorResource.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Represents an instance of a resource. */ +@Fluent +public class OrchestratorResource extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OrchestratorResource.class); + + /* + * The kind of workbook. Choices are user and shared. + */ + @JsonProperty(value = "kind", required = true) + private OrchestratorKind kind; + + /* + * The identity of the orchestrator + */ + @JsonProperty(value = "identity") + private OrchestratorIdentity identity; + + /** + * Get the kind property: The kind of workbook. Choices are user and shared. + * + * @return the kind value. + */ + public OrchestratorKind kind() { + return this.kind; + } + + /** + * Set the kind property: The kind of workbook. Choices are user and shared. + * + * @param kind the kind value to set. + * @return the OrchestratorResource object itself. + */ + public OrchestratorResource withKind(OrchestratorKind kind) { + this.kind = kind; + return this; + } + + /** + * Get the identity property: The identity of the orchestrator. + * + * @return the identity value. + */ + public OrchestratorIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: 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; + } + + /** {@inheritDoc} */ + @Override + public OrchestratorResource withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public OrchestratorResource withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (kind() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property kind in model OrchestratorResource")); + } + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorResourceUpdateParameters.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorResourceUpdateParameters.java new file mode 100644 index 0000000000000..0c1676c65ada7 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorResourceUpdateParameters.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Parameters for updating a resource. */ +@Fluent +public final class OrchestratorResourceUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OrchestratorResourceUpdateParameters.class); + + /* + * The resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the tags property: The resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Orchestrators.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Orchestrators.java new file mode 100644 index 0000000000000..db9ac9791e79e --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Orchestrators.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.delegatednetwork.fluent.models.OrchestratorInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** An array of OrchestratorInstance resources. */ +@Fluent +public final class Orchestrators { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Orchestrators.class); + + /* + * An array of OrchestratorInstance resources. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The URL to get the next set of orchestrators. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: An array of OrchestratorInstance resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of OrchestratorInstance resources. + * + * @param value the value value to set. + * @return the Orchestrators object itself. + */ + public Orchestrators withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of orchestrators. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model Orchestrators")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ResourceIdentityType.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ResourceIdentityType.java new file mode 100644 index 0000000000000..0546a1529219f --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ResourceIdentityType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.models; + +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 final 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/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ResourceUpdateParameters.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ResourceUpdateParameters.java new file mode 100644 index 0000000000000..8380a9642ad30 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ResourceUpdateParameters.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Parameters for updating a resource. */ +@Fluent +public final class ResourceUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceUpdateParameters.class); + + /* + * The resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the tags property: The resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/SubnetDetails.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/SubnetDetails.java new file mode 100644 index 0000000000000..da8e37083d1cd --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/SubnetDetails.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of orchestrator. */ +@Fluent +public final class SubnetDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SubnetDetails.class); + + /* + * subnet arm resource id + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: subnet arm resource id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/package-info.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/package-info.java new file mode 100644 index 0000000000000..d02292bfb1c78 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for Dnc. DNC web api provides way to create, get and delete dnc controller. */ +package com.azure.resourcemanager.delegatednetwork.models; diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/package-info.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/package-info.java new file mode 100644 index 0000000000000..e7924604dec3d --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for Dnc. DNC web api provides way to create, get and delete dnc controller. */ +package com.azure.resourcemanager.delegatednetwork; diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/module-info.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/module-info.java new file mode 100644 index 0000000000000..c0fcf21a2147a --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.delegatednetwork { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.delegatednetwork; + exports com.azure.resourcemanager.delegatednetwork.fluent; + exports com.azure.resourcemanager.delegatednetwork.fluent.models; + exports com.azure.resourcemanager.delegatednetwork.models; + + opens com.azure.resourcemanager.delegatednetwork.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.delegatednetwork.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/delegatednetwork/ci.yml b/sdk/delegatednetwork/ci.yml new file mode 100644 index 0000000000000..201c4bb54c0d9 --- /dev/null +++ b/sdk/delegatednetwork/ci.yml @@ -0,0 +1,31 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - master + - hotfix/* + - release/* + paths: + include: + - sdk/delegatednetwork/ + +pr: + branches: + include: + - master + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/delegatednetwork/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: delegatednetwork + Artifacts: + - name: azure-resourcemanager-delegatednetwork + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerdelegatednetwork diff --git a/sdk/delegatednetwork/pom.xml b/sdk/delegatednetwork/pom.xml new file mode 100644 index 0000000000000..e057ea5f3a9c9 --- /dev/null +++ b/sdk/delegatednetwork/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-delegatednetwork-service + pom + 1.0.0 + + + + coverage + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + report-aggregate + verify + + report-aggregate + + + ${project.reporting.outputDirectory}/test-coverage + + + + + + + + + default + + true + + + azure-resourcemanager-delegatednetwork + + + +