From 51bae81aaa92aa7fad606de21214ff57923d96b8 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 28 Jan 2021 18:22:45 +0000 Subject: [PATCH] CodeGen from PR 12709 in Azure/azure-rest-api-specs Merge 3b39238d652e67f9b74c5c188419e56047894573 into a57e89f8c3e1215201694cc0d6e9a51842573df0 --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../README.md | 99 ++ .../azure-resourcemanager-azurestack/pom.xml | 62 + .../azurestack/AzureStackManager.java | 274 ++++ .../fluent/AzureStackManagementClient.java | 89 ++ .../fluent/CloudManifestFilesClient.java | 63 + .../fluent/CustomerSubscriptionsClient.java | 141 ++ .../fluent/LinkedSubscriptionsClient.java | 179 +++ .../azurestack/fluent/OperationsClient.java | 36 + .../azurestack/fluent/ProductsClient.java | 212 +++ .../fluent/RegistrationsClient.java | 210 +++ .../models/ActivationKeyResultInner.java | 50 + .../CloudManifestFileResponseInner.java | 82 + .../models/CustomerSubscriptionInner.java | 99 ++ .../fluent/models/ExtendedProductInner.java | 221 +++ .../models/LinkedSubscriptionInner.java | 236 +++ .../fluent/models/OperationInner.java | 107 ++ .../fluent/models/ProductInner.java | 558 +++++++ .../fluent/models/ProductListInner.java | 80 + .../fluent/models/ProductLogInner.java | 189 +++ .../fluent/models/RegistrationInner.java | 182 +++ .../fluent/models/package-info.java | 6 + .../azurestack/fluent/package-info.java | 6 + .../ActivationKeyResultImpl.java | 32 + .../AzureStackManagementClientBuilder.java | 149 ++ .../AzureStackManagementClientImpl.java | 368 +++++ .../CloudManifestFileResponseImpl.java | 49 + .../CloudManifestFilesClientImpl.java | 321 ++++ .../CloudManifestFilesImpl.java | 83 + .../CustomerSubscriptionImpl.java | 124 ++ .../CustomerSubscriptionsClientImpl.java | 928 +++++++++++ .../CustomerSubscriptionsImpl.java | 205 +++ .../implementation/ExtendedProductImpl.java | 87 ++ .../LinkedSubscriptionImpl.java | 225 +++ .../LinkedSubscriptionsClientImpl.java | 1254 +++++++++++++++ .../LinkedSubscriptionsImpl.java | 178 +++ .../implementation/OperationImpl.java | 41 + .../implementation/OperationsClientImpl.java | 269 ++++ .../implementation/OperationsImpl.java | 46 + .../implementation/ProductImpl.java | 132 ++ .../implementation/ProductListImpl.java | 48 + .../implementation/ProductLogImpl.java | 72 + .../implementation/ProductsClientImpl.java | 1384 +++++++++++++++++ .../implementation/ProductsImpl.java | 195 +++ .../implementation/RegistrationImpl.java | 218 +++ .../RegistrationsClientImpl.java | 1325 ++++++++++++++++ .../implementation/RegistrationsImpl.java | 195 +++ .../azurestack/implementation/Utils.java | 67 + .../implementation/package-info.java | 6 + .../models/ActivationKeyResult.java | 24 + .../azurestack/models/Category.java | 34 + .../CloudManifestFileDeploymentData.java | 130 ++ .../models/CloudManifestFileProperties.java | 79 + .../models/CloudManifestFileResponse.java | 52 + .../azurestack/models/CloudManifestFiles.java | 56 + .../azurestack/models/Compatibility.java | 129 ++ .../azurestack/models/CompatibilityIssue.java | 62 + .../azurestack/models/ComputeRole.java | 37 + .../azurestack/models/CreatedByType.java | 40 + .../models/CustomerSubscription.java | 136 ++ .../models/CustomerSubscriptionList.java | 81 + .../models/CustomerSubscriptions.java | 145 ++ .../azurestack/models/DataDiskImage.java | 54 + .../models/DeviceConfiguration.java | 54 + .../azurestack/models/Display.java | 139 ++ .../azurestack/models/ExtendedProduct.java | 103 ++ .../models/ExtendedProductProperties.java | 78 + .../azurestack/models/IconUris.java | 154 ++ .../azurestack/models/LinkedSubscription.java | 279 ++++ .../models/LinkedSubscriptionParameter.java | 122 ++ .../models/LinkedSubscriptions.java | 158 ++ .../models/LinkedSubscriptionsList.java | 81 + .../azurestack/models/Location.java | 31 + .../models/MarketplaceProductLogUpdate.java | 84 + .../azurestack/models/OperatingSystem.java | 37 + .../azurestack/models/Operation.java | 38 + .../azurestack/models/OperationList.java | 81 + .../azurestack/models/Operations.java | 31 + .../azurestack/models/OsDiskImage.java | 54 + .../azurestack/models/Product.java | 179 +++ .../azurestack/models/ProductLink.java | 76 + .../azurestack/models/ProductList.java | 32 + .../azurestack/models/ProductLog.java | 94 ++ .../azurestack/models/ProductProperties.java | 50 + .../azurestack/models/Products.java | 192 +++ .../azurestack/models/ProvisioningState.java | 53 + .../azurestack/models/Registration.java | 267 ++++ .../azurestack/models/RegistrationList.java | 81 + .../models/RegistrationParameter.java | 89 ++ .../azurestack/models/Registrations.java | 188 +++ .../azurestack/models/SystemData.java | 181 +++ ...tualMachineExtensionProductProperties.java | 132 ++ .../VirtualMachineProductProperties.java | 76 + .../azurestack/models/package-info.java | 6 + .../azurestack/package-info.java | 6 + .../src/main/java/module-info.java | 19 + sdk/azurestack/ci.yml | 31 + sdk/azurestack/pom.xml | 53 + 100 files changed, 15577 insertions(+) create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/CHANGELOG.md create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/README.md create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/pom.xml create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/AzureStackManager.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/AzureStackManagementClient.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/CloudManifestFilesClient.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/CustomerSubscriptionsClient.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/LinkedSubscriptionsClient.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/OperationsClient.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/ProductsClient.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/RegistrationsClient.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/ActivationKeyResultInner.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/CloudManifestFileResponseInner.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/CustomerSubscriptionInner.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/ExtendedProductInner.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/LinkedSubscriptionInner.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/OperationInner.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/ProductInner.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/ProductListInner.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/ProductLogInner.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/RegistrationInner.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/package-info.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/package-info.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/ActivationKeyResultImpl.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/AzureStackManagementClientBuilder.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/AzureStackManagementClientImpl.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/CloudManifestFileResponseImpl.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/CloudManifestFilesClientImpl.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/CloudManifestFilesImpl.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/CustomerSubscriptionImpl.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/CustomerSubscriptionsClientImpl.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/CustomerSubscriptionsImpl.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/ExtendedProductImpl.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/LinkedSubscriptionImpl.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/LinkedSubscriptionsClientImpl.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/LinkedSubscriptionsImpl.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/OperationImpl.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/OperationsClientImpl.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/OperationsImpl.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/ProductImpl.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/ProductListImpl.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/ProductLogImpl.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/ProductsClientImpl.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/ProductsImpl.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/RegistrationImpl.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/RegistrationsClientImpl.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/RegistrationsImpl.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/Utils.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/package-info.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ActivationKeyResult.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Category.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CloudManifestFileDeploymentData.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CloudManifestFileProperties.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CloudManifestFileResponse.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CloudManifestFiles.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Compatibility.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CompatibilityIssue.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ComputeRole.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CreatedByType.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CustomerSubscription.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CustomerSubscriptionList.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CustomerSubscriptions.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/DataDiskImage.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/DeviceConfiguration.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Display.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ExtendedProduct.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ExtendedProductProperties.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/IconUris.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/LinkedSubscription.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/LinkedSubscriptionParameter.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/LinkedSubscriptions.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/LinkedSubscriptionsList.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Location.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/MarketplaceProductLogUpdate.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/OperatingSystem.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Operation.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/OperationList.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Operations.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/OsDiskImage.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Product.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ProductLink.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ProductList.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ProductLog.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ProductProperties.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Products.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ProvisioningState.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Registration.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/RegistrationList.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/RegistrationParameter.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Registrations.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/SystemData.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/VirtualMachineExtensionProductProperties.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/VirtualMachineProductProperties.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/package-info.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/package-info.java create mode 100644 sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/module-info.java create mode 100644 sdk/azurestack/ci.yml create mode 100644 sdk/azurestack/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 753220635becd..132318b698c19 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -197,6 +197,7 @@ com.azure.resourcemanager:azure-resourcemanager-loganalytics;1.0.0-beta.1;1.0.0- com.azure.resourcemanager:azure-resourcemanager-eventgrid;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-healthbot;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-confluent;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-azurestack;1.0.0-beta.1;1.0.0-beta.1 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current diff --git a/pom.xml b/pom.xml index 0d1c2a17109ae..910c8cca24599 100644 --- a/pom.xml +++ b/pom.xml @@ -549,6 +549,7 @@ sdk/anomalydetector sdk/appconfiguration sdk/authorization + sdk/azurestack sdk/batch sdk/boms sdk/cognitiveservices diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/CHANGELOG.md b/sdk/azurestack/azure-resourcemanager-azurestack/CHANGELOG.md new file mode 100644 index 0000000000000..04e8f303190ce --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2021-01-28) + +- Azure Resource Manager AzureStack client library for Java. This package contains Microsoft Azure SDK for AzureStack Management SDK. Azure Stack. Package tag package-preview-2020-06. 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/azurestack/azure-resourcemanager-azurestack/README.md b/sdk/azurestack/azure-resourcemanager-azurestack/README.md new file mode 100644 index 0000000000000..ddb68971585ec --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/README.md @@ -0,0 +1,99 @@ +# Azure Resource Manager AzureStack client library for Java + +Azure Resource Manager AzureStack client library for Java. + +This package contains Microsoft Azure SDK for AzureStack Management SDK. Azure Stack. Package tag package-preview-2020-06. 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-azurestack;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-azurestack + 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(); +AzureStackManager manager = AzureStackManager + .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/azurestack/azure-resourcemanager-azurestack/pom.xml b/sdk/azurestack/azure-resourcemanager-azurestack/pom.xml new file mode 100644 index 0000000000000..b4bf5dc6c5f39 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/pom.xml @@ -0,0 +1,62 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-azurestack + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for AzureStack Management + This package contains Microsoft Azure SDK for AzureStack Management SDK. Azure Stack. Package tag package-preview-2020-06. 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-management + 1.1.0 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + + diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/AzureStackManager.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/AzureStackManager.java new file mode 100644 index 0000000000000..57fd462042b92 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/AzureStackManager.java @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack; + +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.azurestack.fluent.AzureStackManagementClient; +import com.azure.resourcemanager.azurestack.implementation.AzureStackManagementClientBuilder; +import com.azure.resourcemanager.azurestack.implementation.CloudManifestFilesImpl; +import com.azure.resourcemanager.azurestack.implementation.CustomerSubscriptionsImpl; +import com.azure.resourcemanager.azurestack.implementation.LinkedSubscriptionsImpl; +import com.azure.resourcemanager.azurestack.implementation.OperationsImpl; +import com.azure.resourcemanager.azurestack.implementation.ProductsImpl; +import com.azure.resourcemanager.azurestack.implementation.RegistrationsImpl; +import com.azure.resourcemanager.azurestack.models.CloudManifestFiles; +import com.azure.resourcemanager.azurestack.models.CustomerSubscriptions; +import com.azure.resourcemanager.azurestack.models.LinkedSubscriptions; +import com.azure.resourcemanager.azurestack.models.Operations; +import com.azure.resourcemanager.azurestack.models.Products; +import com.azure.resourcemanager.azurestack.models.Registrations; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Entry point to AzureStackManager. Azure Stack. */ +public final class AzureStackManager { + private Operations operations; + + private CloudManifestFiles cloudManifestFiles; + + private CustomerSubscriptions customerSubscriptions; + + private Products products; + + private Registrations registrations; + + private LinkedSubscriptions linkedSubscriptions; + + private final AzureStackManagementClient clientObject; + + private AzureStackManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new AzureStackManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of AzureStack service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the AzureStack service API instance. + */ + public static AzureStackManager 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 AzureStackManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new AzureStackManager.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 AzureStack service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the AzureStack service API instance. + */ + public AzureStackManager 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.azurestack") + .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 AzureStackManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of CloudManifestFiles. */ + public CloudManifestFiles cloudManifestFiles() { + if (this.cloudManifestFiles == null) { + this.cloudManifestFiles = new CloudManifestFilesImpl(clientObject.getCloudManifestFiles(), this); + } + return cloudManifestFiles; + } + + /** @return Resource collection API of CustomerSubscriptions. */ + public CustomerSubscriptions customerSubscriptions() { + if (this.customerSubscriptions == null) { + this.customerSubscriptions = new CustomerSubscriptionsImpl(clientObject.getCustomerSubscriptions(), this); + } + return customerSubscriptions; + } + + /** @return Resource collection API of Products. */ + public Products products() { + if (this.products == null) { + this.products = new ProductsImpl(clientObject.getProducts(), this); + } + return products; + } + + /** @return Resource collection API of Registrations. */ + public Registrations registrations() { + if (this.registrations == null) { + this.registrations = new RegistrationsImpl(clientObject.getRegistrations(), this); + } + return registrations; + } + + /** @return Resource collection API of LinkedSubscriptions. */ + public LinkedSubscriptions linkedSubscriptions() { + if (this.linkedSubscriptions == null) { + this.linkedSubscriptions = new LinkedSubscriptionsImpl(clientObject.getLinkedSubscriptions(), this); + } + return linkedSubscriptions; + } + + /** + * @return Wrapped service client AzureStackManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + */ + public AzureStackManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/AzureStackManagementClient.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/AzureStackManagementClient.java new file mode 100644 index 0000000000000..551173793bb02 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/AzureStackManagementClient.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for AzureStackManagementClient class. */ +public interface AzureStackManagementClient { + /** + * Gets Subscription credentials that uniquely identify 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 OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the CloudManifestFilesClient object to access its operations. + * + * @return the CloudManifestFilesClient object. + */ + CloudManifestFilesClient getCloudManifestFiles(); + + /** + * Gets the CustomerSubscriptionsClient object to access its operations. + * + * @return the CustomerSubscriptionsClient object. + */ + CustomerSubscriptionsClient getCustomerSubscriptions(); + + /** + * Gets the ProductsClient object to access its operations. + * + * @return the ProductsClient object. + */ + ProductsClient getProducts(); + + /** + * Gets the RegistrationsClient object to access its operations. + * + * @return the RegistrationsClient object. + */ + RegistrationsClient getRegistrations(); + + /** + * Gets the LinkedSubscriptionsClient object to access its operations. + * + * @return the LinkedSubscriptionsClient object. + */ + LinkedSubscriptionsClient getLinkedSubscriptions(); +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/CloudManifestFilesClient.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/CloudManifestFilesClient.java new file mode 100644 index 0000000000000..f1834421d572a --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/CloudManifestFilesClient.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.azurestack.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestack.fluent.models.CloudManifestFileResponseInner; + +/** An instance of this class provides access to all the operations defined in CloudManifestFilesClient. */ +public interface CloudManifestFilesClient { + /** + * Returns a cloud specific manifest JSON file with latest version. + * + * @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 cloud specific manifest GET response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudManifestFileResponseInner list(); + + /** + * Returns a cloud specific manifest JSON file with latest version. + * + * @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 cloud specific manifest GET response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(Context context); + + /** + * Returns a cloud specific manifest JSON file. + * + * @param verificationVersion Signing verification key version. + * @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 cloud specific manifest GET response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudManifestFileResponseInner get(String verificationVersion); + + /** + * Returns a cloud specific manifest JSON file. + * + * @param verificationVersion Signing verification key version. + * @param versionCreationDate Signing verification key version creation date. + * @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 cloud specific manifest GET response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String verificationVersion, String versionCreationDate, Context context); +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/CustomerSubscriptionsClient.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/CustomerSubscriptionsClient.java new file mode 100644 index 0000000000000..696d572bb26fe --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/CustomerSubscriptionsClient.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.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.util.Context; +import com.azure.resourcemanager.azurestack.fluent.models.CustomerSubscriptionInner; + +/** An instance of this class provides access to all the operations defined in CustomerSubscriptionsClient. */ +public interface CustomerSubscriptionsClient { + /** + * Returns a list of products. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 pageable list of customer subscriptions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroup, String registrationName); + + /** + * Returns a list of products. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 pageable list of customer subscriptions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroup, String registrationName, Context context); + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param customerSubscriptionName Name of the product. + * @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 customer subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomerSubscriptionInner get(String resourceGroup, String registrationName, String customerSubscriptionName); + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param customerSubscriptionName Name of the product. + * @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 customer subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroup, String registrationName, String customerSubscriptionName, Context context); + + /** + * Deletes a customer subscription under a registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param customerSubscriptionName Name of the product. + * @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 resourceGroup, String registrationName, String customerSubscriptionName); + + /** + * Deletes a customer subscription under a registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param customerSubscriptionName Name of the product. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroup, String registrationName, String customerSubscriptionName, Context context); + + /** + * Creates a new customer subscription under a registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param customerSubscriptionName Name of the product. + * @param customerCreationParameters Parameters use to create a customer subscription. + * @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 customer subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomerSubscriptionInner create( + String resourceGroup, + String registrationName, + String customerSubscriptionName, + CustomerSubscriptionInner customerCreationParameters); + + /** + * Creates a new customer subscription under a registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param customerSubscriptionName Name of the product. + * @param customerCreationParameters Parameters use to create a customer 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 customer subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroup, + String registrationName, + String customerSubscriptionName, + CustomerSubscriptionInner customerCreationParameters, + Context context); +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/LinkedSubscriptionsClient.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/LinkedSubscriptionsClient.java new file mode 100644 index 0000000000000..4b39c0114f0fb --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/LinkedSubscriptionsClient.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.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.util.Context; +import com.azure.resourcemanager.azurestack.fluent.models.LinkedSubscriptionInner; +import com.azure.resourcemanager.azurestack.models.LinkedSubscriptionParameter; + +/** An instance of this class provides access to all the operations defined in LinkedSubscriptionsClient. */ +public interface LinkedSubscriptionsClient { + /** + * Returns a list of all linked subscriptions under current resource group. + * + * @param resourceGroup Name of the resource group. + * @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 list of linked subscriptions with paging support. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroup); + + /** + * Returns a list of all linked subscriptions under current resource group. + * + * @param resourceGroup Name of the resource group. + * @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 list of linked subscriptions with paging support. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroup, Context context); + + /** + * Returns a list of all linked subscriptions under current 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 list of linked subscriptions with paging support. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Returns a list of all linked subscriptions under current 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 list of linked subscriptions with paging support. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Returns the properties of a Linked Subscription resource. + * + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription 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 linked Subscription information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LinkedSubscriptionInner getByResourceGroup(String resourceGroup, String linkedSubscriptionName); + + /** + * Returns the properties of a Linked Subscription resource. + * + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription 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 linked Subscription information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroup, String linkedSubscriptionName, Context context); + + /** + * Delete the requested Linked Subscription resource. + * + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription 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 resourceGroup, String linkedSubscriptionName); + + /** + * Delete the requested Linked Subscription resource. + * + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroup, String linkedSubscriptionName, Context context); + + /** + * Create or update a linked subscription resource. + * + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription resource. + * @param resource Linked subscription resource parameter. + * @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 linked Subscription information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LinkedSubscriptionInner createOrUpdate( + String resourceGroup, String linkedSubscriptionName, LinkedSubscriptionParameter resource); + + /** + * Create or update a linked subscription resource. + * + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription resource. + * @param resource Linked subscription resource parameter. + * @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 linked Subscription information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroup, String linkedSubscriptionName, LinkedSubscriptionParameter resource, Context context); + + /** + * Patch a Linked Subscription resource. + * + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription resource. + * @param resource Linked subscription resource parameter. + * @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 linked Subscription information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LinkedSubscriptionInner update( + String resourceGroup, String linkedSubscriptionName, LinkedSubscriptionParameter resource); + + /** + * Patch a Linked Subscription resource. + * + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription resource. + * @param resource Linked subscription resource parameter. + * @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 linked Subscription information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroup, String linkedSubscriptionName, LinkedSubscriptionParameter resource, Context context); +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/OperationsClient.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/OperationsClient.java new file mode 100644 index 0000000000000..f294306434ebe --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/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.azurestack.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.azurestack.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Returns the list of supported REST 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 list of Operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Returns the list of supported REST 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 list of Operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/ProductsClient.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/ProductsClient.java new file mode 100644 index 0000000000000..a8456312d9a4a --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/ProductsClient.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.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.util.Context; +import com.azure.resourcemanager.azurestack.fluent.models.ExtendedProductInner; +import com.azure.resourcemanager.azurestack.fluent.models.ProductInner; +import com.azure.resourcemanager.azurestack.fluent.models.ProductListInner; +import com.azure.resourcemanager.azurestack.fluent.models.ProductLogInner; +import com.azure.resourcemanager.azurestack.models.DeviceConfiguration; +import com.azure.resourcemanager.azurestack.models.MarketplaceProductLogUpdate; + +/** An instance of this class provides access to all the operations defined in ProductsClient. */ +public interface ProductsClient { + /** + * Returns a list of products. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 pageable list of products. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroup, String registrationName); + + /** + * Returns a list of products. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 pageable list of products. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroup, String registrationName, Context context); + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 product information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProductInner get(String resourceGroup, String registrationName, String productName); + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 product information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroup, String registrationName, String productName, Context context); + + /** + * Returns the extended properties of a product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 extended description about the product required for installing it into Azure Stack. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExtendedProductInner listDetails(String resourceGroup, String registrationName, String productName); + + /** + * Returns the extended properties of a product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 extended description about the product required for installing it into Azure Stack. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listDetailsWithResponse( + String resourceGroup, String registrationName, String productName, Context context); + + /** + * Returns a list of products. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 pageable list of products. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProductListInner getProducts(String resourceGroup, String registrationName, String productName); + + /** + * Returns a list of products. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @param deviceConfiguration Device configuration. + * @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 pageable list of products. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getProductsWithResponse( + String resourceGroup, + String registrationName, + String productName, + DeviceConfiguration deviceConfiguration, + Context context); + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 product information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProductInner getProduct(String resourceGroup, String registrationName, String productName); + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @param deviceConfiguration Device configuration. + * @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 product information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getProductWithResponse( + String resourceGroup, + String registrationName, + String productName, + DeviceConfiguration deviceConfiguration, + Context context); + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 product action log. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProductLogInner uploadLog(String resourceGroup, String registrationName, String productName); + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @param marketplaceProductLogUpdate Update details for product log. + * @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 product action log. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response uploadLogWithResponse( + String resourceGroup, + String registrationName, + String productName, + MarketplaceProductLogUpdate marketplaceProductLogUpdate, + Context context); +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/RegistrationsClient.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/RegistrationsClient.java new file mode 100644 index 0000000000000..062a41d3d102d --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/RegistrationsClient.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.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.util.Context; +import com.azure.resourcemanager.azurestack.fluent.models.ActivationKeyResultInner; +import com.azure.resourcemanager.azurestack.fluent.models.RegistrationInner; +import com.azure.resourcemanager.azurestack.models.RegistrationParameter; + +/** An instance of this class provides access to all the operations defined in RegistrationsClient. */ +public interface RegistrationsClient { + /** + * Returns a list of all registrations. + * + * @param resourceGroup Name of the resource group. + * @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 pageable list of registrations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroup); + + /** + * Returns a list of all registrations. + * + * @param resourceGroup Name of the resource group. + * @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 pageable list of registrations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroup, Context context); + + /** + * Returns the properties of an Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 registration information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistrationInner getByResourceGroup(String resourceGroup, String registrationName); + + /** + * Returns the properties of an Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 registration information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroup, String registrationName, Context context); + + /** + * Delete the requested Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 resourceGroup, String registrationName); + + /** + * Delete the requested Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroup, String registrationName, Context context); + + /** + * Create or update an Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param token Registration token. + * @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 registration information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistrationInner createOrUpdate(String resourceGroup, String registrationName, RegistrationParameter token); + + /** + * Create or update an Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param token Registration token. + * @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 registration information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroup, String registrationName, RegistrationParameter token, Context context); + + /** + * Patch an Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param token Registration token. + * @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 registration information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistrationInner update(String resourceGroup, String registrationName, RegistrationParameter token); + + /** + * Patch an Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param token Registration token. + * @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 registration information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroup, String registrationName, RegistrationParameter token, Context context); + + /** + * Returns Azure Stack Activation Key. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 resource containing the Azure Stack activation key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ActivationKeyResultInner getActivationKey(String resourceGroup, String registrationName); + + /** + * Returns Azure Stack Activation Key. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 resource containing the Azure Stack activation key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getActivationKeyWithResponse( + String resourceGroup, String registrationName, Context context); + + /** + * Enables remote management for device under the Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 enableRemoteManagement(String resourceGroup, String registrationName); + + /** + * Enables remote management for device under the Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response enableRemoteManagementWithResponse(String resourceGroup, String registrationName, Context context); +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/ActivationKeyResultInner.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/ActivationKeyResultInner.java new file mode 100644 index 0000000000000..808c1126580b3 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/ActivationKeyResultInner.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.azurestack.fluent.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 resource containing the Azure Stack activation key. */ +@Fluent +public final class ActivationKeyResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ActivationKeyResultInner.class); + + /* + * Azure Stack activation key. + */ + @JsonProperty(value = "activationKey") + private String activationKey; + + /** + * Get the activationKey property: Azure Stack activation key. + * + * @return the activationKey value. + */ + public String activationKey() { + return this.activationKey; + } + + /** + * Set the activationKey property: Azure Stack activation key. + * + * @param activationKey the activationKey value to set. + * @return the ActivationKeyResultInner object itself. + */ + public ActivationKeyResultInner withActivationKey(String activationKey) { + this.activationKey = activationKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/CloudManifestFileResponseInner.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/CloudManifestFileResponseInner.java new file mode 100644 index 0000000000000..3ffed19f56ab9 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/CloudManifestFileResponseInner.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.azurestack.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestack.models.CloudManifestFileProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Cloud specific manifest GET response. */ +@Fluent +public final class CloudManifestFileResponseInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudManifestFileResponseInner.class); + + /* + * Cloud specific manifest data. + */ + @JsonProperty(value = "properties") + private CloudManifestFileProperties properties; + + /* + * The entity tag used for optimistic concurrency when modifying the + * resource. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the properties property: Cloud specific manifest data. + * + * @return the properties value. + */ + public CloudManifestFileProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Cloud specific manifest data. + * + * @param properties the properties value to set. + * @return the CloudManifestFileResponseInner object itself. + */ + public CloudManifestFileResponseInner withProperties(CloudManifestFileProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the etag property: The entity tag used for optimistic concurrency when modifying the resource. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The entity tag used for optimistic concurrency when modifying the resource. + * + * @param etag the etag value to set. + * @return the CloudManifestFileResponseInner object itself. + */ + public CloudManifestFileResponseInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/CustomerSubscriptionInner.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/CustomerSubscriptionInner.java new file mode 100644 index 0000000000000..5184e4d8f9221 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/CustomerSubscriptionInner.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestack.models.SystemData; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Customer subscription. */ +@JsonFlatten +@Fluent +public class CustomerSubscriptionInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomerSubscriptionInner.class); + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Tenant Id. + */ + @JsonProperty(value = "properties.tenantId") + private String tenantId; + + /* + * The entity tag used for optimistic concurrency when modifying the + * resource. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the tenantId property: Tenant Id. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: Tenant Id. + * + * @param tenantId the tenantId value to set. + * @return the CustomerSubscriptionInner object itself. + */ + public CustomerSubscriptionInner withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the etag property: The entity tag used for optimistic concurrency when modifying the resource. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The entity tag used for optimistic concurrency when modifying the resource. + * + * @param etag the etag value to set. + * @return the CustomerSubscriptionInner object itself. + */ + public CustomerSubscriptionInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (systemData() != null) { + systemData().validate(); + } + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/ExtendedProductInner.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/ExtendedProductInner.java new file mode 100644 index 0000000000000..c6b72a8bd3921 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/ExtendedProductInner.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.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.azurestack.models.ComputeRole; +import com.azure.resourcemanager.azurestack.models.DataDiskImage; +import com.azure.resourcemanager.azurestack.models.OperatingSystem; +import com.azure.resourcemanager.azurestack.models.OsDiskImage; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Extended description about the product required for installing it into Azure Stack. */ +@JsonFlatten +@Immutable +public class ExtendedProductInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExtendedProductInner.class); + + /* + * The URI to the .azpkg file that provides information required for + * showing product in the gallery. + */ + @JsonProperty(value = "galleryPackageBlobSasUri", access = JsonProperty.Access.WRITE_ONLY) + private String galleryPackageBlobSasUri; + + /* + * Specifies the kind of the product (virtualMachine or + * virtualMachineExtension). + */ + @JsonProperty(value = "productKind", access = JsonProperty.Access.WRITE_ONLY) + private String productKind; + + /* + * Specifies kind of compute role included in the package. + */ + @JsonProperty(value = "properties.computeRole", access = JsonProperty.Access.WRITE_ONLY) + private ComputeRole computeRole; + + /* + * Specifies if product is a Virtual Machine Extension. + */ + @JsonProperty(value = "properties.isSystemExtension", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isSystemExtension; + + /* + * Indicates if specified product supports multiple extensions. + */ + @JsonProperty(value = "properties.supportMultipleExtensions", access = JsonProperty.Access.WRITE_ONLY) + private Boolean supportMultipleExtensions; + + /* + * Specifies product version. + */ + @JsonProperty(value = "properties.version", access = JsonProperty.Access.WRITE_ONLY) + private String versionPropertiesVersion; + + /* + * Specifies operating system used by the product. + */ + @JsonProperty(value = "properties.vmOsType", access = JsonProperty.Access.WRITE_ONLY) + private OperatingSystem vmOsType; + + /* + * Indicates if virtual machine Scale Set is enabled in the specified + * product. + */ + @JsonProperty(value = "properties.vmScaleSetEnabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean vmScaleSetEnabled; + + /* + * The URI. + */ + @JsonProperty(value = "properties.sourceBlob.uri", access = JsonProperty.Access.WRITE_ONLY) + private String uri; + + /* + * Specifies product version. + */ + @JsonProperty(value = "properties.version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * OS disk image used by product. + */ + @JsonProperty(value = "properties.osDiskImage", access = JsonProperty.Access.WRITE_ONLY) + private OsDiskImage osDiskImage; + + /* + * List of attached data disks. + */ + @JsonProperty(value = "properties.dataDiskImages", access = JsonProperty.Access.WRITE_ONLY) + private List dataDiskImages; + + /** + * Get the galleryPackageBlobSasUri property: The URI to the .azpkg file that provides information required for + * showing product in the gallery. + * + * @return the galleryPackageBlobSasUri value. + */ + public String galleryPackageBlobSasUri() { + return this.galleryPackageBlobSasUri; + } + + /** + * Get the productKind property: Specifies the kind of the product (virtualMachine or virtualMachineExtension). + * + * @return the productKind value. + */ + public String productKind() { + return this.productKind; + } + + /** + * Get the computeRole property: Specifies kind of compute role included in the package. + * + * @return the computeRole value. + */ + public ComputeRole computeRole() { + return this.computeRole; + } + + /** + * Get the isSystemExtension property: Specifies if product is a Virtual Machine Extension. + * + * @return the isSystemExtension value. + */ + public Boolean isSystemExtension() { + return this.isSystemExtension; + } + + /** + * Get the supportMultipleExtensions property: Indicates if specified product supports multiple extensions. + * + * @return the supportMultipleExtensions value. + */ + public Boolean supportMultipleExtensions() { + return this.supportMultipleExtensions; + } + + /** + * Get the versionPropertiesVersion property: Specifies product version. + * + * @return the versionPropertiesVersion value. + */ + public String versionPropertiesVersion() { + return this.versionPropertiesVersion; + } + + /** + * Get the vmOsType property: Specifies operating system used by the product. + * + * @return the vmOsType value. + */ + public OperatingSystem vmOsType() { + return this.vmOsType; + } + + /** + * Get the vmScaleSetEnabled property: Indicates if virtual machine Scale Set is enabled in the specified product. + * + * @return the vmScaleSetEnabled value. + */ + public Boolean vmScaleSetEnabled() { + return this.vmScaleSetEnabled; + } + + /** + * Get the uri property: The URI. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Get the version property: Specifies product version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the osDiskImage property: OS disk image used by product. + * + * @return the osDiskImage value. + */ + public OsDiskImage osDiskImage() { + return this.osDiskImage; + } + + /** + * Get the dataDiskImages property: List of attached data disks. + * + * @return the dataDiskImages value. + */ + public List dataDiskImages() { + return this.dataDiskImages; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (osDiskImage() != null) { + osDiskImage().validate(); + } + if (dataDiskImages() != null) { + dataDiskImages().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/LinkedSubscriptionInner.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/LinkedSubscriptionInner.java new file mode 100644 index 0000000000000..6895b1465bd94 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/LinkedSubscriptionInner.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestack.models.SystemData; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Linked Subscription information. */ +@JsonFlatten +@Fluent +public class LinkedSubscriptionInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LinkedSubscriptionInner.class); + + /* + * The identifier associated with the device subscription. + */ + @JsonProperty(value = "properties.linkedSubscriptionId") + private String linkedSubscriptionId; + + /* + * The identifier associated with the device registration. + */ + @JsonProperty(value = "properties.registrationResourceId") + private String registrationResourceId; + + /* + * The identifier of the Azure Stack device for remote management. + */ + @JsonProperty(value = "properties.deviceId", access = JsonProperty.Access.WRITE_ONLY) + private String deviceId; + + /* + * The object identifier associated with the Azure Stack device connecting + * to Azure. + */ + @JsonProperty(value = "properties.deviceObjectId", access = JsonProperty.Access.WRITE_ONLY) + private String deviceObjectId; + + /* + * The connection state of the Azure Stack device. + */ + @JsonProperty(value = "properties.deviceLinkState", access = JsonProperty.Access.WRITE_ONLY) + private String deviceLinkState; + + /* + * The last remote management connection time for the Azure Stack device + * connected to the linked subscription resource. + */ + @JsonProperty(value = "properties.lastConnectedTime", access = JsonProperty.Access.WRITE_ONLY) + private String lastConnectedTime; + + /* + * The status of the remote management connection of the Azure Stack + * device. + */ + @JsonProperty(value = "properties.deviceConnectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private String deviceConnectionStatus; + + /* + * The kind of the resource. + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private String kind; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The entity tag used for optimistic concurrency when modifying the + * resource. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the linkedSubscriptionId property: The identifier associated with the device subscription. + * + * @return the linkedSubscriptionId value. + */ + public String linkedSubscriptionId() { + return this.linkedSubscriptionId; + } + + /** + * Set the linkedSubscriptionId property: The identifier associated with the device subscription. + * + * @param linkedSubscriptionId the linkedSubscriptionId value to set. + * @return the LinkedSubscriptionInner object itself. + */ + public LinkedSubscriptionInner withLinkedSubscriptionId(String linkedSubscriptionId) { + this.linkedSubscriptionId = linkedSubscriptionId; + return this; + } + + /** + * Get the registrationResourceId property: The identifier associated with the device registration. + * + * @return the registrationResourceId value. + */ + public String registrationResourceId() { + return this.registrationResourceId; + } + + /** + * Set the registrationResourceId property: The identifier associated with the device registration. + * + * @param registrationResourceId the registrationResourceId value to set. + * @return the LinkedSubscriptionInner object itself. + */ + public LinkedSubscriptionInner withRegistrationResourceId(String registrationResourceId) { + this.registrationResourceId = registrationResourceId; + return this; + } + + /** + * Get the deviceId property: The identifier of the Azure Stack device for remote management. + * + * @return the deviceId value. + */ + public String deviceId() { + return this.deviceId; + } + + /** + * Get the deviceObjectId property: The object identifier associated with the Azure Stack device connecting to + * Azure. + * + * @return the deviceObjectId value. + */ + public String deviceObjectId() { + return this.deviceObjectId; + } + + /** + * Get the deviceLinkState property: The connection state of the Azure Stack device. + * + * @return the deviceLinkState value. + */ + public String deviceLinkState() { + return this.deviceLinkState; + } + + /** + * Get the lastConnectedTime property: The last remote management connection time for the Azure Stack device + * connected to the linked subscription resource. + * + * @return the lastConnectedTime value. + */ + public String lastConnectedTime() { + return this.lastConnectedTime; + } + + /** + * Get the deviceConnectionStatus property: The status of the remote management connection of the Azure Stack + * device. + * + * @return the deviceConnectionStatus value. + */ + public String deviceConnectionStatus() { + return this.deviceConnectionStatus; + } + + /** + * Get the kind property: The kind of the resource. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the etag property: The entity tag used for optimistic concurrency when modifying the resource. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The entity tag used for optimistic concurrency when modifying the resource. + * + * @param etag the etag value to set. + * @return the LinkedSubscriptionInner object itself. + */ + public LinkedSubscriptionInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** {@inheritDoc} */ + @Override + public LinkedSubscriptionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public LinkedSubscriptionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (systemData() != null) { + systemData().validate(); + } + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/OperationInner.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/OperationInner.java new file mode 100644 index 0000000000000..8fecbd12675d1 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/OperationInner.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestack.models.Display; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the supported REST operation. */ +@Fluent +public final class OperationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); + + /* + * The name of the operation being performed on this particular object. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Contains the localized display information for this particular operation + * or action. + */ + @JsonProperty(value = "display") + private Display display; + + /* + * The intended executor of the operation. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * Get the name property: The name of the operation being performed on this particular object. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the operation being performed on this particular object. + * + * @param name the name value to set. + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display property: Contains the localized display information for this particular operation or action. + * + * @return the display value. + */ + public Display display() { + return this.display; + } + + /** + * Set the display property: Contains the localized display information for this particular operation or action. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(Display display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The intended executor of the operation. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: The intended executor 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/ProductInner.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/ProductInner.java new file mode 100644 index 0000000000000..4cb651f912fea --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/ProductInner.java @@ -0,0 +1,558 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestack.models.Compatibility; +import com.azure.resourcemanager.azurestack.models.IconUris; +import com.azure.resourcemanager.azurestack.models.ProductLink; +import com.azure.resourcemanager.azurestack.models.ProductProperties; +import com.azure.resourcemanager.azurestack.models.SystemData; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Product information. */ +@JsonFlatten +@Fluent +public class ProductInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProductInner.class); + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The display name of the product. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * The description of the product. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * The user-friendly name of the product publisher. + */ + @JsonProperty(value = "properties.publisherDisplayName") + private String publisherDisplayName; + + /* + * Publisher identifier. + */ + @JsonProperty(value = "properties.publisherIdentifier") + private String publisherIdentifier; + + /* + * The offer representing the product. + */ + @JsonProperty(value = "properties.offer") + private String offer; + + /* + * The version of the product offer. + */ + @JsonProperty(value = "properties.offerVersion") + private String offerVersion; + + /* + * The product SKU. + */ + @JsonProperty(value = "properties.sku") + private String sku; + + /* + * The part number used for billing purposes. + */ + @JsonProperty(value = "properties.billingPartNumber") + private String billingPartNumber; + + /* + * The type of the Virtual Machine Extension. + */ + @JsonProperty(value = "properties.vmExtensionType") + private String vmExtensionType; + + /* + * The identifier of the gallery item corresponding to the product. + */ + @JsonProperty(value = "properties.galleryItemIdentity") + private String galleryItemIdentity; + + /* + * Additional links available for this product. + */ + @JsonProperty(value = "properties.iconUris") + private IconUris iconUris; + + /* + * Additional links available for this product. + */ + @JsonProperty(value = "properties.links") + private List links; + + /* + * The legal terms. + */ + @JsonProperty(value = "properties.legalTerms") + private String legalTerms; + + /* + * The privacy policy. + */ + @JsonProperty(value = "properties.privacyPolicy") + private String privacyPolicy; + + /* + * The length of product content. + */ + @JsonProperty(value = "properties.payloadLength") + private Long payloadLength; + + /* + * The kind of the product (virtualMachine or virtualMachineExtension) + */ + @JsonProperty(value = "properties.productKind") + private String productKind; + + /* + * Additional properties for the product. + */ + @JsonProperty(value = "properties.productProperties") + private ProductProperties productProperties; + + /* + * Product compatibility with current device. + */ + @JsonProperty(value = "properties.compatibility") + private Compatibility compatibility; + + /* + * The entity tag used for optimistic concurrency when modifying the + * resource. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the displayName property: The display name of the product. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name of the product. + * + * @param displayName the displayName value to set. + * @return the ProductInner object itself. + */ + public ProductInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the description property: The description of the product. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the product. + * + * @param description the description value to set. + * @return the ProductInner object itself. + */ + public ProductInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the publisherDisplayName property: The user-friendly name of the product publisher. + * + * @return the publisherDisplayName value. + */ + public String publisherDisplayName() { + return this.publisherDisplayName; + } + + /** + * Set the publisherDisplayName property: The user-friendly name of the product publisher. + * + * @param publisherDisplayName the publisherDisplayName value to set. + * @return the ProductInner object itself. + */ + public ProductInner withPublisherDisplayName(String publisherDisplayName) { + this.publisherDisplayName = publisherDisplayName; + return this; + } + + /** + * Get the publisherIdentifier property: Publisher identifier. + * + * @return the publisherIdentifier value. + */ + public String publisherIdentifier() { + return this.publisherIdentifier; + } + + /** + * Set the publisherIdentifier property: Publisher identifier. + * + * @param publisherIdentifier the publisherIdentifier value to set. + * @return the ProductInner object itself. + */ + public ProductInner withPublisherIdentifier(String publisherIdentifier) { + this.publisherIdentifier = publisherIdentifier; + return this; + } + + /** + * Get the offer property: The offer representing the product. + * + * @return the offer value. + */ + public String offer() { + return this.offer; + } + + /** + * Set the offer property: The offer representing the product. + * + * @param offer the offer value to set. + * @return the ProductInner object itself. + */ + public ProductInner withOffer(String offer) { + this.offer = offer; + return this; + } + + /** + * Get the offerVersion property: The version of the product offer. + * + * @return the offerVersion value. + */ + public String offerVersion() { + return this.offerVersion; + } + + /** + * Set the offerVersion property: The version of the product offer. + * + * @param offerVersion the offerVersion value to set. + * @return the ProductInner object itself. + */ + public ProductInner withOfferVersion(String offerVersion) { + this.offerVersion = offerVersion; + return this; + } + + /** + * Get the sku property: The product SKU. + * + * @return the sku value. + */ + public String sku() { + return this.sku; + } + + /** + * Set the sku property: The product SKU. + * + * @param sku the sku value to set. + * @return the ProductInner object itself. + */ + public ProductInner withSku(String sku) { + this.sku = sku; + return this; + } + + /** + * Get the billingPartNumber property: The part number used for billing purposes. + * + * @return the billingPartNumber value. + */ + public String billingPartNumber() { + return this.billingPartNumber; + } + + /** + * Set the billingPartNumber property: The part number used for billing purposes. + * + * @param billingPartNumber the billingPartNumber value to set. + * @return the ProductInner object itself. + */ + public ProductInner withBillingPartNumber(String billingPartNumber) { + this.billingPartNumber = billingPartNumber; + return this; + } + + /** + * Get the vmExtensionType property: The type of the Virtual Machine Extension. + * + * @return the vmExtensionType value. + */ + public String vmExtensionType() { + return this.vmExtensionType; + } + + /** + * Set the vmExtensionType property: The type of the Virtual Machine Extension. + * + * @param vmExtensionType the vmExtensionType value to set. + * @return the ProductInner object itself. + */ + public ProductInner withVmExtensionType(String vmExtensionType) { + this.vmExtensionType = vmExtensionType; + return this; + } + + /** + * Get the galleryItemIdentity property: The identifier of the gallery item corresponding to the product. + * + * @return the galleryItemIdentity value. + */ + public String galleryItemIdentity() { + return this.galleryItemIdentity; + } + + /** + * Set the galleryItemIdentity property: The identifier of the gallery item corresponding to the product. + * + * @param galleryItemIdentity the galleryItemIdentity value to set. + * @return the ProductInner object itself. + */ + public ProductInner withGalleryItemIdentity(String galleryItemIdentity) { + this.galleryItemIdentity = galleryItemIdentity; + return this; + } + + /** + * Get the iconUris property: Additional links available for this product. + * + * @return the iconUris value. + */ + public IconUris iconUris() { + return this.iconUris; + } + + /** + * Set the iconUris property: Additional links available for this product. + * + * @param iconUris the iconUris value to set. + * @return the ProductInner object itself. + */ + public ProductInner withIconUris(IconUris iconUris) { + this.iconUris = iconUris; + return this; + } + + /** + * Get the links property: Additional links available for this product. + * + * @return the links value. + */ + public List links() { + return this.links; + } + + /** + * Set the links property: Additional links available for this product. + * + * @param links the links value to set. + * @return the ProductInner object itself. + */ + public ProductInner withLinks(List links) { + this.links = links; + return this; + } + + /** + * Get the legalTerms property: The legal terms. + * + * @return the legalTerms value. + */ + public String legalTerms() { + return this.legalTerms; + } + + /** + * Set the legalTerms property: The legal terms. + * + * @param legalTerms the legalTerms value to set. + * @return the ProductInner object itself. + */ + public ProductInner withLegalTerms(String legalTerms) { + this.legalTerms = legalTerms; + return this; + } + + /** + * Get the privacyPolicy property: The privacy policy. + * + * @return the privacyPolicy value. + */ + public String privacyPolicy() { + return this.privacyPolicy; + } + + /** + * Set the privacyPolicy property: The privacy policy. + * + * @param privacyPolicy the privacyPolicy value to set. + * @return the ProductInner object itself. + */ + public ProductInner withPrivacyPolicy(String privacyPolicy) { + this.privacyPolicy = privacyPolicy; + return this; + } + + /** + * Get the payloadLength property: The length of product content. + * + * @return the payloadLength value. + */ + public Long payloadLength() { + return this.payloadLength; + } + + /** + * Set the payloadLength property: The length of product content. + * + * @param payloadLength the payloadLength value to set. + * @return the ProductInner object itself. + */ + public ProductInner withPayloadLength(Long payloadLength) { + this.payloadLength = payloadLength; + return this; + } + + /** + * Get the productKind property: The kind of the product (virtualMachine or virtualMachineExtension). + * + * @return the productKind value. + */ + public String productKind() { + return this.productKind; + } + + /** + * Set the productKind property: The kind of the product (virtualMachine or virtualMachineExtension). + * + * @param productKind the productKind value to set. + * @return the ProductInner object itself. + */ + public ProductInner withProductKind(String productKind) { + this.productKind = productKind; + return this; + } + + /** + * Get the productProperties property: Additional properties for the product. + * + * @return the productProperties value. + */ + public ProductProperties productProperties() { + return this.productProperties; + } + + /** + * Set the productProperties property: Additional properties for the product. + * + * @param productProperties the productProperties value to set. + * @return the ProductInner object itself. + */ + public ProductInner withProductProperties(ProductProperties productProperties) { + this.productProperties = productProperties; + return this; + } + + /** + * Get the compatibility property: Product compatibility with current device. + * + * @return the compatibility value. + */ + public Compatibility compatibility() { + return this.compatibility; + } + + /** + * Set the compatibility property: Product compatibility with current device. + * + * @param compatibility the compatibility value to set. + * @return the ProductInner object itself. + */ + public ProductInner withCompatibility(Compatibility compatibility) { + this.compatibility = compatibility; + return this; + } + + /** + * Get the etag property: The entity tag used for optimistic concurrency when modifying the resource. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The entity tag used for optimistic concurrency when modifying the resource. + * + * @param etag the etag value to set. + * @return the ProductInner object itself. + */ + public ProductInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (systemData() != null) { + systemData().validate(); + } + if (iconUris() != null) { + iconUris().validate(); + } + if (links() != null) { + links().forEach(e -> e.validate()); + } + if (productProperties() != null) { + productProperties().validate(); + } + if (compatibility() != null) { + compatibility().validate(); + } + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/ProductListInner.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/ProductListInner.java new file mode 100644 index 0000000000000..f5e2a50ca3469 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/ProductListInner.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.fluent.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.List; + +/** Pageable list of products. */ +@Fluent +public final class ProductListInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProductListInner.class); + + /* + * URI to the next page. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * List of products. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the nextLink property: URI to the next page. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URI to the next page. + * + * @param nextLink the nextLink value to set. + * @return the ProductListInner object itself. + */ + public ProductListInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: List of products. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of products. + * + * @param value the value value to set. + * @return the ProductListInner object itself. + */ + public ProductListInner withValue(List value) { + this.value = value; + 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/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/ProductLogInner.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/ProductLogInner.java new file mode 100644 index 0000000000000..b6d75a701f234 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/ProductLogInner.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.fluent.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; + +/** Product action log. */ +@Immutable +public final class ProductLogInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProductLogInner.class); + + /* + * Log ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Logged product ID. + */ + @JsonProperty(value = "productId", access = JsonProperty.Access.WRITE_ONLY) + private String productId; + + /* + * Logged subscription ID. + */ + @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) + private String subscriptionId; + + /* + * Logged registration name. + */ + @JsonProperty(value = "registrationName", access = JsonProperty.Access.WRITE_ONLY) + private String registrationName; + + /* + * Logged resource group name. + */ + @JsonProperty(value = "resourceGroupName", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGroupName; + + /* + * Logged operation. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /* + * Operation start datetime. + */ + @JsonProperty(value = "startDate", access = JsonProperty.Access.WRITE_ONLY) + private String startDate; + + /* + * Operation end datetime. + */ + @JsonProperty(value = "endDate", access = JsonProperty.Access.WRITE_ONLY) + private String endDate; + + /* + * Operation status. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /* + * Operation error data. + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private String error; + + /* + * Operation error details. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private String details; + + /** + * Get the id property: Log ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the productId property: Logged product ID. + * + * @return the productId value. + */ + public String productId() { + return this.productId; + } + + /** + * Get the subscriptionId property: Logged subscription ID. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Get the registrationName property: Logged registration name. + * + * @return the registrationName value. + */ + public String registrationName() { + return this.registrationName; + } + + /** + * Get the resourceGroupName property: Logged resource group name. + * + * @return the resourceGroupName value. + */ + public String resourceGroupName() { + return this.resourceGroupName; + } + + /** + * Get the operation property: Logged operation. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the startDate property: Operation start datetime. + * + * @return the startDate value. + */ + public String startDate() { + return this.startDate; + } + + /** + * Get the endDate property: Operation end datetime. + * + * @return the endDate value. + */ + public String endDate() { + return this.endDate; + } + + /** + * Get the status property: Operation status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the error property: Operation error data. + * + * @return the error value. + */ + public String error() { + return this.error; + } + + /** + * Get the details property: Operation error details. + * + * @return the details value. + */ + public String details() { + return this.details; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/RegistrationInner.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/RegistrationInner.java new file mode 100644 index 0000000000000..0755a30ea0128 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/RegistrationInner.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestack.models.SystemData; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Registration information. */ +@JsonFlatten +@Fluent +public class RegistrationInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegistrationInner.class); + + /* + * The object identifier associated with the Azure Stack connecting to + * Azure. + */ + @JsonProperty(value = "properties.objectId") + private String objectId; + + /* + * The identifier of the registered Azure Stack. + */ + @JsonProperty(value = "properties.cloudId") + private String cloudId; + + /* + * Specifies the billing mode for the Azure Stack registration. + */ + @JsonProperty(value = "properties.billingModel") + private String billingModel; + + /* + * The kind of the resource. + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private String kind; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The entity tag used for optimistic concurrency when modifying the + * resource. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the objectId property: The object identifier associated with the Azure Stack connecting to Azure. + * + * @return the objectId value. + */ + public String objectId() { + return this.objectId; + } + + /** + * Set the objectId property: The object identifier associated with the Azure Stack connecting to Azure. + * + * @param objectId the objectId value to set. + * @return the RegistrationInner object itself. + */ + public RegistrationInner withObjectId(String objectId) { + this.objectId = objectId; + return this; + } + + /** + * Get the cloudId property: The identifier of the registered Azure Stack. + * + * @return the cloudId value. + */ + public String cloudId() { + return this.cloudId; + } + + /** + * Set the cloudId property: The identifier of the registered Azure Stack. + * + * @param cloudId the cloudId value to set. + * @return the RegistrationInner object itself. + */ + public RegistrationInner withCloudId(String cloudId) { + this.cloudId = cloudId; + return this; + } + + /** + * Get the billingModel property: Specifies the billing mode for the Azure Stack registration. + * + * @return the billingModel value. + */ + public String billingModel() { + return this.billingModel; + } + + /** + * Set the billingModel property: Specifies the billing mode for the Azure Stack registration. + * + * @param billingModel the billingModel value to set. + * @return the RegistrationInner object itself. + */ + public RegistrationInner withBillingModel(String billingModel) { + this.billingModel = billingModel; + return this; + } + + /** + * Get the kind property: The kind of the resource. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the etag property: The entity tag used for optimistic concurrency when modifying the resource. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The entity tag used for optimistic concurrency when modifying the resource. + * + * @param etag the etag value to set. + * @return the RegistrationInner object itself. + */ + public RegistrationInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** {@inheritDoc} */ + @Override + public RegistrationInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public RegistrationInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (systemData() != null) { + systemData().validate(); + } + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/package-info.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/package-info.java new file mode 100644 index 0000000000000..2610f34d44a12 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/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 inner data models for AzureStackManagementClient. Azure Stack. */ +package com.azure.resourcemanager.azurestack.fluent.models; diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/package-info.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/package-info.java new file mode 100644 index 0000000000000..20c1c48e3d87f --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/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 service clients for AzureStackManagementClient. Azure Stack. */ +package com.azure.resourcemanager.azurestack.fluent; diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/ActivationKeyResultImpl.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/ActivationKeyResultImpl.java new file mode 100644 index 0000000000000..939c4a220b0a1 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/ActivationKeyResultImpl.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.implementation; + +import com.azure.resourcemanager.azurestack.AzureStackManager; +import com.azure.resourcemanager.azurestack.fluent.models.ActivationKeyResultInner; +import com.azure.resourcemanager.azurestack.models.ActivationKeyResult; + +public final class ActivationKeyResultImpl implements ActivationKeyResult { + private ActivationKeyResultInner innerObject; + + private final AzureStackManager serviceManager; + + ActivationKeyResultImpl(ActivationKeyResultInner innerObject, AzureStackManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String activationKey() { + return this.innerModel().activationKey(); + } + + public ActivationKeyResultInner innerModel() { + return this.innerObject; + } + + private AzureStackManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/AzureStackManagementClientBuilder.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/AzureStackManagementClientBuilder.java new file mode 100644 index 0000000000000..90ff22db5cc3d --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/AzureStackManagementClientBuilder.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.azurestack.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 AzureStackManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {AzureStackManagementClientImpl.class}) +public final class AzureStackManagementClientBuilder { + /* + * Subscription credentials that uniquely identify Microsoft Azure + * subscription. The subscription ID forms part of the URI for every + * service call. + */ + private String subscriptionId; + + /** + * Sets Subscription credentials that uniquely identify Microsoft Azure subscription. The subscription ID forms part + * of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the AzureStackManagementClientBuilder. + */ + public AzureStackManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the AzureStackManagementClientBuilder. + */ + public AzureStackManagementClientBuilder 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 AzureStackManagementClientBuilder. + */ + public AzureStackManagementClientBuilder 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 AzureStackManagementClientBuilder. + */ + public AzureStackManagementClientBuilder 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 AzureStackManagementClientBuilder. + */ + public AzureStackManagementClientBuilder 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 AzureStackManagementClientBuilder. + */ + public AzureStackManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of AzureStackManagementClientImpl with the provided parameters. + * + * @return an instance of AzureStackManagementClientImpl. + */ + public AzureStackManagementClientImpl 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(); + } + AzureStackManagementClientImpl client = + new AzureStackManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/AzureStackManagementClientImpl.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/AzureStackManagementClientImpl.java new file mode 100644 index 0000000000000..4515024cc27bb --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/AzureStackManagementClientImpl.java @@ -0,0 +1,368 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.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.azurestack.fluent.AzureStackManagementClient; +import com.azure.resourcemanager.azurestack.fluent.CloudManifestFilesClient; +import com.azure.resourcemanager.azurestack.fluent.CustomerSubscriptionsClient; +import com.azure.resourcemanager.azurestack.fluent.LinkedSubscriptionsClient; +import com.azure.resourcemanager.azurestack.fluent.OperationsClient; +import com.azure.resourcemanager.azurestack.fluent.ProductsClient; +import com.azure.resourcemanager.azurestack.fluent.RegistrationsClient; +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 AzureStackManagementClientImpl type. */ +@ServiceClient(builder = AzureStackManagementClientBuilder.class) +public final class AzureStackManagementClientImpl implements AzureStackManagementClient { + private final ClientLogger logger = new ClientLogger(AzureStackManagementClientImpl.class); + + /** + * Subscription credentials that uniquely identify Microsoft Azure subscription. The subscription ID forms part of + * the URI for every service call. + */ + private final String subscriptionId; + + /** + * Gets Subscription credentials that uniquely identify 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 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; + } + + /** The CloudManifestFilesClient object to access its operations. */ + private final CloudManifestFilesClient cloudManifestFiles; + + /** + * Gets the CloudManifestFilesClient object to access its operations. + * + * @return the CloudManifestFilesClient object. + */ + public CloudManifestFilesClient getCloudManifestFiles() { + return this.cloudManifestFiles; + } + + /** The CustomerSubscriptionsClient object to access its operations. */ + private final CustomerSubscriptionsClient customerSubscriptions; + + /** + * Gets the CustomerSubscriptionsClient object to access its operations. + * + * @return the CustomerSubscriptionsClient object. + */ + public CustomerSubscriptionsClient getCustomerSubscriptions() { + return this.customerSubscriptions; + } + + /** The ProductsClient object to access its operations. */ + private final ProductsClient products; + + /** + * Gets the ProductsClient object to access its operations. + * + * @return the ProductsClient object. + */ + public ProductsClient getProducts() { + return this.products; + } + + /** The RegistrationsClient object to access its operations. */ + private final RegistrationsClient registrations; + + /** + * Gets the RegistrationsClient object to access its operations. + * + * @return the RegistrationsClient object. + */ + public RegistrationsClient getRegistrations() { + return this.registrations; + } + + /** The LinkedSubscriptionsClient object to access its operations. */ + private final LinkedSubscriptionsClient linkedSubscriptions; + + /** + * Gets the LinkedSubscriptionsClient object to access its operations. + * + * @return the LinkedSubscriptionsClient object. + */ + public LinkedSubscriptionsClient getLinkedSubscriptions() { + return this.linkedSubscriptions; + } + + /** + * Initializes an instance of AzureStackManagementClient 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 Subscription credentials that uniquely identify Microsoft Azure subscription. The + * subscription ID forms part of the URI for every service call. + * @param endpoint server parameter. + */ + AzureStackManagementClientImpl( + 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-06-01-preview"; + this.operations = new OperationsClientImpl(this); + this.cloudManifestFiles = new CloudManifestFilesClientImpl(this); + this.customerSubscriptions = new CustomerSubscriptionsClientImpl(this); + this.products = new ProductsClientImpl(this); + this.registrations = new RegistrationsClientImpl(this); + this.linkedSubscriptions = new LinkedSubscriptionsClientImpl(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 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.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/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/CloudManifestFileResponseImpl.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/CloudManifestFileResponseImpl.java new file mode 100644 index 0000000000000..83912d6f50ee0 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/CloudManifestFileResponseImpl.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.azurestack.implementation; + +import com.azure.resourcemanager.azurestack.AzureStackManager; +import com.azure.resourcemanager.azurestack.fluent.models.CloudManifestFileResponseInner; +import com.azure.resourcemanager.azurestack.models.CloudManifestFileProperties; +import com.azure.resourcemanager.azurestack.models.CloudManifestFileResponse; + +public final class CloudManifestFileResponseImpl implements CloudManifestFileResponse { + private CloudManifestFileResponseInner innerObject; + + private final AzureStackManager serviceManager; + + CloudManifestFileResponseImpl(CloudManifestFileResponseInner innerObject, AzureStackManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public CloudManifestFileProperties properties() { + return this.innerModel().properties(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public CloudManifestFileResponseInner innerModel() { + return this.innerObject; + } + + private AzureStackManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/CloudManifestFilesClientImpl.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/CloudManifestFilesClientImpl.java new file mode 100644 index 0000000000000..8a74547f2075f --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/CloudManifestFilesClientImpl.java @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.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.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.azurestack.fluent.CloudManifestFilesClient; +import com.azure.resourcemanager.azurestack.fluent.models.CloudManifestFileResponseInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in CloudManifestFilesClient. */ +public final class CloudManifestFilesClientImpl implements CloudManifestFilesClient { + private final ClientLogger logger = new ClientLogger(CloudManifestFilesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final CloudManifestFilesService service; + + /** The service client containing this operation class. */ + private final AzureStackManagementClientImpl client; + + /** + * Initializes an instance of CloudManifestFilesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CloudManifestFilesClientImpl(AzureStackManagementClientImpl client) { + this.service = + RestProxy.create(CloudManifestFilesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackManagementClientCloudManifestFiles to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackManagement") + private interface CloudManifestFilesService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.AzureStack/cloudManifestFiles") + @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("/providers/Microsoft.AzureStack/cloudManifestFiles/{verificationVersion}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("verificationVersion") String verificationVersion, + @QueryParam("versionCreationDate") String versionCreationDate, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns a cloud specific manifest JSON file with latest version. + * + * @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 cloud specific manifest GET response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync() { + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Returns a cloud specific manifest JSON file with latest version. + * + * @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 cloud specific manifest GET response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(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); + } + + /** + * Returns a cloud specific manifest JSON file with latest version. + * + * @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 cloud specific manifest GET response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync() { + return listWithResponseAsync() + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns a cloud specific manifest JSON file with latest version. + * + * @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 cloud specific manifest GET response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudManifestFileResponseInner list() { + return listAsync().block(); + } + + /** + * Returns a cloud specific manifest JSON file with latest version. + * + * @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 cloud specific manifest GET response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(Context context) { + return listWithResponseAsync(context).block(); + } + + /** + * Returns a cloud specific manifest JSON file. + * + * @param verificationVersion Signing verification key version. + * @param versionCreationDate Signing verification key version creation date. + * @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 cloud specific manifest GET response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String verificationVersion, String versionCreationDate) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (verificationVersion == null) { + return Mono + .error(new IllegalArgumentException("Parameter verificationVersion is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + verificationVersion, + versionCreationDate, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Returns a cloud specific manifest JSON file. + * + * @param verificationVersion Signing verification key version. + * @param versionCreationDate Signing verification key version creation date. + * @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 cloud specific manifest GET response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String verificationVersion, String versionCreationDate, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (verificationVersion == null) { + return Mono + .error(new IllegalArgumentException("Parameter verificationVersion is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + verificationVersion, + versionCreationDate, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Returns a cloud specific manifest JSON file. + * + * @param verificationVersion Signing verification key version. + * @param versionCreationDate Signing verification key version creation date. + * @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 cloud specific manifest GET response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String verificationVersion, String versionCreationDate) { + return getWithResponseAsync(verificationVersion, versionCreationDate) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns a cloud specific manifest JSON file. + * + * @param verificationVersion Signing verification key version. + * @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 cloud specific manifest GET response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String verificationVersion) { + final String versionCreationDate = null; + return getWithResponseAsync(verificationVersion, versionCreationDate) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns a cloud specific manifest JSON file. + * + * @param verificationVersion Signing verification key version. + * @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 cloud specific manifest GET response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudManifestFileResponseInner get(String verificationVersion) { + final String versionCreationDate = null; + return getAsync(verificationVersion, versionCreationDate).block(); + } + + /** + * Returns a cloud specific manifest JSON file. + * + * @param verificationVersion Signing verification key version. + * @param versionCreationDate Signing verification key version creation date. + * @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 cloud specific manifest GET response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String verificationVersion, String versionCreationDate, Context context) { + return getWithResponseAsync(verificationVersion, versionCreationDate, context).block(); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/CloudManifestFilesImpl.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/CloudManifestFilesImpl.java new file mode 100644 index 0000000000000..e32d6bd42a281 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/CloudManifestFilesImpl.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.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.azurestack.AzureStackManager; +import com.azure.resourcemanager.azurestack.fluent.CloudManifestFilesClient; +import com.azure.resourcemanager.azurestack.fluent.models.CloudManifestFileResponseInner; +import com.azure.resourcemanager.azurestack.models.CloudManifestFileResponse; +import com.azure.resourcemanager.azurestack.models.CloudManifestFiles; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class CloudManifestFilesImpl implements CloudManifestFiles { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudManifestFilesImpl.class); + + private final CloudManifestFilesClient innerClient; + + private final AzureStackManager serviceManager; + + public CloudManifestFilesImpl(CloudManifestFilesClient innerClient, AzureStackManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public CloudManifestFileResponse list() { + CloudManifestFileResponseInner inner = this.serviceClient().list(); + if (inner != null) { + return new CloudManifestFileResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse(Context context) { + Response inner = this.serviceClient().listWithResponse(context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CloudManifestFileResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CloudManifestFileResponse get(String verificationVersion) { + CloudManifestFileResponseInner inner = this.serviceClient().get(verificationVersion); + if (inner != null) { + return new CloudManifestFileResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String verificationVersion, String versionCreationDate, Context context) { + Response inner = + this.serviceClient().getWithResponse(verificationVersion, versionCreationDate, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CloudManifestFileResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private CloudManifestFilesClient serviceClient() { + return this.innerClient; + } + + private AzureStackManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/CustomerSubscriptionImpl.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/CustomerSubscriptionImpl.java new file mode 100644 index 0000000000000..8030440015548 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/CustomerSubscriptionImpl.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestack.AzureStackManager; +import com.azure.resourcemanager.azurestack.fluent.models.CustomerSubscriptionInner; +import com.azure.resourcemanager.azurestack.models.CustomerSubscription; +import com.azure.resourcemanager.azurestack.models.SystemData; + +public final class CustomerSubscriptionImpl implements CustomerSubscription, CustomerSubscription.Definition { + private CustomerSubscriptionInner innerObject; + + private final AzureStackManager serviceManager; + + CustomerSubscriptionImpl(CustomerSubscriptionInner innerObject, AzureStackManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String tenantId() { + return this.innerModel().tenantId(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public CustomerSubscriptionInner innerModel() { + return this.innerObject; + } + + private AzureStackManager manager() { + return this.serviceManager; + } + + private String resourceGroup; + + private String registrationName; + + private String customerSubscriptionName; + + public CustomerSubscriptionImpl withExistingRegistration(String resourceGroup, String registrationName) { + this.resourceGroup = resourceGroup; + this.registrationName = registrationName; + return this; + } + + public CustomerSubscription create() { + this.innerObject = + serviceManager + .serviceClient() + .getCustomerSubscriptions() + .createWithResponse( + resourceGroup, registrationName, customerSubscriptionName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public CustomerSubscription create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCustomerSubscriptions() + .createWithResponse( + resourceGroup, registrationName, customerSubscriptionName, this.innerModel(), context) + .getValue(); + return this; + } + + CustomerSubscriptionImpl(String name, AzureStackManager serviceManager) { + this.innerObject = new CustomerSubscriptionInner(); + this.serviceManager = serviceManager; + this.customerSubscriptionName = name; + } + + public CustomerSubscription refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getCustomerSubscriptions() + .getWithResponse(resourceGroup, registrationName, customerSubscriptionName, Context.NONE) + .getValue(); + return this; + } + + public CustomerSubscription refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCustomerSubscriptions() + .getWithResponse(resourceGroup, registrationName, customerSubscriptionName, context) + .getValue(); + return this; + } + + public CustomerSubscriptionImpl withTenantId(String tenantId) { + this.innerModel().withTenantId(tenantId); + return this; + } + + public CustomerSubscriptionImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/CustomerSubscriptionsClientImpl.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/CustomerSubscriptionsClientImpl.java new file mode 100644 index 0000000000000..4c08334ff072d --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/CustomerSubscriptionsClientImpl.java @@ -0,0 +1,928 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.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.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestack.fluent.CustomerSubscriptionsClient; +import com.azure.resourcemanager.azurestack.fluent.models.CustomerSubscriptionInner; +import com.azure.resourcemanager.azurestack.models.CustomerSubscriptionList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in CustomerSubscriptionsClient. */ +public final class CustomerSubscriptionsClientImpl implements CustomerSubscriptionsClient { + private final ClientLogger logger = new ClientLogger(CustomerSubscriptionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final CustomerSubscriptionsService service; + + /** The service client containing this operation class. */ + private final AzureStackManagementClientImpl client; + + /** + * Initializes an instance of CustomerSubscriptionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CustomerSubscriptionsClientImpl(AzureStackManagementClientImpl client) { + this.service = + RestProxy + .create(CustomerSubscriptionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackManagementClientCustomerSubscriptions to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackManagement") + private interface CustomerSubscriptionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack" + + "/registrations/{registrationName}/customerSubscriptions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroup") String resourceGroup, + @PathParam("registrationName") String registrationName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack" + + "/registrations/{registrationName}/customerSubscriptions/{customerSubscriptionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroup") String resourceGroup, + @PathParam("registrationName") String registrationName, + @PathParam("customerSubscriptionName") String customerSubscriptionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack" + + "/registrations/{registrationName}/customerSubscriptions/{customerSubscriptionName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroup") String resourceGroup, + @PathParam("registrationName") String registrationName, + @PathParam("customerSubscriptionName") String customerSubscriptionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack" + + "/registrations/{registrationName}/customerSubscriptions/{customerSubscriptionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroup") String resourceGroup, + @PathParam("registrationName") String registrationName, + @PathParam("customerSubscriptionName") String customerSubscriptionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CustomerSubscriptionInner customerCreationParameters, + @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); + } + + /** + * Returns a list of products. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 pageable list of customer subscriptions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroup, String registrationName) { + 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (registrationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter registrationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + registrationName, + 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()))); + } + + /** + * Returns a list of products. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 pageable list of customer subscriptions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroup, String registrationName, 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (registrationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter registrationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + registrationName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns a list of products. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 pageable list of customer subscriptions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroup, String registrationName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroup, registrationName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Returns a list of products. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 pageable list of customer subscriptions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroup, String registrationName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroup, registrationName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns a list of products. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 pageable list of customer subscriptions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroup, String registrationName) { + return new PagedIterable<>(listAsync(resourceGroup, registrationName)); + } + + /** + * Returns a list of products. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 pageable list of customer subscriptions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroup, String registrationName, Context context) { + return new PagedIterable<>(listAsync(resourceGroup, registrationName, context)); + } + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param customerSubscriptionName Name of the product. + * @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 customer subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroup, String registrationName, String customerSubscriptionName) { + 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (registrationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter registrationName is required and cannot be null.")); + } + if (customerSubscriptionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter customerSubscriptionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + registrationName, + customerSubscriptionName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param customerSubscriptionName Name of the product. + * @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 customer subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroup, String registrationName, String customerSubscriptionName, 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (registrationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter registrationName is required and cannot be null.")); + } + if (customerSubscriptionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter customerSubscriptionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + registrationName, + customerSubscriptionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param customerSubscriptionName Name of the product. + * @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 customer subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroup, String registrationName, String customerSubscriptionName) { + return getWithResponseAsync(resourceGroup, registrationName, customerSubscriptionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param customerSubscriptionName Name of the product. + * @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 customer subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomerSubscriptionInner get( + String resourceGroup, String registrationName, String customerSubscriptionName) { + return getAsync(resourceGroup, registrationName, customerSubscriptionName).block(); + } + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param customerSubscriptionName Name of the product. + * @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 customer subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroup, String registrationName, String customerSubscriptionName, Context context) { + return getWithResponseAsync(resourceGroup, registrationName, customerSubscriptionName, context).block(); + } + + /** + * Deletes a customer subscription under a registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param customerSubscriptionName Name of the product. + * @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 resourceGroup, String registrationName, String customerSubscriptionName) { + 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (registrationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter registrationName is required and cannot be null.")); + } + if (customerSubscriptionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter customerSubscriptionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + registrationName, + customerSubscriptionName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes a customer subscription under a registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param customerSubscriptionName Name of the product. + * @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 resourceGroup, String registrationName, String customerSubscriptionName, 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (registrationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter registrationName is required and cannot be null.")); + } + if (customerSubscriptionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter customerSubscriptionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + registrationName, + customerSubscriptionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes a customer subscription under a registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param customerSubscriptionName Name of the product. + * @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 resourceGroup, String registrationName, String customerSubscriptionName) { + return deleteWithResponseAsync(resourceGroup, registrationName, customerSubscriptionName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a customer subscription under a registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param customerSubscriptionName Name of the product. + * @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 resourceGroup, String registrationName, String customerSubscriptionName) { + deleteAsync(resourceGroup, registrationName, customerSubscriptionName).block(); + } + + /** + * Deletes a customer subscription under a registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param customerSubscriptionName Name of the product. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroup, String registrationName, String customerSubscriptionName, Context context) { + return deleteWithResponseAsync(resourceGroup, registrationName, customerSubscriptionName, context).block(); + } + + /** + * Creates a new customer subscription under a registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param customerSubscriptionName Name of the product. + * @param customerCreationParameters Parameters use to create a customer subscription. + * @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 customer subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroup, + String registrationName, + String customerSubscriptionName, + CustomerSubscriptionInner customerCreationParameters) { + 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (registrationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter registrationName is required and cannot be null.")); + } + if (customerSubscriptionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter customerSubscriptionName is required and cannot be null.")); + } + if (customerCreationParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customerCreationParameters is required and cannot be null.")); + } else { + customerCreationParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + registrationName, + customerSubscriptionName, + this.client.getApiVersion(), + customerCreationParameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates a new customer subscription under a registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param customerSubscriptionName Name of the product. + * @param customerCreationParameters Parameters use to create a customer 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 customer subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroup, + String registrationName, + String customerSubscriptionName, + CustomerSubscriptionInner customerCreationParameters, + 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (registrationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter registrationName is required and cannot be null.")); + } + if (customerSubscriptionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter customerSubscriptionName is required and cannot be null.")); + } + if (customerCreationParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customerCreationParameters is required and cannot be null.")); + } else { + customerCreationParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + registrationName, + customerSubscriptionName, + this.client.getApiVersion(), + customerCreationParameters, + accept, + context); + } + + /** + * Creates a new customer subscription under a registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param customerSubscriptionName Name of the product. + * @param customerCreationParameters Parameters use to create a customer subscription. + * @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 customer subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroup, + String registrationName, + String customerSubscriptionName, + CustomerSubscriptionInner customerCreationParameters) { + return createWithResponseAsync( + resourceGroup, registrationName, customerSubscriptionName, customerCreationParameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates a new customer subscription under a registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param customerSubscriptionName Name of the product. + * @param customerCreationParameters Parameters use to create a customer subscription. + * @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 customer subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomerSubscriptionInner create( + String resourceGroup, + String registrationName, + String customerSubscriptionName, + CustomerSubscriptionInner customerCreationParameters) { + return createAsync(resourceGroup, registrationName, customerSubscriptionName, customerCreationParameters) + .block(); + } + + /** + * Creates a new customer subscription under a registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param customerSubscriptionName Name of the product. + * @param customerCreationParameters Parameters use to create a customer 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 customer subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroup, + String registrationName, + String customerSubscriptionName, + CustomerSubscriptionInner customerCreationParameters, + Context context) { + return createWithResponseAsync( + resourceGroup, registrationName, customerSubscriptionName, customerCreationParameters, context) + .block(); + } + + /** + * 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 pageable list of customer subscriptions. + */ + @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 pageable list of customer subscriptions. + */ + @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/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/CustomerSubscriptionsImpl.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/CustomerSubscriptionsImpl.java new file mode 100644 index 0000000000000..15fdef7c26862 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/CustomerSubscriptionsImpl.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.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.azurestack.AzureStackManager; +import com.azure.resourcemanager.azurestack.fluent.CustomerSubscriptionsClient; +import com.azure.resourcemanager.azurestack.fluent.models.CustomerSubscriptionInner; +import com.azure.resourcemanager.azurestack.models.CustomerSubscription; +import com.azure.resourcemanager.azurestack.models.CustomerSubscriptions; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class CustomerSubscriptionsImpl implements CustomerSubscriptions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomerSubscriptionsImpl.class); + + private final CustomerSubscriptionsClient innerClient; + + private final AzureStackManager serviceManager; + + public CustomerSubscriptionsImpl(CustomerSubscriptionsClient innerClient, AzureStackManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroup, String registrationName) { + PagedIterable inner = this.serviceClient().list(resourceGroup, registrationName); + return inner.mapPage(inner1 -> new CustomerSubscriptionImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroup, String registrationName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroup, registrationName, context); + return inner.mapPage(inner1 -> new CustomerSubscriptionImpl(inner1, this.manager())); + } + + public CustomerSubscription get(String resourceGroup, String registrationName, String customerSubscriptionName) { + CustomerSubscriptionInner inner = + this.serviceClient().get(resourceGroup, registrationName, customerSubscriptionName); + if (inner != null) { + return new CustomerSubscriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroup, String registrationName, String customerSubscriptionName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroup, registrationName, customerSubscriptionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CustomerSubscriptionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroup, String registrationName, String customerSubscriptionName) { + this.serviceClient().delete(resourceGroup, registrationName, customerSubscriptionName); + } + + public Response deleteWithResponse( + String resourceGroup, String registrationName, String customerSubscriptionName, Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroup, registrationName, customerSubscriptionName, context); + } + + public CustomerSubscription getById(String id) { + String resourceGroup = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroup == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registrationName = Utils.getValueFromIdByName(id, "registrations"); + if (registrationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registrations'.", id))); + } + String customerSubscriptionName = Utils.getValueFromIdByName(id, "customerSubscriptions"); + if (customerSubscriptionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'customerSubscriptions'.", + id))); + } + return this.getWithResponse(resourceGroup, registrationName, customerSubscriptionName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroup = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroup == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registrationName = Utils.getValueFromIdByName(id, "registrations"); + if (registrationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registrations'.", id))); + } + String customerSubscriptionName = Utils.getValueFromIdByName(id, "customerSubscriptions"); + if (customerSubscriptionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'customerSubscriptions'.", + id))); + } + return this.getWithResponse(resourceGroup, registrationName, customerSubscriptionName, context); + } + + public void deleteById(String id) { + String resourceGroup = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroup == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registrationName = Utils.getValueFromIdByName(id, "registrations"); + if (registrationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registrations'.", id))); + } + String customerSubscriptionName = Utils.getValueFromIdByName(id, "customerSubscriptions"); + if (customerSubscriptionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'customerSubscriptions'.", + id))); + } + this.deleteWithResponse(resourceGroup, registrationName, customerSubscriptionName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroup = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroup == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registrationName = Utils.getValueFromIdByName(id, "registrations"); + if (registrationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registrations'.", id))); + } + String customerSubscriptionName = Utils.getValueFromIdByName(id, "customerSubscriptions"); + if (customerSubscriptionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'customerSubscriptions'.", + id))); + } + return this.deleteWithResponse(resourceGroup, registrationName, customerSubscriptionName, context); + } + + private CustomerSubscriptionsClient serviceClient() { + return this.innerClient; + } + + private AzureStackManager manager() { + return this.serviceManager; + } + + public CustomerSubscriptionImpl define(String name) { + return new CustomerSubscriptionImpl(name, this.manager()); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/ExtendedProductImpl.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/ExtendedProductImpl.java new file mode 100644 index 0000000000000..22f4c530e59d0 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/ExtendedProductImpl.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.implementation; + +import com.azure.resourcemanager.azurestack.AzureStackManager; +import com.azure.resourcemanager.azurestack.fluent.models.ExtendedProductInner; +import com.azure.resourcemanager.azurestack.models.ComputeRole; +import com.azure.resourcemanager.azurestack.models.DataDiskImage; +import com.azure.resourcemanager.azurestack.models.ExtendedProduct; +import com.azure.resourcemanager.azurestack.models.OperatingSystem; +import com.azure.resourcemanager.azurestack.models.OsDiskImage; +import java.util.Collections; +import java.util.List; + +public final class ExtendedProductImpl implements ExtendedProduct { + private ExtendedProductInner innerObject; + + private final AzureStackManager serviceManager; + + ExtendedProductImpl(ExtendedProductInner innerObject, AzureStackManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String galleryPackageBlobSasUri() { + return this.innerModel().galleryPackageBlobSasUri(); + } + + public String productKind() { + return this.innerModel().productKind(); + } + + public ComputeRole computeRole() { + return this.innerModel().computeRole(); + } + + public Boolean isSystemExtension() { + return this.innerModel().isSystemExtension(); + } + + public Boolean supportMultipleExtensions() { + return this.innerModel().supportMultipleExtensions(); + } + + public String versionPropertiesVersion() { + return this.innerModel().versionPropertiesVersion(); + } + + public OperatingSystem vmOsType() { + return this.innerModel().vmOsType(); + } + + public Boolean vmScaleSetEnabled() { + return this.innerModel().vmScaleSetEnabled(); + } + + public String uri() { + return this.innerModel().uri(); + } + + public String version() { + return this.innerModel().version(); + } + + public OsDiskImage osDiskImage() { + return this.innerModel().osDiskImage(); + } + + public List dataDiskImages() { + List inner = this.innerModel().dataDiskImages(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ExtendedProductInner innerModel() { + return this.innerObject; + } + + private AzureStackManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/LinkedSubscriptionImpl.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/LinkedSubscriptionImpl.java new file mode 100644 index 0000000000000..32c2e4debda3a --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/LinkedSubscriptionImpl.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.azurestack.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestack.AzureStackManager; +import com.azure.resourcemanager.azurestack.fluent.models.LinkedSubscriptionInner; +import com.azure.resourcemanager.azurestack.models.LinkedSubscription; +import com.azure.resourcemanager.azurestack.models.LinkedSubscriptionParameter; +import com.azure.resourcemanager.azurestack.models.Location; +import com.azure.resourcemanager.azurestack.models.SystemData; +import java.util.Collections; +import java.util.Map; + +public final class LinkedSubscriptionImpl + implements LinkedSubscription, LinkedSubscription.Definition, LinkedSubscription.Update { + private LinkedSubscriptionInner innerObject; + + private final AzureStackManager 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 linkedSubscriptionId() { + return this.innerModel().linkedSubscriptionId(); + } + + public String registrationResourceId() { + return this.innerModel().registrationResourceId(); + } + + public String deviceId() { + return this.innerModel().deviceId(); + } + + public String deviceObjectId() { + return this.innerModel().deviceObjectId(); + } + + public String deviceLinkState() { + return this.innerModel().deviceLinkState(); + } + + public String lastConnectedTime() { + return this.innerModel().lastConnectedTime(); + } + + public String deviceConnectionStatus() { + return this.innerModel().deviceConnectionStatus(); + } + + public String kind() { + return this.innerModel().kind(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public LinkedSubscriptionInner innerModel() { + return this.innerObject; + } + + private AzureStackManager manager() { + return this.serviceManager; + } + + private String resourceGroup; + + private String linkedSubscriptionName; + + private LinkedSubscriptionParameter createResource; + + private LinkedSubscriptionParameter updateResource; + + public LinkedSubscriptionImpl withExistingResourceGroup(String resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + + public LinkedSubscription create() { + this.innerObject = + serviceManager + .serviceClient() + .getLinkedSubscriptions() + .createOrUpdateWithResponse(resourceGroup, linkedSubscriptionName, createResource, Context.NONE) + .getValue(); + return this; + } + + public LinkedSubscription create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLinkedSubscriptions() + .createOrUpdateWithResponse(resourceGroup, linkedSubscriptionName, createResource, context) + .getValue(); + return this; + } + + LinkedSubscriptionImpl(String name, AzureStackManager serviceManager) { + this.innerObject = new LinkedSubscriptionInner(); + this.serviceManager = serviceManager; + this.linkedSubscriptionName = name; + this.createResource = new LinkedSubscriptionParameter(); + } + + public LinkedSubscriptionImpl update() { + this.updateResource = new LinkedSubscriptionParameter(); + return this; + } + + public LinkedSubscription apply() { + this.innerObject = + serviceManager + .serviceClient() + .getLinkedSubscriptions() + .updateWithResponse(resourceGroup, linkedSubscriptionName, updateResource, Context.NONE) + .getValue(); + return this; + } + + public LinkedSubscription apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLinkedSubscriptions() + .updateWithResponse(resourceGroup, linkedSubscriptionName, updateResource, context) + .getValue(); + return this; + } + + LinkedSubscriptionImpl(LinkedSubscriptionInner innerObject, AzureStackManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroup = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.linkedSubscriptionName = Utils.getValueFromIdByName(innerObject.id(), "linkedSubscriptions"); + } + + public LinkedSubscription refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getLinkedSubscriptions() + .getByResourceGroupWithResponse(resourceGroup, linkedSubscriptionName, Context.NONE) + .getValue(); + return this; + } + + public LinkedSubscription refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLinkedSubscriptions() + .getByResourceGroupWithResponse(resourceGroup, linkedSubscriptionName, context) + .getValue(); + return this; + } + + public LinkedSubscriptionImpl withLocation(Location location) { + this.createResource.withLocation(location); + return this; + } + + public LinkedSubscriptionImpl withLinkedSubscriptionId(String linkedSubscriptionId) { + if (isInCreateMode()) { + this.createResource.withLinkedSubscriptionId(linkedSubscriptionId); + return this; + } else { + this.updateResource.withLinkedSubscriptionId(linkedSubscriptionId); + return this; + } + } + + public LinkedSubscriptionImpl withRegistrationResourceId(String registrationResourceId) { + if (isInCreateMode()) { + this.createResource.withRegistrationResourceId(registrationResourceId); + return this; + } else { + this.updateResource.withRegistrationResourceId(registrationResourceId); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/LinkedSubscriptionsClientImpl.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/LinkedSubscriptionsClientImpl.java new file mode 100644 index 0000000000000..115d2d28780a2 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/LinkedSubscriptionsClientImpl.java @@ -0,0 +1,1254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestack.fluent.LinkedSubscriptionsClient; +import com.azure.resourcemanager.azurestack.fluent.models.LinkedSubscriptionInner; +import com.azure.resourcemanager.azurestack.models.LinkedSubscriptionParameter; +import com.azure.resourcemanager.azurestack.models.LinkedSubscriptionsList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LinkedSubscriptionsClient. */ +public final class LinkedSubscriptionsClientImpl implements LinkedSubscriptionsClient { + private final ClientLogger logger = new ClientLogger(LinkedSubscriptionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final LinkedSubscriptionsService service; + + /** The service client containing this operation class. */ + private final AzureStackManagementClientImpl client; + + /** + * Initializes an instance of LinkedSubscriptionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LinkedSubscriptionsClientImpl(AzureStackManagementClientImpl client) { + this.service = + RestProxy.create(LinkedSubscriptionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackManagementClientLinkedSubscriptions to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackManagement") + private interface LinkedSubscriptionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack" + + "/linkedSubscriptions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroup") String resourceGroup, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureStack/linkedSubscriptions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack" + + "/linkedSubscriptions/{linkedSubscriptionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroup") String resourceGroup, + @PathParam("linkedSubscriptionName") String linkedSubscriptionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack" + + "/linkedSubscriptions/{linkedSubscriptionName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroup") String resourceGroup, + @PathParam("linkedSubscriptionName") String linkedSubscriptionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack" + + "/linkedSubscriptions/{linkedSubscriptionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroup") String resourceGroup, + @PathParam("linkedSubscriptionName") String linkedSubscriptionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") LinkedSubscriptionParameter resource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack" + + "/linkedSubscriptions/{linkedSubscriptionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroup") String resourceGroup, + @PathParam("linkedSubscriptionName") String linkedSubscriptionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") LinkedSubscriptionParameter resource, + @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); + + @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); + } + + /** + * Returns a list of all linked subscriptions under current resource group. + * + * @param resourceGroup Name of the resource group. + * @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 list of linked subscriptions with paging support. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroup) { + 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + 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()))); + } + + /** + * Returns a list of all linked subscriptions under current resource group. + * + * @param resourceGroup Name of the resource group. + * @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 list of linked subscriptions with paging support. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroup, 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns a list of all linked subscriptions under current resource group. + * + * @param resourceGroup Name of the resource group. + * @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 list of linked subscriptions with paging support. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroup) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroup), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Returns a list of all linked subscriptions under current resource group. + * + * @param resourceGroup Name of the resource group. + * @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 list of linked subscriptions with paging support. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroup, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroup, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns a list of all linked subscriptions under current resource group. + * + * @param resourceGroup Name of the resource group. + * @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 list of linked subscriptions with paging support. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroup) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroup)); + } + + /** + * Returns a list of all linked subscriptions under current resource group. + * + * @param resourceGroup Name of the resource group. + * @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 list of linked subscriptions with paging support. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroup, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroup, context)); + } + + /** + * Returns a list of all linked subscriptions under current 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 list of linked subscriptions with paging support. + */ + @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.getSubscriptionId(), + 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()))); + } + + /** + * Returns a list of all linked subscriptions under current 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 list of linked subscriptions with paging support. + */ + @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.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns a list of all linked subscriptions under current 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 list of linked subscriptions with paging support. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Returns a list of all linked subscriptions under current 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 list of linked subscriptions with paging support. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns a list of all linked subscriptions under current 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 list of linked subscriptions with paging support. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Returns a list of all linked subscriptions under current 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 list of linked subscriptions with paging support. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Returns the properties of a Linked Subscription resource. + * + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription 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 linked Subscription information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroup, String linkedSubscriptionName) { + 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (linkedSubscriptionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter linkedSubscriptionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + linkedSubscriptionName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Returns the properties of a Linked Subscription resource. + * + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription 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 linked Subscription information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroup, String linkedSubscriptionName, 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (linkedSubscriptionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter linkedSubscriptionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + linkedSubscriptionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Returns the properties of a Linked Subscription resource. + * + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription 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 linked Subscription information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroup, String linkedSubscriptionName) { + return getByResourceGroupWithResponseAsync(resourceGroup, linkedSubscriptionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns the properties of a Linked Subscription resource. + * + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription 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 linked Subscription information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LinkedSubscriptionInner getByResourceGroup(String resourceGroup, String linkedSubscriptionName) { + return getByResourceGroupAsync(resourceGroup, linkedSubscriptionName).block(); + } + + /** + * Returns the properties of a Linked Subscription resource. + * + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription 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 linked Subscription information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroup, String linkedSubscriptionName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroup, linkedSubscriptionName, context).block(); + } + + /** + * Delete the requested Linked Subscription resource. + * + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription 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 resourceGroup, String linkedSubscriptionName) { + 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (linkedSubscriptionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter linkedSubscriptionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + linkedSubscriptionName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Delete the requested Linked Subscription resource. + * + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription 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 resourceGroup, String linkedSubscriptionName, 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (linkedSubscriptionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter linkedSubscriptionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + linkedSubscriptionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete the requested Linked Subscription resource. + * + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription 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 resourceGroup, String linkedSubscriptionName) { + return deleteWithResponseAsync(resourceGroup, linkedSubscriptionName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete the requested Linked Subscription resource. + * + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription 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 resourceGroup, String linkedSubscriptionName) { + deleteAsync(resourceGroup, linkedSubscriptionName).block(); + } + + /** + * Delete the requested Linked Subscription resource. + * + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroup, String linkedSubscriptionName, Context context) { + return deleteWithResponseAsync(resourceGroup, linkedSubscriptionName, context).block(); + } + + /** + * Create or update a linked subscription resource. + * + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription resource. + * @param resource Linked subscription resource 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 linked Subscription information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroup, String linkedSubscriptionName, LinkedSubscriptionParameter resource) { + 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (linkedSubscriptionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter linkedSubscriptionName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + linkedSubscriptionName, + this.client.getApiVersion(), + resource, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create or update a linked subscription resource. + * + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription resource. + * @param resource Linked subscription resource 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 linked Subscription information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroup, String linkedSubscriptionName, LinkedSubscriptionParameter resource, 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (linkedSubscriptionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter linkedSubscriptionName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + linkedSubscriptionName, + this.client.getApiVersion(), + resource, + accept, + context); + } + + /** + * Create or update a linked subscription resource. + * + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription resource. + * @param resource Linked subscription resource 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 linked Subscription information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroup, String linkedSubscriptionName, LinkedSubscriptionParameter resource) { + return createOrUpdateWithResponseAsync(resourceGroup, linkedSubscriptionName, resource) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or update a linked subscription resource. + * + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription resource. + * @param resource Linked subscription resource 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 linked Subscription information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LinkedSubscriptionInner createOrUpdate( + String resourceGroup, String linkedSubscriptionName, LinkedSubscriptionParameter resource) { + return createOrUpdateAsync(resourceGroup, linkedSubscriptionName, resource).block(); + } + + /** + * Create or update a linked subscription resource. + * + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription resource. + * @param resource Linked subscription resource 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 linked Subscription information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroup, String linkedSubscriptionName, LinkedSubscriptionParameter resource, Context context) { + return createOrUpdateWithResponseAsync(resourceGroup, linkedSubscriptionName, resource, context).block(); + } + + /** + * Patch a Linked Subscription resource. + * + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription resource. + * @param resource Linked subscription resource 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 linked Subscription information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroup, String linkedSubscriptionName, LinkedSubscriptionParameter resource) { + 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (linkedSubscriptionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter linkedSubscriptionName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + linkedSubscriptionName, + this.client.getApiVersion(), + resource, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Patch a Linked Subscription resource. + * + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription resource. + * @param resource Linked subscription resource 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 linked Subscription information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroup, String linkedSubscriptionName, LinkedSubscriptionParameter resource, 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (linkedSubscriptionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter linkedSubscriptionName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + linkedSubscriptionName, + this.client.getApiVersion(), + resource, + accept, + context); + } + + /** + * Patch a Linked Subscription resource. + * + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription resource. + * @param resource Linked subscription resource 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 linked Subscription information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroup, String linkedSubscriptionName, LinkedSubscriptionParameter resource) { + return updateWithResponseAsync(resourceGroup, linkedSubscriptionName, resource) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Patch a Linked Subscription resource. + * + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription resource. + * @param resource Linked subscription resource 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 linked Subscription information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LinkedSubscriptionInner update( + String resourceGroup, String linkedSubscriptionName, LinkedSubscriptionParameter resource) { + return updateAsync(resourceGroup, linkedSubscriptionName, resource).block(); + } + + /** + * Patch a Linked Subscription resource. + * + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription resource. + * @param resource Linked subscription resource 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 linked Subscription information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroup, String linkedSubscriptionName, LinkedSubscriptionParameter resource, Context context) { + return updateWithResponseAsync(resourceGroup, linkedSubscriptionName, resource, context).block(); + } + + /** + * 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 list of linked subscriptions with paging support. + */ + @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 list of linked subscriptions with paging support. + */ + @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)); + } + + /** + * 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 list of linked subscriptions with paging support. + */ + @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 list of linked subscriptions with paging support. + */ + @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)); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/LinkedSubscriptionsImpl.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/LinkedSubscriptionsImpl.java new file mode 100644 index 0000000000000..8e74f107d573f --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/LinkedSubscriptionsImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.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.azurestack.AzureStackManager; +import com.azure.resourcemanager.azurestack.fluent.LinkedSubscriptionsClient; +import com.azure.resourcemanager.azurestack.fluent.models.LinkedSubscriptionInner; +import com.azure.resourcemanager.azurestack.models.LinkedSubscription; +import com.azure.resourcemanager.azurestack.models.LinkedSubscriptions; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class LinkedSubscriptionsImpl implements LinkedSubscriptions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LinkedSubscriptionsImpl.class); + + private final LinkedSubscriptionsClient innerClient; + + private final AzureStackManager serviceManager; + + public LinkedSubscriptionsImpl(LinkedSubscriptionsClient innerClient, AzureStackManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByResourceGroup(String resourceGroup) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroup); + return inner.mapPage(inner1 -> new LinkedSubscriptionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroup, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroup, context); + return inner.mapPage(inner1 -> new LinkedSubscriptionImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return inner.mapPage(inner1 -> new LinkedSubscriptionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return inner.mapPage(inner1 -> new LinkedSubscriptionImpl(inner1, this.manager())); + } + + public LinkedSubscription getByResourceGroup(String resourceGroup, String linkedSubscriptionName) { + LinkedSubscriptionInner inner = this.serviceClient().getByResourceGroup(resourceGroup, linkedSubscriptionName); + if (inner != null) { + return new LinkedSubscriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroup, String linkedSubscriptionName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroup, linkedSubscriptionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LinkedSubscriptionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroup, String linkedSubscriptionName) { + this.serviceClient().delete(resourceGroup, linkedSubscriptionName); + } + + public Response deleteWithResponse(String resourceGroup, String linkedSubscriptionName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroup, linkedSubscriptionName, context); + } + + public LinkedSubscription getById(String id) { + String resourceGroup = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroup == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String linkedSubscriptionName = Utils.getValueFromIdByName(id, "linkedSubscriptions"); + if (linkedSubscriptionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'linkedSubscriptions'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroup, linkedSubscriptionName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroup = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroup == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String linkedSubscriptionName = Utils.getValueFromIdByName(id, "linkedSubscriptions"); + if (linkedSubscriptionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'linkedSubscriptions'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroup, linkedSubscriptionName, context); + } + + public void deleteById(String id) { + String resourceGroup = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroup == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String linkedSubscriptionName = Utils.getValueFromIdByName(id, "linkedSubscriptions"); + if (linkedSubscriptionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'linkedSubscriptions'.", id))); + } + this.deleteWithResponse(resourceGroup, linkedSubscriptionName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroup = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroup == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String linkedSubscriptionName = Utils.getValueFromIdByName(id, "linkedSubscriptions"); + if (linkedSubscriptionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'linkedSubscriptions'.", id))); + } + return this.deleteWithResponse(resourceGroup, linkedSubscriptionName, context); + } + + private LinkedSubscriptionsClient serviceClient() { + return this.innerClient; + } + + private AzureStackManager manager() { + return this.serviceManager; + } + + public LinkedSubscriptionImpl define(String name) { + return new LinkedSubscriptionImpl(name, this.manager()); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/OperationImpl.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/OperationImpl.java new file mode 100644 index 0000000000000..dcd3330635d0c --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/OperationImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.implementation; + +import com.azure.resourcemanager.azurestack.AzureStackManager; +import com.azure.resourcemanager.azurestack.fluent.models.OperationInner; +import com.azure.resourcemanager.azurestack.models.Display; +import com.azure.resourcemanager.azurestack.models.Operation; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final AzureStackManager serviceManager; + + OperationImpl(OperationInner innerObject, AzureStackManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Display display() { + return this.innerModel().display(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private AzureStackManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/OperationsClientImpl.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..1f564f622d7c9 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/OperationsClientImpl.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.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.azurestack.fluent.OperationsClient; +import com.azure.resourcemanager.azurestack.fluent.models.OperationInner; +import com.azure.resourcemanager.azurestack.models.OperationList; +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 AzureStackManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(AzureStackManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackManagementClientOperations to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackManagement") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.AzureStack/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); + } + + /** + * Returns the list of supported REST 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 list of 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()))); + } + + /** + * Returns the list of supported REST 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 list of 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)); + } + + /** + * Returns the list of supported REST 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 list of Operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Returns the list of supported REST 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 list of Operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns the list of supported REST 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 list of Operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Returns the list of supported REST 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 list of 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 list of 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 list of 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/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/OperationsImpl.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..96a97455a53c2 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/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.azurestack.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.azurestack.AzureStackManager; +import com.azure.resourcemanager.azurestack.fluent.OperationsClient; +import com.azure.resourcemanager.azurestack.fluent.models.OperationInner; +import com.azure.resourcemanager.azurestack.models.Operation; +import com.azure.resourcemanager.azurestack.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 AzureStackManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, AzureStackManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return inner.mapPage(inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return inner.mapPage(inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private AzureStackManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/ProductImpl.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/ProductImpl.java new file mode 100644 index 0000000000000..b2c746e25fee4 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/ProductImpl.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.implementation; + +import com.azure.resourcemanager.azurestack.AzureStackManager; +import com.azure.resourcemanager.azurestack.fluent.models.ProductInner; +import com.azure.resourcemanager.azurestack.models.Compatibility; +import com.azure.resourcemanager.azurestack.models.IconUris; +import com.azure.resourcemanager.azurestack.models.Product; +import com.azure.resourcemanager.azurestack.models.ProductLink; +import com.azure.resourcemanager.azurestack.models.ProductProperties; +import com.azure.resourcemanager.azurestack.models.SystemData; +import java.util.Collections; +import java.util.List; + +public final class ProductImpl implements Product { + private ProductInner innerObject; + + private final AzureStackManager serviceManager; + + ProductImpl(ProductInner innerObject, AzureStackManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public String description() { + return this.innerModel().description(); + } + + public String publisherDisplayName() { + return this.innerModel().publisherDisplayName(); + } + + public String publisherIdentifier() { + return this.innerModel().publisherIdentifier(); + } + + public String offer() { + return this.innerModel().offer(); + } + + public String offerVersion() { + return this.innerModel().offerVersion(); + } + + public String sku() { + return this.innerModel().sku(); + } + + public String billingPartNumber() { + return this.innerModel().billingPartNumber(); + } + + public String vmExtensionType() { + return this.innerModel().vmExtensionType(); + } + + public String galleryItemIdentity() { + return this.innerModel().galleryItemIdentity(); + } + + public IconUris iconUris() { + return this.innerModel().iconUris(); + } + + public List links() { + List inner = this.innerModel().links(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String legalTerms() { + return this.innerModel().legalTerms(); + } + + public String privacyPolicy() { + return this.innerModel().privacyPolicy(); + } + + public Long payloadLength() { + return this.innerModel().payloadLength(); + } + + public String productKind() { + return this.innerModel().productKind(); + } + + public ProductProperties productProperties() { + return this.innerModel().productProperties(); + } + + public Compatibility compatibility() { + return this.innerModel().compatibility(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public ProductInner innerModel() { + return this.innerObject; + } + + private AzureStackManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/ProductListImpl.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/ProductListImpl.java new file mode 100644 index 0000000000000..b19a2d6451760 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/ProductListImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.implementation; + +import com.azure.resourcemanager.azurestack.AzureStackManager; +import com.azure.resourcemanager.azurestack.fluent.models.ProductInner; +import com.azure.resourcemanager.azurestack.fluent.models.ProductListInner; +import com.azure.resourcemanager.azurestack.models.Product; +import com.azure.resourcemanager.azurestack.models.ProductList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class ProductListImpl implements ProductList { + private ProductListInner innerObject; + + private final AzureStackManager serviceManager; + + ProductListImpl(ProductListInner innerObject, AzureStackManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner.stream().map(inner1 -> new ProductImpl(inner1, this.manager())).collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ProductListInner innerModel() { + return this.innerObject; + } + + private AzureStackManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/ProductLogImpl.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/ProductLogImpl.java new file mode 100644 index 0000000000000..b66469f734398 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/ProductLogImpl.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.implementation; + +import com.azure.resourcemanager.azurestack.AzureStackManager; +import com.azure.resourcemanager.azurestack.fluent.models.ProductLogInner; +import com.azure.resourcemanager.azurestack.models.ProductLog; + +public final class ProductLogImpl implements ProductLog { + private ProductLogInner innerObject; + + private final AzureStackManager serviceManager; + + ProductLogImpl(ProductLogInner innerObject, AzureStackManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String productId() { + return this.innerModel().productId(); + } + + public String subscriptionId() { + return this.innerModel().subscriptionId(); + } + + public String registrationName() { + return this.innerModel().registrationName(); + } + + public String resourceGroupName() { + return this.innerModel().resourceGroupName(); + } + + public String operation() { + return this.innerModel().operation(); + } + + public String startDate() { + return this.innerModel().startDate(); + } + + public String endDate() { + return this.innerModel().endDate(); + } + + public String status() { + return this.innerModel().status(); + } + + public String error() { + return this.innerModel().error(); + } + + public String details() { + return this.innerModel().details(); + } + + public ProductLogInner innerModel() { + return this.innerObject; + } + + private AzureStackManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/ProductsClientImpl.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/ProductsClientImpl.java new file mode 100644 index 0000000000000..4c03c83fa03e8 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/ProductsClientImpl.java @@ -0,0 +1,1384 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.implementation; + +import com.azure.core.annotation.BodyParam; +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.Post; +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.azurestack.fluent.ProductsClient; +import com.azure.resourcemanager.azurestack.fluent.models.ExtendedProductInner; +import com.azure.resourcemanager.azurestack.fluent.models.ProductInner; +import com.azure.resourcemanager.azurestack.fluent.models.ProductListInner; +import com.azure.resourcemanager.azurestack.fluent.models.ProductLogInner; +import com.azure.resourcemanager.azurestack.models.DeviceConfiguration; +import com.azure.resourcemanager.azurestack.models.MarketplaceProductLogUpdate; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ProductsClient. */ +public final class ProductsClientImpl implements ProductsClient { + private final ClientLogger logger = new ClientLogger(ProductsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ProductsService service; + + /** The service client containing this operation class. */ + private final AzureStackManagementClientImpl client; + + /** + * Initializes an instance of ProductsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProductsClientImpl(AzureStackManagementClientImpl client) { + this.service = RestProxy.create(ProductsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackManagementClientProducts to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackManagement") + private interface ProductsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack" + + "/registrations/{registrationName}/products") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroup") String resourceGroup, + @PathParam("registrationName") String registrationName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack" + + "/registrations/{registrationName}/products/{productName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroup") String resourceGroup, + @PathParam("registrationName") String registrationName, + @PathParam("productName") String productName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack" + + "/registrations/{registrationName}/products/{productName}/listDetails") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listDetails( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroup") String resourceGroup, + @PathParam("registrationName") String registrationName, + @PathParam("productName") String productName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack" + + "/registrations/{registrationName}/products/{productName}/getProducts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getProducts( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroup") String resourceGroup, + @PathParam("registrationName") String registrationName, + @PathParam("productName") String productName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DeviceConfiguration deviceConfiguration, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack" + + "/registrations/{registrationName}/products/{productName}/getProduct") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getProduct( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroup") String resourceGroup, + @PathParam("registrationName") String registrationName, + @PathParam("productName") String productName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DeviceConfiguration deviceConfiguration, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack" + + "/registrations/{registrationName}/products/{productName}/uploadProductLog") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> uploadLog( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroup") String resourceGroup, + @PathParam("registrationName") String registrationName, + @PathParam("productName") String productName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") MarketplaceProductLogUpdate marketplaceProductLogUpdate, + @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); + } + + /** + * Returns a list of products. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 pageable list of products. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroup, String registrationName) { + 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (registrationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter registrationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + registrationName, + 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()))); + } + + /** + * Returns a list of products. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 pageable list of products. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroup, String registrationName, 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (registrationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter registrationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + registrationName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns a list of products. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 pageable list of products. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroup, String registrationName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroup, registrationName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Returns a list of products. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 pageable list of products. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroup, String registrationName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroup, registrationName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns a list of products. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 pageable list of products. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroup, String registrationName) { + return new PagedIterable<>(listAsync(resourceGroup, registrationName)); + } + + /** + * Returns a list of products. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 pageable list of products. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroup, String registrationName, Context context) { + return new PagedIterable<>(listAsync(resourceGroup, registrationName, context)); + } + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 product information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroup, String registrationName, String productName) { + 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (registrationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter registrationName is required and cannot be null.")); + } + if (productName == null) { + return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + registrationName, + productName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 product information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroup, String registrationName, String productName, 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (registrationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter registrationName is required and cannot be null.")); + } + if (productName == null) { + return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + registrationName, + productName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 product information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroup, String registrationName, String productName) { + return getWithResponseAsync(resourceGroup, registrationName, productName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 product information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProductInner get(String resourceGroup, String registrationName, String productName) { + return getAsync(resourceGroup, registrationName, productName).block(); + } + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 product information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroup, String registrationName, String productName, Context context) { + return getWithResponseAsync(resourceGroup, registrationName, productName, context).block(); + } + + /** + * Returns the extended properties of a product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 extended description about the product required for installing it into Azure Stack. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDetailsWithResponseAsync( + String resourceGroup, String registrationName, String productName) { + 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (registrationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter registrationName is required and cannot be null.")); + } + if (productName == null) { + return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listDetails( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + registrationName, + productName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Returns the extended properties of a product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 extended description about the product required for installing it into Azure Stack. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDetailsWithResponseAsync( + String resourceGroup, String registrationName, String productName, 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (registrationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter registrationName is required and cannot be null.")); + } + if (productName == null) { + return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listDetails( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + registrationName, + productName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Returns the extended properties of a product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 extended description about the product required for installing it into Azure Stack. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listDetailsAsync( + String resourceGroup, String registrationName, String productName) { + return listDetailsWithResponseAsync(resourceGroup, registrationName, productName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns the extended properties of a product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 extended description about the product required for installing it into Azure Stack. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExtendedProductInner listDetails(String resourceGroup, String registrationName, String productName) { + return listDetailsAsync(resourceGroup, registrationName, productName).block(); + } + + /** + * Returns the extended properties of a product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 extended description about the product required for installing it into Azure Stack. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listDetailsWithResponse( + String resourceGroup, String registrationName, String productName, Context context) { + return listDetailsWithResponseAsync(resourceGroup, registrationName, productName, context).block(); + } + + /** + * Returns a list of products. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @param deviceConfiguration Device configuration. + * @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 pageable list of products. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getProductsWithResponseAsync( + String resourceGroup, String registrationName, String productName, DeviceConfiguration deviceConfiguration) { + 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (registrationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter registrationName is required and cannot be null.")); + } + if (productName == null) { + return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); + } + if (deviceConfiguration != null) { + deviceConfiguration.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getProducts( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + registrationName, + productName, + this.client.getApiVersion(), + deviceConfiguration, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Returns a list of products. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @param deviceConfiguration Device configuration. + * @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 pageable list of products. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getProductsWithResponseAsync( + String resourceGroup, + String registrationName, + String productName, + DeviceConfiguration deviceConfiguration, + 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (registrationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter registrationName is required and cannot be null.")); + } + if (productName == null) { + return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); + } + if (deviceConfiguration != null) { + deviceConfiguration.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getProducts( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + registrationName, + productName, + this.client.getApiVersion(), + deviceConfiguration, + accept, + context); + } + + /** + * Returns a list of products. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @param deviceConfiguration Device configuration. + * @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 pageable list of products. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getProductsAsync( + String resourceGroup, String registrationName, String productName, DeviceConfiguration deviceConfiguration) { + return getProductsWithResponseAsync(resourceGroup, registrationName, productName, deviceConfiguration) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns a list of products. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 pageable list of products. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getProductsAsync(String resourceGroup, String registrationName, String productName) { + final DeviceConfiguration deviceConfiguration = null; + return getProductsWithResponseAsync(resourceGroup, registrationName, productName, deviceConfiguration) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns a list of products. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 pageable list of products. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProductListInner getProducts(String resourceGroup, String registrationName, String productName) { + final DeviceConfiguration deviceConfiguration = null; + return getProductsAsync(resourceGroup, registrationName, productName, deviceConfiguration).block(); + } + + /** + * Returns a list of products. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @param deviceConfiguration Device configuration. + * @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 pageable list of products. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getProductsWithResponse( + String resourceGroup, + String registrationName, + String productName, + DeviceConfiguration deviceConfiguration, + Context context) { + return getProductsWithResponseAsync(resourceGroup, registrationName, productName, deviceConfiguration, context) + .block(); + } + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @param deviceConfiguration Device configuration. + * @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 product information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getProductWithResponseAsync( + String resourceGroup, String registrationName, String productName, DeviceConfiguration deviceConfiguration) { + 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (registrationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter registrationName is required and cannot be null.")); + } + if (productName == null) { + return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); + } + if (deviceConfiguration != null) { + deviceConfiguration.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getProduct( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + registrationName, + productName, + this.client.getApiVersion(), + deviceConfiguration, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @param deviceConfiguration Device configuration. + * @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 product information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getProductWithResponseAsync( + String resourceGroup, + String registrationName, + String productName, + DeviceConfiguration deviceConfiguration, + 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (registrationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter registrationName is required and cannot be null.")); + } + if (productName == null) { + return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); + } + if (deviceConfiguration != null) { + deviceConfiguration.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getProduct( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + registrationName, + productName, + this.client.getApiVersion(), + deviceConfiguration, + accept, + context); + } + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @param deviceConfiguration Device configuration. + * @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 product information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getProductAsync( + String resourceGroup, String registrationName, String productName, DeviceConfiguration deviceConfiguration) { + return getProductWithResponseAsync(resourceGroup, registrationName, productName, deviceConfiguration) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 product information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getProductAsync(String resourceGroup, String registrationName, String productName) { + final DeviceConfiguration deviceConfiguration = null; + return getProductWithResponseAsync(resourceGroup, registrationName, productName, deviceConfiguration) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 product information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProductInner getProduct(String resourceGroup, String registrationName, String productName) { + final DeviceConfiguration deviceConfiguration = null; + return getProductAsync(resourceGroup, registrationName, productName, deviceConfiguration).block(); + } + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @param deviceConfiguration Device configuration. + * @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 product information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getProductWithResponse( + String resourceGroup, + String registrationName, + String productName, + DeviceConfiguration deviceConfiguration, + Context context) { + return getProductWithResponseAsync(resourceGroup, registrationName, productName, deviceConfiguration, context) + .block(); + } + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @param marketplaceProductLogUpdate Update details for product log. + * @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 product action log. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> uploadLogWithResponseAsync( + String resourceGroup, + String registrationName, + String productName, + MarketplaceProductLogUpdate marketplaceProductLogUpdate) { + 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (registrationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter registrationName is required and cannot be null.")); + } + if (productName == null) { + return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); + } + if (marketplaceProductLogUpdate != null) { + marketplaceProductLogUpdate.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .uploadLog( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + registrationName, + productName, + this.client.getApiVersion(), + marketplaceProductLogUpdate, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @param marketplaceProductLogUpdate Update details for product log. + * @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 product action log. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> uploadLogWithResponseAsync( + String resourceGroup, + String registrationName, + String productName, + MarketplaceProductLogUpdate marketplaceProductLogUpdate, + 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (registrationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter registrationName is required and cannot be null.")); + } + if (productName == null) { + return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); + } + if (marketplaceProductLogUpdate != null) { + marketplaceProductLogUpdate.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .uploadLog( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + registrationName, + productName, + this.client.getApiVersion(), + marketplaceProductLogUpdate, + accept, + context); + } + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @param marketplaceProductLogUpdate Update details for product log. + * @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 product action log. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono uploadLogAsync( + String resourceGroup, + String registrationName, + String productName, + MarketplaceProductLogUpdate marketplaceProductLogUpdate) { + return uploadLogWithResponseAsync(resourceGroup, registrationName, productName, marketplaceProductLogUpdate) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 product action log. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono uploadLogAsync(String resourceGroup, String registrationName, String productName) { + final MarketplaceProductLogUpdate marketplaceProductLogUpdate = null; + return uploadLogWithResponseAsync(resourceGroup, registrationName, productName, marketplaceProductLogUpdate) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 product action log. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProductLogInner uploadLog(String resourceGroup, String registrationName, String productName) { + final MarketplaceProductLogUpdate marketplaceProductLogUpdate = null; + return uploadLogAsync(resourceGroup, registrationName, productName, marketplaceProductLogUpdate).block(); + } + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @param marketplaceProductLogUpdate Update details for product log. + * @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 product action log. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response uploadLogWithResponse( + String resourceGroup, + String registrationName, + String productName, + MarketplaceProductLogUpdate marketplaceProductLogUpdate, + Context context) { + return uploadLogWithResponseAsync( + resourceGroup, registrationName, productName, marketplaceProductLogUpdate, context) + .block(); + } + + /** + * 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 pageable list of products. + */ + @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 pageable list of products. + */ + @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/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/ProductsImpl.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/ProductsImpl.java new file mode 100644 index 0000000000000..be261277da7d8 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/ProductsImpl.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.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.azurestack.AzureStackManager; +import com.azure.resourcemanager.azurestack.fluent.ProductsClient; +import com.azure.resourcemanager.azurestack.fluent.models.ExtendedProductInner; +import com.azure.resourcemanager.azurestack.fluent.models.ProductInner; +import com.azure.resourcemanager.azurestack.fluent.models.ProductListInner; +import com.azure.resourcemanager.azurestack.fluent.models.ProductLogInner; +import com.azure.resourcemanager.azurestack.models.DeviceConfiguration; +import com.azure.resourcemanager.azurestack.models.ExtendedProduct; +import com.azure.resourcemanager.azurestack.models.MarketplaceProductLogUpdate; +import com.azure.resourcemanager.azurestack.models.Product; +import com.azure.resourcemanager.azurestack.models.ProductList; +import com.azure.resourcemanager.azurestack.models.ProductLog; +import com.azure.resourcemanager.azurestack.models.Products; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ProductsImpl implements Products { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProductsImpl.class); + + private final ProductsClient innerClient; + + private final AzureStackManager serviceManager; + + public ProductsImpl(ProductsClient innerClient, AzureStackManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroup, String registrationName) { + PagedIterable inner = this.serviceClient().list(resourceGroup, registrationName); + return inner.mapPage(inner1 -> new ProductImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroup, String registrationName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroup, registrationName, context); + return inner.mapPage(inner1 -> new ProductImpl(inner1, this.manager())); + } + + public Product get(String resourceGroup, String registrationName, String productName) { + ProductInner inner = this.serviceClient().get(resourceGroup, registrationName, productName); + if (inner != null) { + return new ProductImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroup, String registrationName, String productName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroup, registrationName, productName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProductImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ExtendedProduct listDetails(String resourceGroup, String registrationName, String productName) { + ExtendedProductInner inner = this.serviceClient().listDetails(resourceGroup, registrationName, productName); + if (inner != null) { + return new ExtendedProductImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listDetailsWithResponse( + String resourceGroup, String registrationName, String productName, Context context) { + Response inner = + this.serviceClient().listDetailsWithResponse(resourceGroup, registrationName, productName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExtendedProductImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ProductList getProducts(String resourceGroup, String registrationName, String productName) { + ProductListInner inner = this.serviceClient().getProducts(resourceGroup, registrationName, productName); + if (inner != null) { + return new ProductListImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getProductsWithResponse( + String resourceGroup, + String registrationName, + String productName, + DeviceConfiguration deviceConfiguration, + Context context) { + Response inner = + this + .serviceClient() + .getProductsWithResponse(resourceGroup, registrationName, productName, deviceConfiguration, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProductListImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Product getProduct(String resourceGroup, String registrationName, String productName) { + ProductInner inner = this.serviceClient().getProduct(resourceGroup, registrationName, productName); + if (inner != null) { + return new ProductImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getProductWithResponse( + String resourceGroup, + String registrationName, + String productName, + DeviceConfiguration deviceConfiguration, + Context context) { + Response inner = + this + .serviceClient() + .getProductWithResponse(resourceGroup, registrationName, productName, deviceConfiguration, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProductImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ProductLog uploadLog(String resourceGroup, String registrationName, String productName) { + ProductLogInner inner = this.serviceClient().uploadLog(resourceGroup, registrationName, productName); + if (inner != null) { + return new ProductLogImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response uploadLogWithResponse( + String resourceGroup, + String registrationName, + String productName, + MarketplaceProductLogUpdate marketplaceProductLogUpdate, + Context context) { + Response inner = + this + .serviceClient() + .uploadLogWithResponse( + resourceGroup, registrationName, productName, marketplaceProductLogUpdate, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProductLogImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ProductsClient serviceClient() { + return this.innerClient; + } + + private AzureStackManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/RegistrationImpl.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/RegistrationImpl.java new file mode 100644 index 0000000000000..a01caeb872013 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/RegistrationImpl.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestack.AzureStackManager; +import com.azure.resourcemanager.azurestack.fluent.models.RegistrationInner; +import com.azure.resourcemanager.azurestack.models.ActivationKeyResult; +import com.azure.resourcemanager.azurestack.models.Location; +import com.azure.resourcemanager.azurestack.models.Registration; +import com.azure.resourcemanager.azurestack.models.RegistrationParameter; +import com.azure.resourcemanager.azurestack.models.SystemData; +import java.util.Collections; +import java.util.Map; + +public final class RegistrationImpl implements Registration, Registration.Definition, Registration.Update { + private RegistrationInner innerObject; + + private final AzureStackManager 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 objectId() { + return this.innerModel().objectId(); + } + + public String cloudId() { + return this.innerModel().cloudId(); + } + + public String billingModel() { + return this.innerModel().billingModel(); + } + + public String kind() { + return this.innerModel().kind(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public RegistrationInner innerModel() { + return this.innerObject; + } + + private AzureStackManager manager() { + return this.serviceManager; + } + + private String resourceGroup; + + private String registrationName; + + private RegistrationParameter createToken; + + private RegistrationParameter updateToken; + + public RegistrationImpl withExistingResourceGroup(String resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + + public Registration create() { + this.innerObject = + serviceManager + .serviceClient() + .getRegistrations() + .createOrUpdateWithResponse(resourceGroup, registrationName, createToken, Context.NONE) + .getValue(); + return this; + } + + public Registration create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRegistrations() + .createOrUpdateWithResponse(resourceGroup, registrationName, createToken, context) + .getValue(); + return this; + } + + RegistrationImpl(String name, AzureStackManager serviceManager) { + this.innerObject = new RegistrationInner(); + this.serviceManager = serviceManager; + this.registrationName = name; + this.createToken = new RegistrationParameter(); + } + + public RegistrationImpl update() { + this.updateToken = new RegistrationParameter(); + return this; + } + + public Registration apply() { + this.innerObject = + serviceManager + .serviceClient() + .getRegistrations() + .updateWithResponse(resourceGroup, registrationName, updateToken, Context.NONE) + .getValue(); + return this; + } + + public Registration apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRegistrations() + .updateWithResponse(resourceGroup, registrationName, updateToken, context) + .getValue(); + return this; + } + + RegistrationImpl(RegistrationInner innerObject, AzureStackManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroup = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.registrationName = Utils.getValueFromIdByName(innerObject.id(), "registrations"); + } + + public Registration refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getRegistrations() + .getByResourceGroupWithResponse(resourceGroup, registrationName, Context.NONE) + .getValue(); + return this; + } + + public Registration refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRegistrations() + .getByResourceGroupWithResponse(resourceGroup, registrationName, context) + .getValue(); + return this; + } + + public ActivationKeyResult getActivationKey() { + return serviceManager.registrations().getActivationKey(resourceGroup, registrationName); + } + + public Response getActivationKeyWithResponse(Context context) { + return serviceManager.registrations().getActivationKeyWithResponse(resourceGroup, registrationName, context); + } + + public void enableRemoteManagement() { + serviceManager.registrations().enableRemoteManagement(resourceGroup, registrationName); + } + + public Response enableRemoteManagementWithResponse(Context context) { + return serviceManager + .registrations() + .enableRemoteManagementWithResponse(resourceGroup, registrationName, context); + } + + public RegistrationImpl withLocation(Location location) { + this.createToken.withLocation(location); + return this; + } + + public RegistrationImpl withRegistrationToken(String registrationToken) { + if (isInCreateMode()) { + this.createToken.withRegistrationToken(registrationToken); + return this; + } else { + this.updateToken.withRegistrationToken(registrationToken); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/RegistrationsClientImpl.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/RegistrationsClientImpl.java new file mode 100644 index 0000000000000..6a8c966de719b --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/RegistrationsClientImpl.java @@ -0,0 +1,1325 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.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.Post; +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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestack.fluent.RegistrationsClient; +import com.azure.resourcemanager.azurestack.fluent.models.ActivationKeyResultInner; +import com.azure.resourcemanager.azurestack.fluent.models.RegistrationInner; +import com.azure.resourcemanager.azurestack.models.RegistrationList; +import com.azure.resourcemanager.azurestack.models.RegistrationParameter; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RegistrationsClient. */ +public final class RegistrationsClientImpl implements RegistrationsClient { + private final ClientLogger logger = new ClientLogger(RegistrationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final RegistrationsService service; + + /** The service client containing this operation class. */ + private final AzureStackManagementClientImpl client; + + /** + * Initializes an instance of RegistrationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RegistrationsClientImpl(AzureStackManagementClientImpl client) { + this.service = + RestProxy.create(RegistrationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackManagementClientRegistrations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackManagement") + private interface RegistrationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack" + + "/registrations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroup") String resourceGroup, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack" + + "/registrations/{registrationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroup") String resourceGroup, + @PathParam("registrationName") String registrationName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack" + + "/registrations/{registrationName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroup") String resourceGroup, + @PathParam("registrationName") String registrationName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack" + + "/registrations/{registrationName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroup") String resourceGroup, + @PathParam("registrationName") String registrationName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RegistrationParameter token, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack" + + "/registrations/{registrationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroup") String resourceGroup, + @PathParam("registrationName") String registrationName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RegistrationParameter token, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack" + + "/registrations/{registrationName}/getactivationkey") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getActivationKey( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroup") String resourceGroup, + @PathParam("registrationName") String registrationName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack" + + "/registrations/{registrationName}/enableRemoteManagement") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> enableRemoteManagement( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroup") String resourceGroup, + @PathParam("registrationName") String registrationName, + @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); + } + + /** + * Returns a list of all registrations. + * + * @param resourceGroup Name of the resource group. + * @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 pageable list of registrations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroup) { + 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + 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()))); + } + + /** + * Returns a list of all registrations. + * + * @param resourceGroup Name of the resource group. + * @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 pageable list of registrations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroup, 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns a list of all registrations. + * + * @param resourceGroup Name of the resource group. + * @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 pageable list of registrations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroup) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroup), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Returns a list of all registrations. + * + * @param resourceGroup Name of the resource group. + * @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 pageable list of registrations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroup, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroup, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns a list of all registrations. + * + * @param resourceGroup Name of the resource group. + * @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 pageable list of registrations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroup) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroup)); + } + + /** + * Returns a list of all registrations. + * + * @param resourceGroup Name of the resource group. + * @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 pageable list of registrations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroup, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroup, context)); + } + + /** + * Returns the properties of an Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 registration information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroup, String registrationName) { + 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (registrationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter registrationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + registrationName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Returns the properties of an Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 registration information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroup, String registrationName, 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (registrationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter registrationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + registrationName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Returns the properties of an Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 registration information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroup, String registrationName) { + return getByResourceGroupWithResponseAsync(resourceGroup, registrationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns the properties of an Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 registration information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistrationInner getByResourceGroup(String resourceGroup, String registrationName) { + return getByResourceGroupAsync(resourceGroup, registrationName).block(); + } + + /** + * Returns the properties of an Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 registration information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroup, String registrationName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroup, registrationName, context).block(); + } + + /** + * Delete the requested Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 resourceGroup, String registrationName) { + 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (registrationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter registrationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + registrationName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Delete the requested Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 resourceGroup, String registrationName, 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (registrationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter registrationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + registrationName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete the requested Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 resourceGroup, String registrationName) { + return deleteWithResponseAsync(resourceGroup, registrationName).flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete the requested Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 resourceGroup, String registrationName) { + deleteAsync(resourceGroup, registrationName).block(); + } + + /** + * Delete the requested Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroup, String registrationName, Context context) { + return deleteWithResponseAsync(resourceGroup, registrationName, context).block(); + } + + /** + * Create or update an Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param token Registration token. + * @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 registration information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroup, String registrationName, RegistrationParameter token) { + 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (registrationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter registrationName is required and cannot be null.")); + } + if (token == null) { + return Mono.error(new IllegalArgumentException("Parameter token is required and cannot be null.")); + } else { + token.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + registrationName, + this.client.getApiVersion(), + token, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create or update an Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param token Registration token. + * @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 registration information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroup, String registrationName, RegistrationParameter token, 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (registrationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter registrationName is required and cannot be null.")); + } + if (token == null) { + return Mono.error(new IllegalArgumentException("Parameter token is required and cannot be null.")); + } else { + token.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + registrationName, + this.client.getApiVersion(), + token, + accept, + context); + } + + /** + * Create or update an Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param token Registration token. + * @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 registration information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroup, String registrationName, RegistrationParameter token) { + return createOrUpdateWithResponseAsync(resourceGroup, registrationName, token) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or update an Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param token Registration token. + * @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 registration information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistrationInner createOrUpdate( + String resourceGroup, String registrationName, RegistrationParameter token) { + return createOrUpdateAsync(resourceGroup, registrationName, token).block(); + } + + /** + * Create or update an Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param token Registration token. + * @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 registration information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroup, String registrationName, RegistrationParameter token, Context context) { + return createOrUpdateWithResponseAsync(resourceGroup, registrationName, token, context).block(); + } + + /** + * Patch an Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param token Registration token. + * @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 registration information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroup, String registrationName, RegistrationParameter token) { + 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (registrationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter registrationName is required and cannot be null.")); + } + if (token == null) { + return Mono.error(new IllegalArgumentException("Parameter token is required and cannot be null.")); + } else { + token.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + registrationName, + this.client.getApiVersion(), + token, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Patch an Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param token Registration token. + * @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 registration information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroup, String registrationName, RegistrationParameter token, 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (registrationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter registrationName is required and cannot be null.")); + } + if (token == null) { + return Mono.error(new IllegalArgumentException("Parameter token is required and cannot be null.")); + } else { + token.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + registrationName, + this.client.getApiVersion(), + token, + accept, + context); + } + + /** + * Patch an Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param token Registration token. + * @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 registration information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroup, String registrationName, RegistrationParameter token) { + return updateWithResponseAsync(resourceGroup, registrationName, token) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Patch an Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param token Registration token. + * @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 registration information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistrationInner update(String resourceGroup, String registrationName, RegistrationParameter token) { + return updateAsync(resourceGroup, registrationName, token).block(); + } + + /** + * Patch an Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param token Registration token. + * @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 registration information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroup, String registrationName, RegistrationParameter token, Context context) { + return updateWithResponseAsync(resourceGroup, registrationName, token, context).block(); + } + + /** + * Returns Azure Stack Activation Key. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 resource containing the Azure Stack activation key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getActivationKeyWithResponseAsync( + String resourceGroup, String registrationName) { + 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (registrationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter registrationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getActivationKey( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + registrationName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Returns Azure Stack Activation Key. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 resource containing the Azure Stack activation key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getActivationKeyWithResponseAsync( + String resourceGroup, String registrationName, 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (registrationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter registrationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getActivationKey( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + registrationName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Returns Azure Stack Activation Key. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 resource containing the Azure Stack activation key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getActivationKeyAsync(String resourceGroup, String registrationName) { + return getActivationKeyWithResponseAsync(resourceGroup, registrationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns Azure Stack Activation Key. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 resource containing the Azure Stack activation key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ActivationKeyResultInner getActivationKey(String resourceGroup, String registrationName) { + return getActivationKeyAsync(resourceGroup, registrationName).block(); + } + + /** + * Returns Azure Stack Activation Key. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 resource containing the Azure Stack activation key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getActivationKeyWithResponse( + String resourceGroup, String registrationName, Context context) { + return getActivationKeyWithResponseAsync(resourceGroup, registrationName, context).block(); + } + + /** + * Enables remote management for device under the Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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> enableRemoteManagementWithResponseAsync( + String resourceGroup, String registrationName) { + 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (registrationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter registrationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .enableRemoteManagement( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + registrationName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Enables remote management for device under the Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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> enableRemoteManagementWithResponseAsync( + String resourceGroup, String registrationName, 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 (resourceGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null.")); + } + if (registrationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter registrationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .enableRemoteManagement( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + registrationName, + accept, + context); + } + + /** + * Enables remote management for device under the Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 enableRemoteManagementAsync(String resourceGroup, String registrationName) { + return enableRemoteManagementWithResponseAsync(resourceGroup, registrationName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Enables remote management for device under the Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 enableRemoteManagement(String resourceGroup, String registrationName) { + enableRemoteManagementAsync(resourceGroup, registrationName).block(); + } + + /** + * Enables remote management for device under the Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response enableRemoteManagementWithResponse( + String resourceGroup, String registrationName, Context context) { + return enableRemoteManagementWithResponseAsync(resourceGroup, registrationName, context).block(); + } + + /** + * 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 pageable list of registrations. + */ + @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 pageable list of registrations. + */ + @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/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/RegistrationsImpl.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/RegistrationsImpl.java new file mode 100644 index 0000000000000..c25625d1ab866 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/RegistrationsImpl.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.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.azurestack.AzureStackManager; +import com.azure.resourcemanager.azurestack.fluent.RegistrationsClient; +import com.azure.resourcemanager.azurestack.fluent.models.ActivationKeyResultInner; +import com.azure.resourcemanager.azurestack.fluent.models.RegistrationInner; +import com.azure.resourcemanager.azurestack.models.ActivationKeyResult; +import com.azure.resourcemanager.azurestack.models.Registration; +import com.azure.resourcemanager.azurestack.models.Registrations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RegistrationsImpl implements Registrations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegistrationsImpl.class); + + private final RegistrationsClient innerClient; + + private final AzureStackManager serviceManager; + + public RegistrationsImpl(RegistrationsClient innerClient, AzureStackManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByResourceGroup(String resourceGroup) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroup); + return inner.mapPage(inner1 -> new RegistrationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroup, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroup, context); + return inner.mapPage(inner1 -> new RegistrationImpl(inner1, this.manager())); + } + + public Registration getByResourceGroup(String resourceGroup, String registrationName) { + RegistrationInner inner = this.serviceClient().getByResourceGroup(resourceGroup, registrationName); + if (inner != null) { + return new RegistrationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroup, String registrationName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroup, registrationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RegistrationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroup, String registrationName) { + this.serviceClient().delete(resourceGroup, registrationName); + } + + public Response deleteWithResponse(String resourceGroup, String registrationName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroup, registrationName, context); + } + + public ActivationKeyResult getActivationKey(String resourceGroup, String registrationName) { + ActivationKeyResultInner inner = this.serviceClient().getActivationKey(resourceGroup, registrationName); + if (inner != null) { + return new ActivationKeyResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getActivationKeyWithResponse( + String resourceGroup, String registrationName, Context context) { + Response inner = + this.serviceClient().getActivationKeyWithResponse(resourceGroup, registrationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ActivationKeyResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void enableRemoteManagement(String resourceGroup, String registrationName) { + this.serviceClient().enableRemoteManagement(resourceGroup, registrationName); + } + + public Response enableRemoteManagementWithResponse( + String resourceGroup, String registrationName, Context context) { + return this.serviceClient().enableRemoteManagementWithResponse(resourceGroup, registrationName, context); + } + + public Registration getById(String id) { + String resourceGroup = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroup == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registrationName = Utils.getValueFromIdByName(id, "registrations"); + if (registrationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registrations'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroup, registrationName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroup = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroup == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registrationName = Utils.getValueFromIdByName(id, "registrations"); + if (registrationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registrations'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroup, registrationName, context); + } + + public void deleteById(String id) { + String resourceGroup = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroup == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registrationName = Utils.getValueFromIdByName(id, "registrations"); + if (registrationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registrations'.", id))); + } + this.deleteWithResponse(resourceGroup, registrationName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroup = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroup == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registrationName = Utils.getValueFromIdByName(id, "registrations"); + if (registrationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registrations'.", id))); + } + return this.deleteWithResponse(resourceGroup, registrationName, context); + } + + private RegistrationsClient serviceClient() { + return this.innerClient; + } + + private AzureStackManager manager() { + return this.serviceManager; + } + + public RegistrationImpl define(String name) { + return new RegistrationImpl(name, this.manager()); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/Utils.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/Utils.java new file mode 100644 index 0000000000000..675cb5509f8e7 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/Utils.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.implementation; + +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; + +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; + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/package-info.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/package-info.java new file mode 100644 index 0000000000000..1aa80e97af67b --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/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 implementations for AzureStackManagementClient. Azure Stack. */ +package com.azure.resourcemanager.azurestack.implementation; diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ActivationKeyResult.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ActivationKeyResult.java new file mode 100644 index 0000000000000..63677a6d2dfef --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ActivationKeyResult.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.models; + +import com.azure.resourcemanager.azurestack.fluent.models.ActivationKeyResultInner; + +/** An immutable client-side representation of ActivationKeyResult. */ +public interface ActivationKeyResult { + /** + * Gets the activationKey property: Azure Stack activation key. + * + * @return the activationKey value. + */ + String activationKey(); + + /** + * Gets the inner com.azure.resourcemanager.azurestack.fluent.models.ActivationKeyResultInner object. + * + * @return the inner object. + */ + ActivationKeyResultInner innerModel(); +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Category.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Category.java new file mode 100644 index 0000000000000..d0f116983677d --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Category.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Category. */ +public final class Category extends ExpandableStringEnum { + /** Static value AzureAD for Category. */ + public static final Category AZURE_AD = fromString("AzureAD"); + + /** Static value ADFS for Category. */ + public static final Category ADFS = fromString("ADFS"); + + /** + * Creates or finds a Category from its string representation. + * + * @param name a name to look for. + * @return the corresponding Category. + */ + @JsonCreator + public static Category fromString(String name) { + return fromString(name, Category.class); + } + + /** @return known Category values. */ + public static Collection values() { + return values(Category.class); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CloudManifestFileDeploymentData.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CloudManifestFileDeploymentData.java new file mode 100644 index 0000000000000..7a384ffc37be8 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CloudManifestFileDeploymentData.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Cloud specific manifest data for AzureStack deployment. */ +@JsonFlatten +@Fluent +public class CloudManifestFileDeploymentData { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudManifestFileDeploymentData.class); + + /* + * Dsms external certificates. + */ + @JsonProperty(value = "externalDsmsCertificates") + private String externalDsmsCertificates; + + /* + * Signing verification public key. + */ + @JsonProperty(value = "customCloudVerificationKey") + private String customCloudVerificationKey; + + /* + * ARM endpoint. + */ + @JsonProperty(value = "customEnvironmentEndpoints.customCloudArmEndpoint") + private String customCloudArmEndpoint; + + /* + * Dsms endpoint. + */ + @JsonProperty(value = "customEnvironmentEndpoints.externalDsmsEndpoint") + private String externalDsmsEndpoint; + + /** + * Get the externalDsmsCertificates property: Dsms external certificates. + * + * @return the externalDsmsCertificates value. + */ + public String externalDsmsCertificates() { + return this.externalDsmsCertificates; + } + + /** + * Set the externalDsmsCertificates property: Dsms external certificates. + * + * @param externalDsmsCertificates the externalDsmsCertificates value to set. + * @return the CloudManifestFileDeploymentData object itself. + */ + public CloudManifestFileDeploymentData withExternalDsmsCertificates(String externalDsmsCertificates) { + this.externalDsmsCertificates = externalDsmsCertificates; + return this; + } + + /** + * Get the customCloudVerificationKey property: Signing verification public key. + * + * @return the customCloudVerificationKey value. + */ + public String customCloudVerificationKey() { + return this.customCloudVerificationKey; + } + + /** + * Set the customCloudVerificationKey property: Signing verification public key. + * + * @param customCloudVerificationKey the customCloudVerificationKey value to set. + * @return the CloudManifestFileDeploymentData object itself. + */ + public CloudManifestFileDeploymentData withCustomCloudVerificationKey(String customCloudVerificationKey) { + this.customCloudVerificationKey = customCloudVerificationKey; + return this; + } + + /** + * Get the customCloudArmEndpoint property: ARM endpoint. + * + * @return the customCloudArmEndpoint value. + */ + public String customCloudArmEndpoint() { + return this.customCloudArmEndpoint; + } + + /** + * Set the customCloudArmEndpoint property: ARM endpoint. + * + * @param customCloudArmEndpoint the customCloudArmEndpoint value to set. + * @return the CloudManifestFileDeploymentData object itself. + */ + public CloudManifestFileDeploymentData withCustomCloudArmEndpoint(String customCloudArmEndpoint) { + this.customCloudArmEndpoint = customCloudArmEndpoint; + return this; + } + + /** + * Get the externalDsmsEndpoint property: Dsms endpoint. + * + * @return the externalDsmsEndpoint value. + */ + public String externalDsmsEndpoint() { + return this.externalDsmsEndpoint; + } + + /** + * Set the externalDsmsEndpoint property: Dsms endpoint. + * + * @param externalDsmsEndpoint the externalDsmsEndpoint value to set. + * @return the CloudManifestFileDeploymentData object itself. + */ + public CloudManifestFileDeploymentData withExternalDsmsEndpoint(String externalDsmsEndpoint) { + this.externalDsmsEndpoint = externalDsmsEndpoint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CloudManifestFileProperties.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CloudManifestFileProperties.java new file mode 100644 index 0000000000000..7f6278f7f8cd5 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CloudManifestFileProperties.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.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; + +/** Cloud specific manifest JSON properties. */ +@Fluent +public final class CloudManifestFileProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudManifestFileProperties.class); + + /* + * Cloud specific manifest data. + */ + @JsonProperty(value = "deploymentData") + private CloudManifestFileDeploymentData deploymentData; + + /* + * Signature of the cloud specific manifest data. + */ + @JsonProperty(value = "signature") + private String signature; + + /** + * Get the deploymentData property: Cloud specific manifest data. + * + * @return the deploymentData value. + */ + public CloudManifestFileDeploymentData deploymentData() { + return this.deploymentData; + } + + /** + * Set the deploymentData property: Cloud specific manifest data. + * + * @param deploymentData the deploymentData value to set. + * @return the CloudManifestFileProperties object itself. + */ + public CloudManifestFileProperties withDeploymentData(CloudManifestFileDeploymentData deploymentData) { + this.deploymentData = deploymentData; + return this; + } + + /** + * Get the signature property: Signature of the cloud specific manifest data. + * + * @return the signature value. + */ + public String signature() { + return this.signature; + } + + /** + * Set the signature property: Signature of the cloud specific manifest data. + * + * @param signature the signature value to set. + * @return the CloudManifestFileProperties object itself. + */ + public CloudManifestFileProperties withSignature(String signature) { + this.signature = signature; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (deploymentData() != null) { + deploymentData().validate(); + } + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CloudManifestFileResponse.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CloudManifestFileResponse.java new file mode 100644 index 0000000000000..782356a6d2c94 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CloudManifestFileResponse.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.azurestack.models; + +import com.azure.resourcemanager.azurestack.fluent.models.CloudManifestFileResponseInner; + +/** An immutable client-side representation of CloudManifestFileResponse. */ +public interface CloudManifestFileResponse { + /** + * 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 properties property: Cloud specific manifest data. + * + * @return the properties value. + */ + CloudManifestFileProperties properties(); + + /** + * Gets the etag property: The entity tag used for optimistic concurrency when modifying the resource. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the inner com.azure.resourcemanager.azurestack.fluent.models.CloudManifestFileResponseInner object. + * + * @return the inner object. + */ + CloudManifestFileResponseInner innerModel(); +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CloudManifestFiles.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CloudManifestFiles.java new file mode 100644 index 0000000000000..38f0d07d3be51 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CloudManifestFiles.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.azurestack.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of CloudManifestFiles. */ +public interface CloudManifestFiles { + /** + * Returns a cloud specific manifest JSON file with latest version. + * + * @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 cloud specific manifest GET response. + */ + CloudManifestFileResponse list(); + + /** + * Returns a cloud specific manifest JSON file with latest version. + * + * @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 cloud specific manifest GET response. + */ + Response listWithResponse(Context context); + + /** + * Returns a cloud specific manifest JSON file. + * + * @param verificationVersion Signing verification key version. + * @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 cloud specific manifest GET response. + */ + CloudManifestFileResponse get(String verificationVersion); + + /** + * Returns a cloud specific manifest JSON file. + * + * @param verificationVersion Signing verification key version. + * @param versionCreationDate Signing verification key version creation date. + * @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 cloud specific manifest GET response. + */ + Response getWithResponse( + String verificationVersion, String versionCreationDate, Context context); +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Compatibility.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Compatibility.java new file mode 100644 index 0000000000000..1162ee4cbe320 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Compatibility.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.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.List; + +/** Product compatibility. */ +@Fluent +public final class Compatibility { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Compatibility.class); + + /* + * Tells if product is compatible with current device + */ + @JsonProperty(value = "isCompatible") + private Boolean isCompatible; + + /* + * Short error message if any compatibility issues are found + */ + @JsonProperty(value = "message") + private String message; + + /* + * Full error message if any compatibility issues are found + */ + @JsonProperty(value = "description") + private String description; + + /* + * List of all issues found + */ + @JsonProperty(value = "issues") + private List issues; + + /** + * Get the isCompatible property: Tells if product is compatible with current device. + * + * @return the isCompatible value. + */ + public Boolean isCompatible() { + return this.isCompatible; + } + + /** + * Set the isCompatible property: Tells if product is compatible with current device. + * + * @param isCompatible the isCompatible value to set. + * @return the Compatibility object itself. + */ + public Compatibility withIsCompatible(Boolean isCompatible) { + this.isCompatible = isCompatible; + return this; + } + + /** + * Get the message property: Short error message if any compatibility issues are found. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Short error message if any compatibility issues are found. + * + * @param message the message value to set. + * @return the Compatibility object itself. + */ + public Compatibility withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the description property: Full error message if any compatibility issues are found. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Full error message if any compatibility issues are found. + * + * @param description the description value to set. + * @return the Compatibility object itself. + */ + public Compatibility withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the issues property: List of all issues found. + * + * @return the issues value. + */ + public List issues() { + return this.issues; + } + + /** + * Set the issues property: List of all issues found. + * + * @param issues the issues value to set. + * @return the Compatibility object itself. + */ + public Compatibility withIssues(List issues) { + this.issues = issues; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CompatibilityIssue.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CompatibilityIssue.java new file mode 100644 index 0000000000000..cc75569d31025 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CompatibilityIssue.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CompatibilityIssue. */ +public final class CompatibilityIssue extends ExpandableStringEnum { + /** Static value HigherDeviceVersionRequired for CompatibilityIssue. */ + public static final CompatibilityIssue HIGHER_DEVICE_VERSION_REQUIRED = fromString("HigherDeviceVersionRequired"); + + /** Static value LowerDeviceVersionRequired for CompatibilityIssue. */ + public static final CompatibilityIssue LOWER_DEVICE_VERSION_REQUIRED = fromString("LowerDeviceVersionRequired"); + + /** Static value CapacityBillingModelRequired for CompatibilityIssue. */ + public static final CompatibilityIssue CAPACITY_BILLING_MODEL_REQUIRED = fromString("CapacityBillingModelRequired"); + + /** Static value PayAsYouGoBillingModelRequired for CompatibilityIssue. */ + public static final CompatibilityIssue PAY_AS_YOU_GO_BILLING_MODEL_REQUIRED = + fromString("PayAsYouGoBillingModelRequired"); + + /** Static value DevelopmentBillingModelRequired for CompatibilityIssue. */ + public static final CompatibilityIssue DEVELOPMENT_BILLING_MODEL_REQUIRED = + fromString("DevelopmentBillingModelRequired"); + + /** Static value AzureADIdentitySystemRequired for CompatibilityIssue. */ + public static final CompatibilityIssue AZURE_ADIDENTITY_SYSTEM_REQUIRED = + fromString("AzureADIdentitySystemRequired"); + + /** Static value ADFSIdentitySystemRequired for CompatibilityIssue. */ + public static final CompatibilityIssue ADFSIDENTITY_SYSTEM_REQUIRED = fromString("ADFSIdentitySystemRequired"); + + /** Static value ConnectionToInternetRequired for CompatibilityIssue. */ + public static final CompatibilityIssue CONNECTION_TO_INTERNET_REQUIRED = fromString("ConnectionToInternetRequired"); + + /** Static value ConnectionToAzureRequired for CompatibilityIssue. */ + public static final CompatibilityIssue CONNECTION_TO_AZURE_REQUIRED = fromString("ConnectionToAzureRequired"); + + /** Static value DisconnectedEnvironmentRequired for CompatibilityIssue. */ + public static final CompatibilityIssue DISCONNECTED_ENVIRONMENT_REQUIRED = + fromString("DisconnectedEnvironmentRequired"); + + /** + * Creates or finds a CompatibilityIssue from its string representation. + * + * @param name a name to look for. + * @return the corresponding CompatibilityIssue. + */ + @JsonCreator + public static CompatibilityIssue fromString(String name) { + return fromString(name, CompatibilityIssue.class); + } + + /** @return known CompatibilityIssue values. */ + public static Collection values() { + return values(CompatibilityIssue.class); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ComputeRole.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ComputeRole.java new file mode 100644 index 0000000000000..a3456618a7fc4 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ComputeRole.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ComputeRole. */ +public final class ComputeRole extends ExpandableStringEnum { + /** Static value None for ComputeRole. */ + public static final ComputeRole NONE = fromString("None"); + + /** Static value IaaS for ComputeRole. */ + public static final ComputeRole IAAS = fromString("IaaS"); + + /** Static value PaaS for ComputeRole. */ + public static final ComputeRole PAAS = fromString("PaaS"); + + /** + * Creates or finds a ComputeRole from its string representation. + * + * @param name a name to look for. + * @return the corresponding ComputeRole. + */ + @JsonCreator + public static ComputeRole fromString(String name) { + return fromString(name, ComputeRole.class); + } + + /** @return known ComputeRole values. */ + public static Collection values() { + return values(ComputeRole.class); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CreatedByType.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CreatedByType.java new file mode 100644 index 0000000000000..d01a3657aafaa --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CreatedByType.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.azurestack.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CreatedByType. */ +public final class CreatedByType extends ExpandableStringEnum { + /** Static value User for CreatedByType. */ + public static final CreatedByType USER = fromString("User"); + + /** Static value Application for CreatedByType. */ + public static final CreatedByType APPLICATION = fromString("Application"); + + /** Static value ManagedIdentity for CreatedByType. */ + public static final CreatedByType MANAGED_IDENTITY = fromString("ManagedIdentity"); + + /** Static value Key for CreatedByType. */ + public static final CreatedByType KEY = fromString("Key"); + + /** + * Creates or finds a CreatedByType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CreatedByType. + */ + @JsonCreator + public static CreatedByType fromString(String name) { + return fromString(name, CreatedByType.class); + } + + /** @return known CreatedByType values. */ + public static Collection values() { + return values(CreatedByType.class); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CustomerSubscription.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CustomerSubscription.java new file mode 100644 index 0000000000000..8386715fff273 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CustomerSubscription.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestack.fluent.models.CustomerSubscriptionInner; + +/** An immutable client-side representation of CustomerSubscription. */ +public interface CustomerSubscription { + /** + * 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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the tenantId property: Tenant Id. + * + * @return the tenantId value. + */ + String tenantId(); + + /** + * Gets the etag property: The entity tag used for optimistic concurrency when modifying the resource. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the inner com.azure.resourcemanager.azurestack.fluent.models.CustomerSubscriptionInner object. + * + * @return the inner object. + */ + CustomerSubscriptionInner innerModel(); + + /** The entirety of the CustomerSubscription definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The CustomerSubscription definition stages. */ + interface DefinitionStages { + /** The first stage of the CustomerSubscription definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the CustomerSubscription definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroup, registrationName. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @return the next definition stage. + */ + WithCreate withExistingRegistration(String resourceGroup, String registrationName); + } + /** + * The stage of the CustomerSubscription 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.WithTenantId, DefinitionStages.WithEtag { + /** + * Executes the create request. + * + * @return the created resource. + */ + CustomerSubscription create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CustomerSubscription create(Context context); + } + /** The stage of the CustomerSubscription definition allowing to specify tenantId. */ + interface WithTenantId { + /** + * Specifies the tenantId property: Tenant Id.. + * + * @param tenantId Tenant Id. + * @return the next definition stage. + */ + WithCreate withTenantId(String tenantId); + } + /** The stage of the CustomerSubscription definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: The entity tag used for optimistic concurrency when modifying the resource.. + * + * @param etag The entity tag used for optimistic concurrency when modifying the resource. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CustomerSubscription refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CustomerSubscription refresh(Context context); +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CustomerSubscriptionList.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CustomerSubscriptionList.java new file mode 100644 index 0000000000000..1393b09774366 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CustomerSubscriptionList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestack.fluent.models.CustomerSubscriptionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Pageable list of customer subscriptions. */ +@Fluent +public final class CustomerSubscriptionList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomerSubscriptionList.class); + + /* + * URI to the next page. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * List of customer subscriptions. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the nextLink property: URI to the next page. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URI to the next page. + * + * @param nextLink the nextLink value to set. + * @return the CustomerSubscriptionList object itself. + */ + public CustomerSubscriptionList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: List of customer subscriptions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of customer subscriptions. + * + * @param value the value value to set. + * @return the CustomerSubscriptionList object itself. + */ + public CustomerSubscriptionList withValue(List value) { + this.value = value; + 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/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CustomerSubscriptions.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CustomerSubscriptions.java new file mode 100644 index 0000000000000..86e4d68275a61 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CustomerSubscriptions.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.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 CustomerSubscriptions. */ +public interface CustomerSubscriptions { + /** + * Returns a list of products. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 pageable list of customer subscriptions. + */ + PagedIterable list(String resourceGroup, String registrationName); + + /** + * Returns a list of products. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 pageable list of customer subscriptions. + */ + PagedIterable list(String resourceGroup, String registrationName, Context context); + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param customerSubscriptionName Name of the product. + * @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 customer subscription. + */ + CustomerSubscription get(String resourceGroup, String registrationName, String customerSubscriptionName); + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param customerSubscriptionName Name of the product. + * @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 customer subscription. + */ + Response getWithResponse( + String resourceGroup, String registrationName, String customerSubscriptionName, Context context); + + /** + * Deletes a customer subscription under a registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param customerSubscriptionName Name of the product. + * @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 resourceGroup, String registrationName, String customerSubscriptionName); + + /** + * Deletes a customer subscription under a registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param customerSubscriptionName Name of the product. + * @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 response. + */ + Response deleteWithResponse( + String resourceGroup, String registrationName, String customerSubscriptionName, Context context); + + /** + * Returns the specified product. + * + * @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 customer subscription. + */ + CustomerSubscription getById(String id); + + /** + * Returns the specified product. + * + * @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 customer subscription. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a customer subscription under a registration. + * + * @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 a customer subscription under a registration. + * + * @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 the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new CustomerSubscription resource. + * + * @param name resource name. + * @return the first stage of the new CustomerSubscription definition. + */ + CustomerSubscription.DefinitionStages.Blank define(String name); +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/DataDiskImage.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/DataDiskImage.java new file mode 100644 index 0000000000000..27626083bc78a --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/DataDiskImage.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.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; + +/** Data disk image. */ +@Immutable +public final class DataDiskImage { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataDiskImage.class); + + /* + * The LUN. + */ + @JsonProperty(value = "lun", access = JsonProperty.Access.WRITE_ONLY) + private Integer lun; + + /* + * SAS key for source blob. + */ + @JsonProperty(value = "sourceBlobSasUri", access = JsonProperty.Access.WRITE_ONLY) + private String sourceBlobSasUri; + + /** + * Get the lun property: The LUN. + * + * @return the lun value. + */ + public Integer lun() { + return this.lun; + } + + /** + * Get the sourceBlobSasUri property: SAS key for source blob. + * + * @return the sourceBlobSasUri value. + */ + public String sourceBlobSasUri() { + return this.sourceBlobSasUri; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/DeviceConfiguration.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/DeviceConfiguration.java new file mode 100644 index 0000000000000..3bb6c87d98951 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/DeviceConfiguration.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.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; + +/** Device Configuration. */ +@Immutable +public final class DeviceConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeviceConfiguration.class); + + /* + * Version of the device. + */ + @JsonProperty(value = "deviceVersion", access = JsonProperty.Access.WRITE_ONLY) + private String deviceVersion; + + /* + * Identity system of the device. + */ + @JsonProperty(value = "identitySystem", access = JsonProperty.Access.WRITE_ONLY) + private Category identitySystem; + + /** + * Get the deviceVersion property: Version of the device. + * + * @return the deviceVersion value. + */ + public String deviceVersion() { + return this.deviceVersion; + } + + /** + * Get the identitySystem property: Identity system of the device. + * + * @return the identitySystem value. + */ + public Category identitySystem() { + return this.identitySystem; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Display.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Display.java new file mode 100644 index 0000000000000..7c4abe3f93d13 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Display.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.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; + +/** Contains the localized display information for this particular operation or action. */ +@Fluent +public final class Display { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Display.class); + + /* + * The localized, friendly version of the resource provider name. + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * The localized, friendly version of the resource type related to this + * action or operation; the resource type should match the public + * documentation for the resource provider. + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * The localized, friendly name for the operation. Use the name as it will + * displayed to the user. + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * The localized, friendly description for the operation. The description + * will be displayed to the user. It should be thorough and concise for + * used in both tooltips and detailed views. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the provider property: The localized, friendly version of the resource provider name. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: The localized, friendly version of the resource provider name. + * + * @param provider the provider value to set. + * @return the Display object itself. + */ + public Display withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: The localized, friendly version of the resource type related to this action or + * operation; the resource type should match the public documentation for the resource provider. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: The localized, friendly version of the resource type related to this action or + * operation; the resource type should match the public documentation for the resource provider. + * + * @param resource the resource value to set. + * @return the Display object itself. + */ + public Display withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: The localized, friendly name for the operation. Use the name as it will displayed to + * the user. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: The localized, friendly name for the operation. Use the name as it will displayed to + * the user. + * + * @param operation the operation value to set. + * @return the Display object itself. + */ + public Display withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: The localized, friendly description for the operation. The description will be + * displayed to the user. It should be thorough and concise for used in both tooltips and detailed views. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The localized, friendly description for the operation. The description will be + * displayed to the user. It should be thorough and concise for used in both tooltips and detailed views. + * + * @param description the description value to set. + * @return the Display object itself. + */ + public Display withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ExtendedProduct.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ExtendedProduct.java new file mode 100644 index 0000000000000..bf07e51282f96 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ExtendedProduct.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.models; + +import com.azure.resourcemanager.azurestack.fluent.models.ExtendedProductInner; +import java.util.List; + +/** An immutable client-side representation of ExtendedProduct. */ +public interface ExtendedProduct { + /** + * Gets the galleryPackageBlobSasUri property: The URI to the .azpkg file that provides information required for + * showing product in the gallery. + * + * @return the galleryPackageBlobSasUri value. + */ + String galleryPackageBlobSasUri(); + + /** + * Gets the productKind property: Specifies the kind of the product (virtualMachine or virtualMachineExtension). + * + * @return the productKind value. + */ + String productKind(); + + /** + * Gets the computeRole property: Specifies kind of compute role included in the package. + * + * @return the computeRole value. + */ + ComputeRole computeRole(); + + /** + * Gets the isSystemExtension property: Specifies if product is a Virtual Machine Extension. + * + * @return the isSystemExtension value. + */ + Boolean isSystemExtension(); + + /** + * Gets the supportMultipleExtensions property: Indicates if specified product supports multiple extensions. + * + * @return the supportMultipleExtensions value. + */ + Boolean supportMultipleExtensions(); + + /** + * Gets the versionPropertiesVersion property: Specifies product version. + * + * @return the versionPropertiesVersion value. + */ + String versionPropertiesVersion(); + + /** + * Gets the vmOsType property: Specifies operating system used by the product. + * + * @return the vmOsType value. + */ + OperatingSystem vmOsType(); + + /** + * Gets the vmScaleSetEnabled property: Indicates if virtual machine Scale Set is enabled in the specified product. + * + * @return the vmScaleSetEnabled value. + */ + Boolean vmScaleSetEnabled(); + + /** + * Gets the uri property: The URI. + * + * @return the uri value. + */ + String uri(); + + /** + * Gets the version property: Specifies product version. + * + * @return the version value. + */ + String version(); + + /** + * Gets the osDiskImage property: OS disk image used by product. + * + * @return the osDiskImage value. + */ + OsDiskImage osDiskImage(); + + /** + * Gets the dataDiskImages property: List of attached data disks. + * + * @return the dataDiskImages value. + */ + List dataDiskImages(); + + /** + * Gets the inner com.azure.resourcemanager.azurestack.fluent.models.ExtendedProductInner object. + * + * @return the inner object. + */ + ExtendedProductInner innerModel(); +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ExtendedProductProperties.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ExtendedProductProperties.java new file mode 100644 index 0000000000000..06febb9f96722 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ExtendedProductProperties.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.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; +import java.util.List; + +/** Product information. */ +@Immutable +public final class ExtendedProductProperties extends VirtualMachineExtensionProductProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExtendedProductProperties.class); + + /* + * Specifies product version. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * OS disk image used by product. + */ + @JsonProperty(value = "osDiskImage", access = JsonProperty.Access.WRITE_ONLY) + private OsDiskImage osDiskImage; + + /* + * List of attached data disks. + */ + @JsonProperty(value = "dataDiskImages", access = JsonProperty.Access.WRITE_ONLY) + private List dataDiskImages; + + /** + * Get the version property: Specifies product version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the osDiskImage property: OS disk image used by product. + * + * @return the osDiskImage value. + */ + public OsDiskImage osDiskImage() { + return this.osDiskImage; + } + + /** + * Get the dataDiskImages property: List of attached data disks. + * + * @return the dataDiskImages value. + */ + public List dataDiskImages() { + return this.dataDiskImages; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (osDiskImage() != null) { + osDiskImage().validate(); + } + if (dataDiskImages() != null) { + dataDiskImages().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/IconUris.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/IconUris.java new file mode 100644 index 0000000000000..664545c9b1f5b --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/IconUris.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.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; + +/** Links to product icons. */ +@Fluent +public final class IconUris { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IconUris.class); + + /* + * URI to large icon. + */ + @JsonProperty(value = "large") + private String large; + + /* + * URI to wide icon. + */ + @JsonProperty(value = "wide") + private String wide; + + /* + * URI to medium icon. + */ + @JsonProperty(value = "medium") + private String medium; + + /* + * URI to small icon. + */ + @JsonProperty(value = "small") + private String small; + + /* + * URI to hero icon. + */ + @JsonProperty(value = "hero") + private String hero; + + /** + * Get the large property: URI to large icon. + * + * @return the large value. + */ + public String large() { + return this.large; + } + + /** + * Set the large property: URI to large icon. + * + * @param large the large value to set. + * @return the IconUris object itself. + */ + public IconUris withLarge(String large) { + this.large = large; + return this; + } + + /** + * Get the wide property: URI to wide icon. + * + * @return the wide value. + */ + public String wide() { + return this.wide; + } + + /** + * Set the wide property: URI to wide icon. + * + * @param wide the wide value to set. + * @return the IconUris object itself. + */ + public IconUris withWide(String wide) { + this.wide = wide; + return this; + } + + /** + * Get the medium property: URI to medium icon. + * + * @return the medium value. + */ + public String medium() { + return this.medium; + } + + /** + * Set the medium property: URI to medium icon. + * + * @param medium the medium value to set. + * @return the IconUris object itself. + */ + public IconUris withMedium(String medium) { + this.medium = medium; + return this; + } + + /** + * Get the small property: URI to small icon. + * + * @return the small value. + */ + public String small() { + return this.small; + } + + /** + * Set the small property: URI to small icon. + * + * @param small the small value to set. + * @return the IconUris object itself. + */ + public IconUris withSmall(String small) { + this.small = small; + return this; + } + + /** + * Get the hero property: URI to hero icon. + * + * @return the hero value. + */ + public String hero() { + return this.hero; + } + + /** + * Set the hero property: URI to hero icon. + * + * @param hero the hero value to set. + * @return the IconUris object itself. + */ + public IconUris withHero(String hero) { + this.hero = hero; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/LinkedSubscription.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/LinkedSubscription.java new file mode 100644 index 0000000000000..ed590e81611d2 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/LinkedSubscription.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestack.fluent.models.LinkedSubscriptionInner; +import java.util.Map; + +/** An immutable client-side representation of LinkedSubscription. */ +public interface LinkedSubscription { + /** + * 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 linkedSubscriptionId property: The identifier associated with the device subscription. + * + * @return the linkedSubscriptionId value. + */ + String linkedSubscriptionId(); + + /** + * Gets the registrationResourceId property: The identifier associated with the device registration. + * + * @return the registrationResourceId value. + */ + String registrationResourceId(); + + /** + * Gets the deviceId property: The identifier of the Azure Stack device for remote management. + * + * @return the deviceId value. + */ + String deviceId(); + + /** + * Gets the deviceObjectId property: The object identifier associated with the Azure Stack device connecting to + * Azure. + * + * @return the deviceObjectId value. + */ + String deviceObjectId(); + + /** + * Gets the deviceLinkState property: The connection state of the Azure Stack device. + * + * @return the deviceLinkState value. + */ + String deviceLinkState(); + + /** + * Gets the lastConnectedTime property: The last remote management connection time for the Azure Stack device + * connected to the linked subscription resource. + * + * @return the lastConnectedTime value. + */ + String lastConnectedTime(); + + /** + * Gets the deviceConnectionStatus property: The status of the remote management connection of the Azure Stack + * device. + * + * @return the deviceConnectionStatus value. + */ + String deviceConnectionStatus(); + + /** + * Gets the kind property: The kind of the resource. + * + * @return the kind value. + */ + String kind(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the etag property: The entity tag used for optimistic concurrency when modifying the resource. + * + * @return the etag value. + */ + String etag(); + + /** + * 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.azurestack.fluent.models.LinkedSubscriptionInner object. + * + * @return the inner object. + */ + LinkedSubscriptionInner innerModel(); + + /** The entirety of the LinkedSubscription definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithLinkedSubscriptionId, + DefinitionStages.WithRegistrationResourceId, + DefinitionStages.WithCreate { + } + /** The LinkedSubscription definition stages. */ + interface DefinitionStages { + /** The first stage of the LinkedSubscription definition. */ + interface Blank extends WithLocation { + } + /** The stage of the LinkedSubscription definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the location property: Location of the resource.. + * + * @param location Location of the resource. + * @return the next definition stage. + */ + WithResourceGroup withLocation(Location location); + } + /** The stage of the LinkedSubscription definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroup. + * + * @param resourceGroup Name of the resource group. + * @return the next definition stage. + */ + WithLinkedSubscriptionId withExistingResourceGroup(String resourceGroup); + } + /** The stage of the LinkedSubscription definition allowing to specify linkedSubscriptionId. */ + interface WithLinkedSubscriptionId { + /** + * Specifies the linkedSubscriptionId property: The identifier associated with the device subscription.. + * + * @param linkedSubscriptionId The identifier associated with the device subscription. + * @return the next definition stage. + */ + WithRegistrationResourceId withLinkedSubscriptionId(String linkedSubscriptionId); + } + /** The stage of the LinkedSubscription definition allowing to specify registrationResourceId. */ + interface WithRegistrationResourceId { + /** + * Specifies the registrationResourceId property: The identifier associated with the device registration.. + * + * @param registrationResourceId The identifier associated with the device registration. + * @return the next definition stage. + */ + WithCreate withRegistrationResourceId(String registrationResourceId); + } + /** + * The stage of the LinkedSubscription 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + LinkedSubscription create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + LinkedSubscription create(Context context); + } + } + /** + * Begins update for the LinkedSubscription resource. + * + * @return the stage of resource update. + */ + LinkedSubscription.Update update(); + + /** The template for LinkedSubscription update. */ + interface Update extends UpdateStages.WithLinkedSubscriptionId, UpdateStages.WithRegistrationResourceId { + /** + * Executes the update request. + * + * @return the updated resource. + */ + LinkedSubscription apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + LinkedSubscription apply(Context context); + } + /** The LinkedSubscription update stages. */ + interface UpdateStages { + /** The stage of the LinkedSubscription update allowing to specify linkedSubscriptionId. */ + interface WithLinkedSubscriptionId { + /** + * Specifies the linkedSubscriptionId property: The identifier associated with the device subscription.. + * + * @param linkedSubscriptionId The identifier associated with the device subscription. + * @return the next definition stage. + */ + Update withLinkedSubscriptionId(String linkedSubscriptionId); + } + /** The stage of the LinkedSubscription update allowing to specify registrationResourceId. */ + interface WithRegistrationResourceId { + /** + * Specifies the registrationResourceId property: The identifier associated with the device registration.. + * + * @param registrationResourceId The identifier associated with the device registration. + * @return the next definition stage. + */ + Update withRegistrationResourceId(String registrationResourceId); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + LinkedSubscription refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + LinkedSubscription refresh(Context context); +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/LinkedSubscriptionParameter.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/LinkedSubscriptionParameter.java new file mode 100644 index 0000000000000..cc85602cd0d76 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/LinkedSubscriptionParameter.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Linked Subscription resource. */ +@JsonFlatten +@Fluent +public class LinkedSubscriptionParameter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LinkedSubscriptionParameter.class); + + /* + * Location of the resource. + */ + @JsonProperty(value = "location", required = true) + private Location location; + + /* + * The identifier associated with the device subscription. + */ + @JsonProperty(value = "properties.linkedSubscriptionId", required = true) + private String linkedSubscriptionId; + + /* + * The identifier associated with the device registration. + */ + @JsonProperty(value = "properties.registrationResourceId", required = true) + private String registrationResourceId; + + /** + * Get the location property: Location of the resource. + * + * @return the location value. + */ + public Location location() { + return this.location; + } + + /** + * Set the location property: Location of the resource. + * + * @param location the location value to set. + * @return the LinkedSubscriptionParameter object itself. + */ + public LinkedSubscriptionParameter withLocation(Location location) { + this.location = location; + return this; + } + + /** + * Get the linkedSubscriptionId property: The identifier associated with the device subscription. + * + * @return the linkedSubscriptionId value. + */ + public String linkedSubscriptionId() { + return this.linkedSubscriptionId; + } + + /** + * Set the linkedSubscriptionId property: The identifier associated with the device subscription. + * + * @param linkedSubscriptionId the linkedSubscriptionId value to set. + * @return the LinkedSubscriptionParameter object itself. + */ + public LinkedSubscriptionParameter withLinkedSubscriptionId(String linkedSubscriptionId) { + this.linkedSubscriptionId = linkedSubscriptionId; + return this; + } + + /** + * Get the registrationResourceId property: The identifier associated with the device registration. + * + * @return the registrationResourceId value. + */ + public String registrationResourceId() { + return this.registrationResourceId; + } + + /** + * Set the registrationResourceId property: The identifier associated with the device registration. + * + * @param registrationResourceId the registrationResourceId value to set. + * @return the LinkedSubscriptionParameter object itself. + */ + public LinkedSubscriptionParameter withRegistrationResourceId(String registrationResourceId) { + this.registrationResourceId = registrationResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (location() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property location in model LinkedSubscriptionParameter")); + } + if (linkedSubscriptionId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property linkedSubscriptionId in model LinkedSubscriptionParameter")); + } + if (registrationResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property registrationResourceId in model LinkedSubscriptionParameter")); + } + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/LinkedSubscriptions.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/LinkedSubscriptions.java new file mode 100644 index 0000000000000..3e24971597579 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/LinkedSubscriptions.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.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 LinkedSubscriptions. */ +public interface LinkedSubscriptions { + /** + * Returns a list of all linked subscriptions under current resource group. + * + * @param resourceGroup Name of the resource group. + * @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 list of linked subscriptions with paging support. + */ + PagedIterable listByResourceGroup(String resourceGroup); + + /** + * Returns a list of all linked subscriptions under current resource group. + * + * @param resourceGroup Name of the resource group. + * @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 list of linked subscriptions with paging support. + */ + PagedIterable listByResourceGroup(String resourceGroup, Context context); + + /** + * Returns a list of all linked subscriptions under current 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 list of linked subscriptions with paging support. + */ + PagedIterable list(); + + /** + * Returns a list of all linked subscriptions under current 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 list of linked subscriptions with paging support. + */ + PagedIterable list(Context context); + + /** + * Returns the properties of a Linked Subscription resource. + * + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription 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 linked Subscription information. + */ + LinkedSubscription getByResourceGroup(String resourceGroup, String linkedSubscriptionName); + + /** + * Returns the properties of a Linked Subscription resource. + * + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription 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 linked Subscription information. + */ + Response getByResourceGroupWithResponse( + String resourceGroup, String linkedSubscriptionName, Context context); + + /** + * Delete the requested Linked Subscription resource. + * + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription 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 deleteByResourceGroup(String resourceGroup, String linkedSubscriptionName); + + /** + * Delete the requested Linked Subscription resource. + * + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription 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 response. + */ + Response deleteWithResponse(String resourceGroup, String linkedSubscriptionName, Context context); + + /** + * Returns the properties of a Linked Subscription resource. + * + * @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 linked Subscription information. + */ + LinkedSubscription getById(String id); + + /** + * Returns the properties of a Linked Subscription resource. + * + * @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 linked Subscription information. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the requested Linked Subscription resource. + * + * @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 the requested Linked Subscription resource. + * + * @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 the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new LinkedSubscription resource. + * + * @param name resource name. + * @return the first stage of the new LinkedSubscription definition. + */ + LinkedSubscription.DefinitionStages.Blank define(String name); +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/LinkedSubscriptionsList.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/LinkedSubscriptionsList.java new file mode 100644 index 0000000000000..1e38a09ffdaa8 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/LinkedSubscriptionsList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestack.fluent.models.LinkedSubscriptionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of linked subscriptions with paging support. */ +@Fluent +public final class LinkedSubscriptionsList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LinkedSubscriptionsList.class); + + /* + * URI to the next page. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * List of Linked Subscriptions + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the nextLink property: URI to the next page. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URI to the next page. + * + * @param nextLink the nextLink value to set. + * @return the LinkedSubscriptionsList object itself. + */ + public LinkedSubscriptionsList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: List of Linked Subscriptions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Linked Subscriptions. + * + * @param value the value value to set. + * @return the LinkedSubscriptionsList object itself. + */ + public LinkedSubscriptionsList withValue(List value) { + this.value = value; + 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/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Location.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Location.java new file mode 100644 index 0000000000000..4c37162bfd2e8 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Location.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.azurestack.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Location. */ +public final class Location extends ExpandableStringEnum { + /** Static value global for Location. */ + public static final Location GLOBAL = fromString("global"); + + /** + * Creates or finds a Location from its string representation. + * + * @param name a name to look for. + * @return the corresponding Location. + */ + @JsonCreator + public static Location fromString(String name) { + return fromString(name, Location.class); + } + + /** @return known Location values. */ + public static Collection values() { + return values(Location.class); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/MarketplaceProductLogUpdate.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/MarketplaceProductLogUpdate.java new file mode 100644 index 0000000000000..fca64ec17fa5d --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/MarketplaceProductLogUpdate.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.azurestack.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; + +/** Update details for product log. */ +@Immutable +public final class MarketplaceProductLogUpdate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MarketplaceProductLogUpdate.class); + + /* + * Operation to log. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /* + * Operation status to log. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /* + * Error related to the operation. + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private String error; + + /* + * Error details related to operation. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private String details; + + /** + * Get the operation property: Operation to log. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the status property: Operation status to log. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the error property: Error related to the operation. + * + * @return the error value. + */ + public String error() { + return this.error; + } + + /** + * Get the details property: Error details related to operation. + * + * @return the details value. + */ + public String details() { + return this.details; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/OperatingSystem.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/OperatingSystem.java new file mode 100644 index 0000000000000..c18aa793f041f --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/OperatingSystem.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OperatingSystem. */ +public final class OperatingSystem extends ExpandableStringEnum { + /** Static value None for OperatingSystem. */ + public static final OperatingSystem NONE = fromString("None"); + + /** Static value Windows for OperatingSystem. */ + public static final OperatingSystem WINDOWS = fromString("Windows"); + + /** Static value Linux for OperatingSystem. */ + public static final OperatingSystem LINUX = fromString("Linux"); + + /** + * Creates or finds a OperatingSystem from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperatingSystem. + */ + @JsonCreator + public static OperatingSystem fromString(String name) { + return fromString(name, OperatingSystem.class); + } + + /** @return known OperatingSystem values. */ + public static Collection values() { + return values(OperatingSystem.class); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Operation.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Operation.java new file mode 100644 index 0000000000000..0e732bfa0d2ad --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Operation.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.models; + +import com.azure.resourcemanager.azurestack.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: The name of the operation being performed on this particular object. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: Contains the localized display information for this particular operation or action. + * + * @return the display value. + */ + Display display(); + + /** + * Gets the origin property: The intended executor of the operation. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the inner com.azure.resourcemanager.azurestack.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/OperationList.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/OperationList.java new file mode 100644 index 0000000000000..7e4b41bc1d4ab --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/OperationList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestack.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Operations. */ +@Fluent +public final class OperationList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationList.class); + + /* + * Array of operations + */ + @JsonProperty(value = "value") + private List value; + + /* + * URI to the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Array of operations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of operations. + * + * @param value the value value to set. + * @return the OperationList object itself. + */ + public OperationList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URI to the next page of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URI to the next page of operations. + * + * @param nextLink the nextLink value to set. + * @return the OperationList object itself. + */ + public OperationList 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/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Operations.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Operations.java new file mode 100644 index 0000000000000..649b3eb660f14 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/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.azurestack.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Returns the list of supported REST 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 list of Operations. + */ + PagedIterable list(); + + /** + * Returns the list of supported REST 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 list of Operations. + */ + PagedIterable list(Context context); +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/OsDiskImage.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/OsDiskImage.java new file mode 100644 index 0000000000000..1bb9086f456b9 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/OsDiskImage.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.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; + +/** OS disk image. */ +@Immutable +public final class OsDiskImage { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OsDiskImage.class); + + /* + * OS operating system type. + */ + @JsonProperty(value = "operatingSystem", access = JsonProperty.Access.WRITE_ONLY) + private OperatingSystem operatingSystem; + + /* + * SAS key for source blob. + */ + @JsonProperty(value = "sourceBlobSasUri", access = JsonProperty.Access.WRITE_ONLY) + private String sourceBlobSasUri; + + /** + * Get the operatingSystem property: OS operating system type. + * + * @return the operatingSystem value. + */ + public OperatingSystem operatingSystem() { + return this.operatingSystem; + } + + /** + * Get the sourceBlobSasUri property: SAS key for source blob. + * + * @return the sourceBlobSasUri value. + */ + public String sourceBlobSasUri() { + return this.sourceBlobSasUri; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Product.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Product.java new file mode 100644 index 0000000000000..3c0d32eff85a9 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Product.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.models; + +import com.azure.resourcemanager.azurestack.fluent.models.ProductInner; +import java.util.List; + +/** An immutable client-side representation of Product. */ +public interface Product { + /** + * 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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the displayName property: The display name of the product. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the description property: The description of the product. + * + * @return the description value. + */ + String description(); + + /** + * Gets the publisherDisplayName property: The user-friendly name of the product publisher. + * + * @return the publisherDisplayName value. + */ + String publisherDisplayName(); + + /** + * Gets the publisherIdentifier property: Publisher identifier. + * + * @return the publisherIdentifier value. + */ + String publisherIdentifier(); + + /** + * Gets the offer property: The offer representing the product. + * + * @return the offer value. + */ + String offer(); + + /** + * Gets the offerVersion property: The version of the product offer. + * + * @return the offerVersion value. + */ + String offerVersion(); + + /** + * Gets the sku property: The product SKU. + * + * @return the sku value. + */ + String sku(); + + /** + * Gets the billingPartNumber property: The part number used for billing purposes. + * + * @return the billingPartNumber value. + */ + String billingPartNumber(); + + /** + * Gets the vmExtensionType property: The type of the Virtual Machine Extension. + * + * @return the vmExtensionType value. + */ + String vmExtensionType(); + + /** + * Gets the galleryItemIdentity property: The identifier of the gallery item corresponding to the product. + * + * @return the galleryItemIdentity value. + */ + String galleryItemIdentity(); + + /** + * Gets the iconUris property: Additional links available for this product. + * + * @return the iconUris value. + */ + IconUris iconUris(); + + /** + * Gets the links property: Additional links available for this product. + * + * @return the links value. + */ + List links(); + + /** + * Gets the legalTerms property: The legal terms. + * + * @return the legalTerms value. + */ + String legalTerms(); + + /** + * Gets the privacyPolicy property: The privacy policy. + * + * @return the privacyPolicy value. + */ + String privacyPolicy(); + + /** + * Gets the payloadLength property: The length of product content. + * + * @return the payloadLength value. + */ + Long payloadLength(); + + /** + * Gets the productKind property: The kind of the product (virtualMachine or virtualMachineExtension). + * + * @return the productKind value. + */ + String productKind(); + + /** + * Gets the productProperties property: Additional properties for the product. + * + * @return the productProperties value. + */ + ProductProperties productProperties(); + + /** + * Gets the compatibility property: Product compatibility with current device. + * + * @return the compatibility value. + */ + Compatibility compatibility(); + + /** + * Gets the etag property: The entity tag used for optimistic concurrency when modifying the resource. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the inner com.azure.resourcemanager.azurestack.fluent.models.ProductInner object. + * + * @return the inner object. + */ + ProductInner innerModel(); +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ProductLink.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ProductLink.java new file mode 100644 index 0000000000000..34c3bb4f6c87a --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ProductLink.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.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; + +/** Link with additional information about a product. */ +@Fluent +public final class ProductLink { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProductLink.class); + + /* + * The description of the link. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * The URI corresponding to the link. + */ + @JsonProperty(value = "uri") + private String uri; + + /** + * Get the displayName property: The description of the link. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The description of the link. + * + * @param displayName the displayName value to set. + * @return the ProductLink object itself. + */ + public ProductLink withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the uri property: The URI corresponding to the link. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: The URI corresponding to the link. + * + * @param uri the uri value to set. + * @return the ProductLink object itself. + */ + public ProductLink withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ProductList.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ProductList.java new file mode 100644 index 0000000000000..1e85903a6ff91 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ProductList.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.models; + +import com.azure.resourcemanager.azurestack.fluent.models.ProductListInner; +import java.util.List; + +/** An immutable client-side representation of ProductList. */ +public interface ProductList { + /** + * Gets the nextLink property: URI to the next page. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the value property: List of products. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.azurestack.fluent.models.ProductListInner object. + * + * @return the inner object. + */ + ProductListInner innerModel(); +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ProductLog.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ProductLog.java new file mode 100644 index 0000000000000..11eb7def90802 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ProductLog.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.models; + +import com.azure.resourcemanager.azurestack.fluent.models.ProductLogInner; + +/** An immutable client-side representation of ProductLog. */ +public interface ProductLog { + /** + * Gets the id property: Log ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the productId property: Logged product ID. + * + * @return the productId value. + */ + String productId(); + + /** + * Gets the subscriptionId property: Logged subscription ID. + * + * @return the subscriptionId value. + */ + String subscriptionId(); + + /** + * Gets the registrationName property: Logged registration name. + * + * @return the registrationName value. + */ + String registrationName(); + + /** + * Gets the resourceGroupName property: Logged resource group name. + * + * @return the resourceGroupName value. + */ + String resourceGroupName(); + + /** + * Gets the operation property: Logged operation. + * + * @return the operation value. + */ + String operation(); + + /** + * Gets the startDate property: Operation start datetime. + * + * @return the startDate value. + */ + String startDate(); + + /** + * Gets the endDate property: Operation end datetime. + * + * @return the endDate value. + */ + String endDate(); + + /** + * Gets the status property: Operation status. + * + * @return the status value. + */ + String status(); + + /** + * Gets the error property: Operation error data. + * + * @return the error value. + */ + String error(); + + /** + * Gets the details property: Operation error details. + * + * @return the details value. + */ + String details(); + + /** + * Gets the inner com.azure.resourcemanager.azurestack.fluent.models.ProductLogInner object. + * + * @return the inner object. + */ + ProductLogInner innerModel(); +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ProductProperties.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ProductProperties.java new file mode 100644 index 0000000000000..31cd68b7c5631 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ProductProperties.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.azurestack.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; + +/** Additional properties of the product. */ +@Fluent +public final class ProductProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProductProperties.class); + + /* + * The version. + */ + @JsonProperty(value = "version") + private String version; + + /** + * Get the version property: The version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The version. + * + * @param version the version value to set. + * @return the ProductProperties object itself. + */ + public ProductProperties withVersion(String version) { + this.version = version; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Products.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Products.java new file mode 100644 index 0000000000000..0c9a79d97c4c7 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Products.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.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 Products. */ +public interface Products { + /** + * Returns a list of products. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 pageable list of products. + */ + PagedIterable list(String resourceGroup, String registrationName); + + /** + * Returns a list of products. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 pageable list of products. + */ + PagedIterable list(String resourceGroup, String registrationName, Context context); + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 product information. + */ + Product get(String resourceGroup, String registrationName, String productName); + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 product information. + */ + Response getWithResponse( + String resourceGroup, String registrationName, String productName, Context context); + + /** + * Returns the extended properties of a product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 extended description about the product required for installing it into Azure Stack. + */ + ExtendedProduct listDetails(String resourceGroup, String registrationName, String productName); + + /** + * Returns the extended properties of a product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 extended description about the product required for installing it into Azure Stack. + */ + Response listDetailsWithResponse( + String resourceGroup, String registrationName, String productName, Context context); + + /** + * Returns a list of products. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 pageable list of products. + */ + ProductList getProducts(String resourceGroup, String registrationName, String productName); + + /** + * Returns a list of products. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @param deviceConfiguration Device configuration. + * @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 pageable list of products. + */ + Response getProductsWithResponse( + String resourceGroup, + String registrationName, + String productName, + DeviceConfiguration deviceConfiguration, + Context context); + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 product information. + */ + Product getProduct(String resourceGroup, String registrationName, String productName); + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @param deviceConfiguration Device configuration. + * @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 product information. + */ + Response getProductWithResponse( + String resourceGroup, + String registrationName, + String productName, + DeviceConfiguration deviceConfiguration, + Context context); + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 product action log. + */ + ProductLog uploadLog(String resourceGroup, String registrationName, String productName); + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @param marketplaceProductLogUpdate Update details for product log. + * @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 product action log. + */ + Response uploadLogWithResponse( + String resourceGroup, + String registrationName, + String productName, + MarketplaceProductLogUpdate marketplaceProductLogUpdate, + Context context); +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ProvisioningState.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ProvisioningState.java new file mode 100644 index 0000000000000..063d53c707b38 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ProvisioningState.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ProvisioningState. */ +public enum ProvisioningState { + /** Enum value Creating. */ + CREATING("Creating"), + + /** Enum value Failed. */ + FAILED("Failed"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Canceled. */ + CANCELED("Canceled"); + + /** The actual serialized value for a ProvisioningState instance. */ + private final String value; + + ProvisioningState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ProvisioningState instance. + * + * @param value the serialized value to parse. + * @return the parsed ProvisioningState object, or null if unable to parse. + */ + @JsonCreator + public static ProvisioningState fromString(String value) { + ProvisioningState[] items = ProvisioningState.values(); + for (ProvisioningState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Registration.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Registration.java new file mode 100644 index 0000000000000..bdb2aea1cd37b --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Registration.java @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestack.fluent.models.RegistrationInner; +import java.util.Map; + +/** An immutable client-side representation of Registration. */ +public interface Registration { + /** + * 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 objectId property: The object identifier associated with the Azure Stack connecting to Azure. + * + * @return the objectId value. + */ + String objectId(); + + /** + * Gets the cloudId property: The identifier of the registered Azure Stack. + * + * @return the cloudId value. + */ + String cloudId(); + + /** + * Gets the billingModel property: Specifies the billing mode for the Azure Stack registration. + * + * @return the billingModel value. + */ + String billingModel(); + + /** + * Gets the kind property: The kind of the resource. + * + * @return the kind value. + */ + String kind(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the etag property: The entity tag used for optimistic concurrency when modifying the resource. + * + * @return the etag value. + */ + String etag(); + + /** + * 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.azurestack.fluent.models.RegistrationInner object. + * + * @return the inner object. + */ + RegistrationInner innerModel(); + + /** The entirety of the Registration definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithRegistrationToken, + DefinitionStages.WithCreate { + } + /** The Registration definition stages. */ + interface DefinitionStages { + /** The first stage of the Registration definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Registration definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the location property: Location of the resource.. + * + * @param location Location of the resource. + * @return the next definition stage. + */ + WithResourceGroup withLocation(Location location); + } + /** The stage of the Registration definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroup. + * + * @param resourceGroup Name of the resource group. + * @return the next definition stage. + */ + WithRegistrationToken withExistingResourceGroup(String resourceGroup); + } + /** The stage of the Registration definition allowing to specify registrationToken. */ + interface WithRegistrationToken { + /** + * Specifies the registrationToken property: The token identifying registered Azure Stack. + * + * @param registrationToken The token identifying registered Azure Stack. + * @return the next definition stage. + */ + WithCreate withRegistrationToken(String registrationToken); + } + /** + * The stage of the Registration 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + Registration create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Registration create(Context context); + } + } + /** + * Begins update for the Registration resource. + * + * @return the stage of resource update. + */ + Registration.Update update(); + + /** The template for Registration update. */ + interface Update extends UpdateStages.WithRegistrationToken { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Registration apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Registration apply(Context context); + } + /** The Registration update stages. */ + interface UpdateStages { + /** The stage of the Registration update allowing to specify registrationToken. */ + interface WithRegistrationToken { + /** + * Specifies the registrationToken property: The token identifying registered Azure Stack. + * + * @param registrationToken The token identifying registered Azure Stack. + * @return the next definition stage. + */ + Update withRegistrationToken(String registrationToken); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Registration refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Registration refresh(Context context); + + /** + * Returns Azure Stack Activation Key. + * + * @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 resource containing the Azure Stack activation key. + */ + ActivationKeyResult getActivationKey(); + + /** + * Returns Azure Stack Activation Key. + * + * @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 resource containing the Azure Stack activation key. + */ + Response getActivationKeyWithResponse(Context context); + + /** + * Enables remote management for device under the Azure Stack registration. + * + * @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 enableRemoteManagement(); + + /** + * Enables remote management for device under the Azure Stack registration. + * + * @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 response. + */ + Response enableRemoteManagementWithResponse(Context context); +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/RegistrationList.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/RegistrationList.java new file mode 100644 index 0000000000000..4755525e402a0 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/RegistrationList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestack.fluent.models.RegistrationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Pageable list of registrations. */ +@Fluent +public final class RegistrationList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegistrationList.class); + + /* + * URI to the next page. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * List of Registrations + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the nextLink property: URI to the next page. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URI to the next page. + * + * @param nextLink the nextLink value to set. + * @return the RegistrationList object itself. + */ + public RegistrationList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: List of Registrations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Registrations. + * + * @param value the value value to set. + * @return the RegistrationList object itself. + */ + public RegistrationList withValue(List value) { + this.value = value; + 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/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/RegistrationParameter.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/RegistrationParameter.java new file mode 100644 index 0000000000000..1b5a91f04e1ab --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/RegistrationParameter.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Registration resource. */ +@JsonFlatten +@Fluent +public class RegistrationParameter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegistrationParameter.class); + + /* + * Location of the resource. + */ + @JsonProperty(value = "location", required = true) + private Location location; + + /* + * The token identifying registered Azure Stack + */ + @JsonProperty(value = "properties.registrationToken", required = true) + private String registrationToken; + + /** + * Get the location property: Location of the resource. + * + * @return the location value. + */ + public Location location() { + return this.location; + } + + /** + * Set the location property: Location of the resource. + * + * @param location the location value to set. + * @return the RegistrationParameter object itself. + */ + public RegistrationParameter withLocation(Location location) { + this.location = location; + return this; + } + + /** + * Get the registrationToken property: The token identifying registered Azure Stack. + * + * @return the registrationToken value. + */ + public String registrationToken() { + return this.registrationToken; + } + + /** + * Set the registrationToken property: The token identifying registered Azure Stack. + * + * @param registrationToken the registrationToken value to set. + * @return the RegistrationParameter object itself. + */ + public RegistrationParameter withRegistrationToken(String registrationToken) { + this.registrationToken = registrationToken; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (location() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property location in model RegistrationParameter")); + } + if (registrationToken() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property registrationToken in model RegistrationParameter")); + } + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Registrations.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Registrations.java new file mode 100644 index 0000000000000..0f4b81ae0c207 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/Registrations.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.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 Registrations. */ +public interface Registrations { + /** + * Returns a list of all registrations. + * + * @param resourceGroup Name of the resource group. + * @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 pageable list of registrations. + */ + PagedIterable listByResourceGroup(String resourceGroup); + + /** + * Returns a list of all registrations. + * + * @param resourceGroup Name of the resource group. + * @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 pageable list of registrations. + */ + PagedIterable listByResourceGroup(String resourceGroup, Context context); + + /** + * Returns the properties of an Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 registration information. + */ + Registration getByResourceGroup(String resourceGroup, String registrationName); + + /** + * Returns the properties of an Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 registration information. + */ + Response getByResourceGroupWithResponse( + String resourceGroup, String registrationName, Context context); + + /** + * Delete the requested Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 resourceGroup, String registrationName); + + /** + * Delete the requested Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 response. + */ + Response deleteWithResponse(String resourceGroup, String registrationName, Context context); + + /** + * Returns Azure Stack Activation Key. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 resource containing the Azure Stack activation key. + */ + ActivationKeyResult getActivationKey(String resourceGroup, String registrationName); + + /** + * Returns Azure Stack Activation Key. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 resource containing the Azure Stack activation key. + */ + Response getActivationKeyWithResponse( + String resourceGroup, String registrationName, Context context); + + /** + * Enables remote management for device under the Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 enableRemoteManagement(String resourceGroup, String registrationName); + + /** + * Enables remote management for device under the Azure Stack registration. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @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 response. + */ + Response enableRemoteManagementWithResponse(String resourceGroup, String registrationName, Context context); + + /** + * Returns the properties of an Azure Stack registration. + * + * @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 registration information. + */ + Registration getById(String id); + + /** + * Returns the properties of an Azure Stack registration. + * + * @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 registration information. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the requested Azure Stack registration. + * + * @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 the requested Azure Stack registration. + * + * @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 the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Registration resource. + * + * @param name resource name. + * @return the first stage of the new Registration definition. + */ + Registration.DefinitionStages.Blank define(String name); +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/SystemData.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/SystemData.java new file mode 100644 index 0000000000000..f42be13d49137 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/SystemData.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.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.time.OffsetDateTime; + +/** Metadata pertaining to creation and last modification of the resource. */ +@Fluent +public final class SystemData { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SystemData.class); + + /* + * The identity that created the resource. + */ + @JsonProperty(value = "createdBy") + private String createdBy; + + /* + * The type of identity that created the resource. + */ + @JsonProperty(value = "createdByType") + private CreatedByType createdByType; + + /* + * The timestamp of resource creation (UTC). + */ + @JsonProperty(value = "createdAt") + private OffsetDateTime createdAt; + + /* + * The identity that last modified the resource. + */ + @JsonProperty(value = "lastModifiedBy") + private String lastModifiedBy; + + /* + * The type of identity that last modified the resource. + */ + @JsonProperty(value = "lastModifiedByType") + private CreatedByType lastModifiedByType; + + /* + * The type of identity that last modified the resource. + */ + @JsonProperty(value = "lastModifiedAt") + private OffsetDateTime lastModifiedAt; + + /** + * Get the createdBy property: The identity that created the resource. + * + * @return the createdBy value. + */ + public String createdBy() { + return this.createdBy; + } + + /** + * Set the createdBy property: The identity that created the resource. + * + * @param createdBy the createdBy value to set. + * @return the SystemData object itself. + */ + public SystemData withCreatedBy(String createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * Get the createdByType property: The type of identity that created the resource. + * + * @return the createdByType value. + */ + public CreatedByType createdByType() { + return this.createdByType; + } + + /** + * Set the createdByType property: The type of identity that created the resource. + * + * @param createdByType the createdByType value to set. + * @return the SystemData object itself. + */ + public SystemData withCreatedByType(CreatedByType createdByType) { + this.createdByType = createdByType; + return this; + } + + /** + * Get the createdAt property: The timestamp of resource creation (UTC). + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.createdAt; + } + + /** + * Set the createdAt property: The timestamp of resource creation (UTC). + * + * @param createdAt the createdAt value to set. + * @return the SystemData object itself. + */ + public SystemData withCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get the lastModifiedBy property: The identity that last modified the resource. + * + * @return the lastModifiedBy value. + */ + public String lastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * Set the lastModifiedBy property: The identity that last modified the resource. + * + * @param lastModifiedBy the lastModifiedBy value to set. + * @return the SystemData object itself. + */ + public SystemData withLastModifiedBy(String lastModifiedBy) { + this.lastModifiedBy = lastModifiedBy; + return this; + } + + /** + * Get the lastModifiedByType property: The type of identity that last modified the resource. + * + * @return the lastModifiedByType value. + */ + public CreatedByType lastModifiedByType() { + return this.lastModifiedByType; + } + + /** + * Set the lastModifiedByType property: The type of identity that last modified the resource. + * + * @param lastModifiedByType the lastModifiedByType value to set. + * @return the SystemData object itself. + */ + public SystemData withLastModifiedByType(CreatedByType lastModifiedByType) { + this.lastModifiedByType = lastModifiedByType; + return this; + } + + /** + * Get the lastModifiedAt property: The type of identity that last modified the resource. + * + * @return the lastModifiedAt value. + */ + public OffsetDateTime lastModifiedAt() { + return this.lastModifiedAt; + } + + /** + * Set the lastModifiedAt property: The type of identity that last modified the resource. + * + * @param lastModifiedAt the lastModifiedAt value to set. + * @return the SystemData object itself. + */ + public SystemData withLastModifiedAt(OffsetDateTime lastModifiedAt) { + this.lastModifiedAt = lastModifiedAt; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/VirtualMachineExtensionProductProperties.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/VirtualMachineExtensionProductProperties.java new file mode 100644 index 0000000000000..09b34d9934734 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/VirtualMachineExtensionProductProperties.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Product information. */ +@JsonFlatten +@Immutable +public class VirtualMachineExtensionProductProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineExtensionProductProperties.class); + + /* + * Specifies kind of compute role included in the package. + */ + @JsonProperty(value = "computeRole", access = JsonProperty.Access.WRITE_ONLY) + private ComputeRole computeRole; + + /* + * Specifies if product is a Virtual Machine Extension. + */ + @JsonProperty(value = "isSystemExtension", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isSystemExtension; + + /* + * Indicates if specified product supports multiple extensions. + */ + @JsonProperty(value = "supportMultipleExtensions", access = JsonProperty.Access.WRITE_ONLY) + private Boolean supportMultipleExtensions; + + /* + * Specifies product version. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * Specifies operating system used by the product. + */ + @JsonProperty(value = "vmOsType", access = JsonProperty.Access.WRITE_ONLY) + private OperatingSystem vmOsType; + + /* + * Indicates if virtual machine Scale Set is enabled in the specified + * product. + */ + @JsonProperty(value = "vmScaleSetEnabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean vmScaleSetEnabled; + + /* + * The URI. + */ + @JsonProperty(value = "sourceBlob.uri", access = JsonProperty.Access.WRITE_ONLY) + private String uri; + + /** + * Get the computeRole property: Specifies kind of compute role included in the package. + * + * @return the computeRole value. + */ + public ComputeRole computeRole() { + return this.computeRole; + } + + /** + * Get the isSystemExtension property: Specifies if product is a Virtual Machine Extension. + * + * @return the isSystemExtension value. + */ + public Boolean isSystemExtension() { + return this.isSystemExtension; + } + + /** + * Get the supportMultipleExtensions property: Indicates if specified product supports multiple extensions. + * + * @return the supportMultipleExtensions value. + */ + public Boolean supportMultipleExtensions() { + return this.supportMultipleExtensions; + } + + /** + * Get the version property: Specifies product version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the vmOsType property: Specifies operating system used by the product. + * + * @return the vmOsType value. + */ + public OperatingSystem vmOsType() { + return this.vmOsType; + } + + /** + * Get the vmScaleSetEnabled property: Indicates if virtual machine Scale Set is enabled in the specified product. + * + * @return the vmScaleSetEnabled value. + */ + public Boolean vmScaleSetEnabled() { + return this.vmScaleSetEnabled; + } + + /** + * Get the uri property: The URI. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/VirtualMachineProductProperties.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/VirtualMachineProductProperties.java new file mode 100644 index 0000000000000..f9fd3d6ceecc3 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/VirtualMachineProductProperties.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestack.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; +import java.util.List; + +/** Product information. */ +@Immutable +public class VirtualMachineProductProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineProductProperties.class); + + /* + * Specifies product version. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * OS disk image used by product. + */ + @JsonProperty(value = "osDiskImage", access = JsonProperty.Access.WRITE_ONLY) + private OsDiskImage osDiskImage; + + /* + * List of attached data disks. + */ + @JsonProperty(value = "dataDiskImages", access = JsonProperty.Access.WRITE_ONLY) + private List dataDiskImages; + + /** + * Get the version property: Specifies product version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the osDiskImage property: OS disk image used by product. + * + * @return the osDiskImage value. + */ + public OsDiskImage osDiskImage() { + return this.osDiskImage; + } + + /** + * Get the dataDiskImages property: List of attached data disks. + * + * @return the dataDiskImages value. + */ + public List dataDiskImages() { + return this.dataDiskImages; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (osDiskImage() != null) { + osDiskImage().validate(); + } + if (dataDiskImages() != null) { + dataDiskImages().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/package-info.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/package-info.java new file mode 100644 index 0000000000000..f11124973174e --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/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 AzureStackManagementClient. Azure Stack. */ +package com.azure.resourcemanager.azurestack.models; diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/package-info.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/package-info.java new file mode 100644 index 0000000000000..cad85700d3935 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/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 AzureStackManagementClient. Azure Stack. */ +package com.azure.resourcemanager.azurestack; diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/module-info.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/module-info.java new file mode 100644 index 0000000000000..11e2c82b6c884 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/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.azurestack { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.azurestack; + exports com.azure.resourcemanager.azurestack.fluent; + exports com.azure.resourcemanager.azurestack.fluent.models; + exports com.azure.resourcemanager.azurestack.models; + + opens com.azure.resourcemanager.azurestack.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.azurestack.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/azurestack/ci.yml b/sdk/azurestack/ci.yml new file mode 100644 index 0000000000000..c6c72ed636233 --- /dev/null +++ b/sdk/azurestack/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/azurestack/ + +pr: + branches: + include: + - master + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/azurestack/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: azurestack + Artifacts: + - name: azure-resourcemanager-azurestack + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerazurestack diff --git a/sdk/azurestack/pom.xml b/sdk/azurestack/pom.xml new file mode 100644 index 0000000000000..e1d07765a388d --- /dev/null +++ b/sdk/azurestack/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-azurestack-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-azurestack + + + +