diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/CHANGELOG.md b/sdk/azurestack/azure-resourcemanager-azurestack/CHANGELOG.md index 241b9efc0783..394a849bbc0e 100644 --- a/sdk/azurestack/azure-resourcemanager-azurestack/CHANGELOG.md +++ b/sdk/azurestack/azure-resourcemanager-azurestack/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2022-07-18) +- Azure Resource Manager AzureStack client library for Java. This package contains Microsoft Azure SDK for AzureStack Management SDK. Azure Stack. Package tag package-2022-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0-beta.1 (2021-04-12) diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/README.md b/sdk/azurestack/azure-resourcemanager-azurestack/README.md index 81f598537795..c19a4aae2368 100644 --- a/sdk/azurestack/azure-resourcemanager-azurestack/README.md +++ b/sdk/azurestack/azure-resourcemanager-azurestack/README.md @@ -2,7 +2,7 @@ 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). +This package contains Microsoft Azure SDK for AzureStack Management SDK. Azure Stack. Package tag package-2022-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 @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-azurestack - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -74,6 +74,9 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/azurestack/azure-resourcemanager-azurestack/SAMPLE.md) + + ## Troubleshooting ## Next steps diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/SAMPLE.md b/sdk/azurestack/azure-resourcemanager-azurestack/SAMPLE.md new file mode 100644 index 000000000000..34ab357586b0 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/SAMPLE.md @@ -0,0 +1,585 @@ +# Code snippets and samples + + +## CloudManifestFile + +- [Get](#cloudmanifestfile_get) +- [List](#cloudmanifestfile_list) + +## CustomerSubscriptions + +- [Create](#customersubscriptions_create) +- [Delete](#customersubscriptions_delete) +- [Get](#customersubscriptions_get) +- [List](#customersubscriptions_list) + +## DeploymentLicense + +- [Create](#deploymentlicense_create) + +## Operations + +- [List](#operations_list) + +## Products + +- [Get](#products_get) +- [GetProduct](#products_getproduct) +- [GetProducts](#products_getproducts) +- [List](#products_list) +- [ListDetails](#products_listdetails) +- [ListProducts](#products_listproducts) +- [UploadLog](#products_uploadlog) + +## Registrations + +- [CreateOrUpdate](#registrations_createorupdate) +- [Delete](#registrations_delete) +- [EnableRemoteManagement](#registrations_enableremotemanagement) +- [GetActivationKey](#registrations_getactivationkey) +- [GetByResourceGroup](#registrations_getbyresourcegroup) +- [List](#registrations_list) +- [ListByResourceGroup](#registrations_listbyresourcegroup) +- [Update](#registrations_update) +### CloudManifestFile_Get + +```java +import com.azure.core.util.Context; + +/** Samples for CloudManifestFile Get. */ +public final class CloudManifestFileGetSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/CloudManifestFile/Get.json + */ + /** + * Sample code: Returns the properties of a cloud specific manifest file. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsThePropertiesOfACloudSpecificManifestFile( + com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager.cloudManifestFiles().getWithResponse("latest", null, Context.NONE); + } +} +``` + +### CloudManifestFile_List + +```java +import com.azure.core.util.Context; + +/** Samples for CloudManifestFile List. */ +public final class CloudManifestFileListSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/CloudManifestFile/List.json + */ + /** + * Sample code: Returns the properties of a cloud specific manifest file with latest version. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsThePropertiesOfACloudSpecificManifestFileWithLatestVersion( + com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager.cloudManifestFiles().listWithResponse(Context.NONE); + } +} +``` + +### CustomerSubscriptions_Create + +```java +/** Samples for CustomerSubscriptions Create. */ +public final class CustomerSubscriptionsCreateSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/CustomerSubscription/Put.json + */ + /** + * Sample code: Creates a new customer subscription under a registration. + * + * @param manager Entry point to AzureStackManager. + */ + public static void createsANewCustomerSubscriptionUnderARegistration( + com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager + .customerSubscriptions() + .define("E09A4E93-29A7-4EBA-A6D4-76202383F07F") + .withExistingRegistration("azurestack", "testregistration") + .withTenantId("dbab3982-796f-4d03-9908-044c08aef8a2") + .create(); + } +} +``` + +### CustomerSubscriptions_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for CustomerSubscriptions Delete. */ +public final class CustomerSubscriptionsDeleteSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/CustomerSubscription/Delete.json + */ + /** + * Sample code: Deletes a customer subscription under a registration. + * + * @param manager Entry point to AzureStackManager. + */ + public static void deletesACustomerSubscriptionUnderARegistration( + com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager + .customerSubscriptions() + .deleteWithResponse("azurestack", "testregistration", "E09A4E93-29A7-4EBA-A6D4-76202383F07F", Context.NONE); + } +} +``` + +### CustomerSubscriptions_Get + +```java +import com.azure.core.util.Context; + +/** Samples for CustomerSubscriptions Get. */ +public final class CustomerSubscriptionsGetSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/CustomerSubscription/Get.json + */ + /** + * Sample code: Returns the specified product. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsTheSpecifiedProduct(com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager + .customerSubscriptions() + .getWithResponse("azurestack", "testregistration", "E09A4E93-29A7-4EBA-A6D4-76202383F07F", Context.NONE); + } +} +``` + +### CustomerSubscriptions_List + +```java +import com.azure.core.util.Context; + +/** Samples for CustomerSubscriptions List. */ +public final class CustomerSubscriptionsListSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/CustomerSubscription/List.json + */ + /** + * Sample code: Returns a list of products. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsAListOfProducts(com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager.customerSubscriptions().list("azurestack", "testregistration", Context.NONE); + } +} +``` + +### DeploymentLicense_Create + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestack.models.DeploymentLicenseRequest; + +/** Samples for DeploymentLicense Create. */ +public final class DeploymentLicenseCreateSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/DeploymentLicense/Post.json + */ + /** + * Sample code: Creates a license that can be used to deploy an Azure Stack device. + * + * @param manager Entry point to AzureStackManager. + */ + public static void createsALicenseThatCanBeUsedToDeployAnAzureStackDevice( + com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager + .deploymentLicenses() + .createWithResponse(new DeploymentLicenseRequest().withVerificationVersion("1"), Context.NONE); + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/Operation/List.json + */ + /** + * Sample code: Returns the list of supported REST operations. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsTheListOfSupportedRESTOperations( + com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### Products_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Products Get. */ +public final class ProductsGetSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/Product/Get.json + */ + /** + * Sample code: Returns the specified product. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsTheSpecifiedProduct(com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager + .products() + .getWithResponse( + "azurestack", "testregistration", "Microsoft.OSTCExtensions.VMAccessForLinux.1.4.7.1", Context.NONE); + } +} +``` + +### Products_GetProduct + +```java +import com.azure.core.util.Context; + +/** Samples for Products GetProduct. */ +public final class ProductsGetProductSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/Product/GetPost.json + */ + /** + * Sample code: Returns the specified product. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsTheSpecifiedProduct(com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager + .products() + .getProductWithResponse( + "azurestack", + "testregistration", + "Microsoft.OSTCExtensions.VMAccessForLinux.1.4.7.1", + null, + Context.NONE); + } +} +``` + +### Products_GetProducts + +```java +import com.azure.core.util.Context; + +/** Samples for Products GetProducts. */ +public final class ProductsGetProductsSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/Product/ListPost.json + */ + /** + * Sample code: Returns a list of products. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsAListOfProducts(com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager.products().getProductsWithResponse("azurestack", "testregistration", "_all", null, Context.NONE); + } +} +``` + +### Products_List + +```java +import com.azure.core.util.Context; + +/** Samples for Products List. */ +public final class ProductsListSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/Product/List.json + */ + /** + * Sample code: Returns a list of products. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsAListOfProducts(com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager.products().list("azurestack", "testregistration", Context.NONE); + } +} +``` + +### Products_ListDetails + +```java +import com.azure.core.util.Context; + +/** Samples for Products ListDetails. */ +public final class ProductsListDetailsSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/Product/Post.json + */ + /** + * Sample code: Returns the extended properties of a product. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsTheExtendedPropertiesOfAProduct( + com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager + .products() + .listDetailsWithResponse( + "azurestack", "testregistration", "Microsoft.OSTCExtensions.VMAccessForLinux.1.4.7.1", Context.NONE); + } +} +``` + +### Products_ListProducts + +```java +import com.azure.core.util.Context; + +/** Samples for Products ListProducts. */ +public final class ProductsListProductsSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/Product/ListPost.json + */ + /** + * Sample code: Returns a list of products. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsAListOfProducts(com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager.products().listProductsWithResponse("azurestack", "testregistration", "_all", null, Context.NONE); + } +} +``` + +### Products_UploadLog + +```java +import com.azure.core.util.Context; + +/** Samples for Products UploadLog. */ +public final class ProductsUploadLogSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/Product/UploadLog.json + */ + /** + * Sample code: Returns the specified product. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsTheSpecifiedProduct(com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager + .products() + .uploadLogWithResponse( + "azurestack", + "testregistration", + "Microsoft.OSTCExtensions.VMAccessForLinux.1.4.7.1", + null, + Context.NONE); + } +} +``` + +### Registrations_CreateOrUpdate + +```java +import com.azure.resourcemanager.azurestack.models.Location; + +/** Samples for Registrations CreateOrUpdate. */ +public final class RegistrationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/Registration/Put.json + */ + /** + * Sample code: Create or update an Azure Stack registration. + * + * @param manager Entry point to AzureStackManager. + */ + public static void createOrUpdateAnAzureStackRegistration( + com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager + .registrations() + .define("testregistration") + .withLocation(Location.GLOBAL) + .withExistingResourceGroup("azurestack") + .withRegistrationToken( + "EyjIAWXSAw5nTw9KZWWiOiJeZxZlbg9wBwvUdCiSIM9iaMVjdeLkijoinwIzyJa2Ytgtowm2yy00OdG4lTlLyJmtztHjZGfJZTC0NZK1iIWiY2XvdWRJzCi6iJy5nDy0oDk1LTNHmWeTnDUwyS05oDI0LTrINzYwoGq5mjAzziIsim1HCmtldHBsYwnLu3LuZGljYXrpB25FBmfIbgVkIJp0CNvLLCJOYXJkd2FYzuLUZM8iOlt7IM51bunvcMVZiJoYlCjcaw9ZiJPBIjNkzDJHmda3yte5ndqZMdq4YmZkZmi5oDM3OTY3ZwNMIL0SIM5PyYI6WyJLZTy0ztJJMwZKy2m0OWNLODDLMwm2zTm0ymzKyjmWySisiJA3njlHmtdlY2q4NjRjnwFIZtC1YZi5ZGyZodM3Y2vjIl0siMnwDsi6wyi2oDUZoTbiY2RhNDa0ymrKoWe4YtK5otblzWrJzGyzNCISIjmYnzC4M2vmnZdIoDRKM2i5ytfkmJlhnDc1zdhLzWm1il0sim5HBwuiOijIqzF1MTvhmDIXmIIsimrpc2SiolsioWNlZjVhnZM1otQ0nDu3NmjlN2M3zmfjzmyZMTJhZtiiLcjLZjLmmZJhmWVhytG0NTu0OTqZNWu1Mda0MZbIYtfjyijdLCj1DWlKijoinwM5Mwu3NjytMju5Os00oTIwlWi0OdmTnGzHotiWm2RjyTCxIIwiBWvTb3J5ijPbijAYZDA3M2fjNzu0YTRMZTfhodkxzDnkogY5ZtAWzdyXIiwINZcWzThLnDQ4otrJndAzZGI5MGzlYtY1ZJA5ZdfiNMQIXX1DlcJpC3n1zxiiOijZb21lB25LIIWIdmVyC2LVbiI6IJeuMcJ9") + .create(); + } +} +``` + +### Registrations_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Registrations Delete. */ +public final class RegistrationsDeleteSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/Registration/Delete.json + */ + /** + * Sample code: Delete the requested Azure Stack registration. + * + * @param manager Entry point to AzureStackManager. + */ + public static void deleteTheRequestedAzureStackRegistration( + com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager.registrations().deleteWithResponse("azurestack", "testregistration", Context.NONE); + } +} +``` + +### Registrations_EnableRemoteManagement + +```java +import com.azure.core.util.Context; + +/** Samples for Registrations EnableRemoteManagement. */ +public final class RegistrationsEnableRemoteManagementSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/RemoteManagement/Post.json + */ + /** + * Sample code: Returns empty response for successful action.. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsEmptyResponseForSuccessfulAction( + com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager.registrations().enableRemoteManagementWithResponse("azurestack", "testregistration", Context.NONE); + } +} +``` + +### Registrations_GetActivationKey + +```java +import com.azure.core.util.Context; + +/** Samples for Registrations GetActivationKey. */ +public final class RegistrationsGetActivationKeySamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/Registration/Post.json + */ + /** + * Sample code: Returns Azure Stack Activation Key. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsAzureStackActivationKey(com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager.registrations().getActivationKeyWithResponse("azurestack", "testregistration", Context.NONE); + } +} +``` + +### Registrations_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Registrations GetByResourceGroup. */ +public final class RegistrationsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/Registration/Get.json + */ + /** + * Sample code: Returns the properties of an Azure Stack registration. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsThePropertiesOfAnAzureStackRegistration( + com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager.registrations().getByResourceGroupWithResponse("azurestack", "testregistration", Context.NONE); + } +} +``` + +### Registrations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Registrations List. */ +public final class RegistrationsListSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/Registration/ListBySubscription.json + */ + /** + * Sample code: Returns a list of all registrations under current subscription. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsAListOfAllRegistrationsUnderCurrentSubscription( + com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager.registrations().list(Context.NONE); + } +} +``` + +### Registrations_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Registrations ListByResourceGroup. */ +public final class RegistrationsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/Registration/List.json + */ + /** + * Sample code: Returns a list of all registrations. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsAListOfAllRegistrations(com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager.registrations().listByResourceGroup("azurestack", Context.NONE); + } +} +``` + +### Registrations_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestack.models.Registration; + +/** Samples for Registrations Update. */ +public final class RegistrationsUpdateSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/Registration/Patch.json + */ + /** + * Sample code: Patch an Azure Stack registration. + * + * @param manager Entry point to AzureStackManager. + */ + public static void patchAnAzureStackRegistration(com.azure.resourcemanager.azurestack.AzureStackManager manager) { + Registration resource = + manager + .registrations() + .getByResourceGroupWithResponse("azurestack", "testregistration", Context.NONE) + .getValue(); + resource + .update() + .withRegistrationToken( + "EyjIAWXSAw5nTw9KZWWiOiJeZxZlbg9wBwvUdCiSIM9iaMVjdeLkijoinwIzyJa2Ytgtowm2yy00OdG4lTlLyJmtztHjZGfJZTC0NZK1iIWiY2XvdWRJzCi6iJy5nDy0oDk1LTNHmWeTnDUwyS05oDI0LTrINzYwoGq5mjAzziIsim1HCmtldHBsYwnLu3LuZGljYXrpB25FBmfIbgVkIJp0CNvLLCJOYXJkd2FYzuLUZM8iOlt7IM51bunvcMVZiJoYlCjcaw9ZiJPBIjNkzDJHmda3yte5ndqZMdq4YmZkZmi5oDM3OTY3ZwNMIL0SIM5PyYI6WyJLZTy0ztJJMwZKy2m0OWNLODDLMwm2zTm0ymzKyjmWySisiJA3njlHmtdlY2q4NjRjnwFIZtC1YZi5ZGyZodM3Y2vjIl0siMnwDsi6wyi2oDUZoTbiY2RhNDa0ymrKoWe4YtK5otblzWrJzGyzNCISIjmYnzC4M2vmnZdIoDRKM2i5ytfkmJlhnDc1zdhLzWm1il0sim5HBwuiOijIqzF1MTvhmDIXmIIsimrpc2SiolsioWNlZjVhnZM1otQ0nDu3NmjlN2M3zmfjzmyZMTJhZtiiLcjLZjLmmZJhmWVhytG0NTu0OTqZNWu1Mda0MZbIYtfjyijdLCj1DWlKijoinwM5Mwu3NjytMju5Os00oTIwlWi0OdmTnGzHotiWm2RjyTCxIIwiBWvTb3J5ijPbijAYZDA3M2fjNzu0YTRMZTfhodkxzDnkogY5ZtAWzdyXIiwINZcWzThLnDQ4otrJndAzZGI5MGzlYtY1ZJA5ZdfiNMQIXX1DlcJpC3n1zxiiOijZb21lB25LIIWIdmVyC2LVbiI6IJeuMcJ9") + .apply(); + } +} +``` + diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/pom.xml b/sdk/azurestack/azure-resourcemanager-azurestack/pom.xml index 08373a8ab92a..8d3c804a1223 100644 --- a/sdk/azurestack/azure-resourcemanager-azurestack/pom.xml +++ b/sdk/azurestack/azure-resourcemanager-azurestack/pom.xml @@ -1,55 +1,55 @@ - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - + 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.2 - jar + com.azure.resourcemanager + azure-resourcemanager-azurestack + 1.0.0-beta.2 + jar - Microsoft Azure SDK for AzureStack Management - This package contains Microsoft Azure SDK for AzureStack Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Stack. Package tag package-preview-2020-06. - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for AzureStack Management + This package contains Microsoft Azure SDK for AzureStack Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Stack. Package tag package-2022-06. + https://github.com/Azure/azure-sdk-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - + + + 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 - true - - - - com.azure - azure-core - 1.30.0 - - - com.azure - azure-core-management - 1.7.0 - - + + 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 + true + + + + com.azure + azure-core + 1.30.0 + + + com.azure + azure-core-management + 1.7.0 + + 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 index 8b7b19d4825a..168cea57f5ba 100644 --- 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 @@ -8,15 +8,18 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; 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.RetryOptions; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; @@ -24,13 +27,13 @@ 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.DeploymentLicensesImpl; 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.DeploymentLicenses; import com.azure.resourcemanager.azurestack.models.Operations; import com.azure.resourcemanager.azurestack.models.Products; import com.azure.resourcemanager.azurestack.models.Registrations; @@ -39,6 +42,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** Entry point to AzureStackManager. Azure Stack. */ public final class AzureStackManager { @@ -46,14 +50,14 @@ public final class AzureStackManager { private CloudManifestFiles cloudManifestFiles; + private DeploymentLicenses deploymentLicenses; + private CustomerSubscriptions customerSubscriptions; private Products products; private Registrations registrations; - private LinkedSubscriptions linkedSubscriptions; - private final AzureStackManagementClient clientObject; private AzureStackManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -81,6 +85,19 @@ public static AzureStackManager authenticate(TokenCredential credential, AzurePr return configure().authenticate(credential, profile); } + /** + * Creates an instance of AzureStack service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the AzureStack service API instance. + */ + public static AzureStackManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new AzureStackManager(httpPipeline, profile, null); + } + /** * Gets a Configurable instance that can be used to create AzureStackManager with optional configuration. * @@ -92,12 +109,14 @@ public static Configurable configure() { /** The Configurable allowing configurations to be set. */ public static final class Configurable { - private final ClientLogger logger = new ClientLogger(Configurable.class); + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; + private RetryOptions retryOptions; private Duration defaultPollInterval; private Configurable() { @@ -136,6 +155,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) { return this; } + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + /** * Sets the retry policy to the HTTP pipeline. * @@ -147,6 +177,19 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { return this; } + /** + * Sets the retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + /** * Sets the default poll interval, used when service does not provide "Retry-After" header. * @@ -154,9 +197,11 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { - throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); } return this; } @@ -192,20 +237,38 @@ public AzureStackManager authenticate(TokenCredential credential, AzureProfile p userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { - retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); - policies.addAll(this.policies); + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = @@ -217,7 +280,11 @@ public AzureStackManager authenticate(TokenCredential credential, AzureProfile p } } - /** @return Resource collection API of Operations. */ + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ public Operations operations() { if (this.operations == null) { this.operations = new OperationsImpl(clientObject.getOperations(), this); @@ -225,7 +292,11 @@ public Operations operations() { return operations; } - /** @return Resource collection API of CloudManifestFiles. */ + /** + * Gets the resource collection API of CloudManifestFiles. + * + * @return Resource collection API of CloudManifestFiles. + */ public CloudManifestFiles cloudManifestFiles() { if (this.cloudManifestFiles == null) { this.cloudManifestFiles = new CloudManifestFilesImpl(clientObject.getCloudManifestFiles(), this); @@ -233,7 +304,23 @@ public CloudManifestFiles cloudManifestFiles() { return cloudManifestFiles; } - /** @return Resource collection API of CustomerSubscriptions. */ + /** + * Gets the resource collection API of DeploymentLicenses. + * + * @return Resource collection API of DeploymentLicenses. + */ + public DeploymentLicenses deploymentLicenses() { + if (this.deploymentLicenses == null) { + this.deploymentLicenses = new DeploymentLicensesImpl(clientObject.getDeploymentLicenses(), this); + } + return deploymentLicenses; + } + + /** + * Gets the resource collection API of CustomerSubscriptions. It manages CustomerSubscription. + * + * @return Resource collection API of CustomerSubscriptions. + */ public CustomerSubscriptions customerSubscriptions() { if (this.customerSubscriptions == null) { this.customerSubscriptions = new CustomerSubscriptionsImpl(clientObject.getCustomerSubscriptions(), this); @@ -241,7 +328,11 @@ public CustomerSubscriptions customerSubscriptions() { return customerSubscriptions; } - /** @return Resource collection API of Products. */ + /** + * Gets the resource collection API of Products. + * + * @return Resource collection API of Products. + */ public Products products() { if (this.products == null) { this.products = new ProductsImpl(clientObject.getProducts(), this); @@ -249,7 +340,11 @@ public Products products() { return products; } - /** @return Resource collection API of Registrations. */ + /** + * Gets the resource collection API of Registrations. It manages Registration. + * + * @return Resource collection API of Registrations. + */ public Registrations registrations() { if (this.registrations == null) { this.registrations = new RegistrationsImpl(clientObject.getRegistrations(), this); @@ -257,14 +352,6 @@ public Registrations registrations() { 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. 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 index 551173793bb0..25fac675971b 100644 --- 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 @@ -59,6 +59,13 @@ public interface AzureStackManagementClient { */ CloudManifestFilesClient getCloudManifestFiles(); + /** + * Gets the DeploymentLicensesClient object to access its operations. + * + * @return the DeploymentLicensesClient object. + */ + DeploymentLicensesClient getDeploymentLicenses(); + /** * Gets the CustomerSubscriptionsClient object to access its operations. * @@ -79,11 +86,4 @@ public interface AzureStackManagementClient { * @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 index f1834421d572..ba8a821dd2a5 100644 --- 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 @@ -29,7 +29,7 @@ public interface CloudManifestFilesClient { * @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. + * @return cloud specific manifest GET response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response listWithResponse(Context context); @@ -55,7 +55,7 @@ public interface CloudManifestFilesClient { * @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. + * @return cloud specific manifest GET response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( 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 index 696d572bb26f..3e47e21ea5bd 100644 --- 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 @@ -21,7 +21,7 @@ public interface CustomerSubscriptionsClient { * @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. + * @return pageable list of customer subscriptions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroup, String registrationName); @@ -35,7 +35,7 @@ public interface CustomerSubscriptionsClient { * @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. + * @return pageable list of customer subscriptions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroup, String registrationName, Context context); @@ -64,7 +64,7 @@ public interface CustomerSubscriptionsClient { * @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. + * @return customer subscription along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( @@ -93,7 +93,7 @@ Response getWithResponse( * @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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse( @@ -129,7 +129,7 @@ CustomerSubscriptionInner create( * @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. + * @return customer subscription along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createWithResponse( diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/DeploymentLicensesClient.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/DeploymentLicensesClient.java new file mode 100644 index 000000000000..f5ca71fc3a83 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/DeploymentLicensesClient.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.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.DeploymentLicenseResponseInner; +import com.azure.resourcemanager.azurestack.models.DeploymentLicenseRequest; + +/** An instance of this class provides access to all the operations defined in DeploymentLicensesClient. */ +public interface DeploymentLicensesClient { + /** + * Creates a license that can be used to deploy an Azure Stack device. + * + * @param deploymentLicenseRequest Request body for creating a deployment license. + * @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 a license that can be used to deploy an Azure Stack device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentLicenseResponseInner create(DeploymentLicenseRequest deploymentLicenseRequest); + + /** + * Creates a license that can be used to deploy an Azure Stack device. + * + * @param deploymentLicenseRequest Request body for creating a deployment license. + * @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 a license that can be used to deploy an Azure Stack device along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + DeploymentLicenseRequest deploymentLicenseRequest, 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 deleted file mode 100644 index 4b39c0114f0f..000000000000 --- a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/LinkedSubscriptionsClient.java +++ /dev/null @@ -1,179 +0,0 @@ -// 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 index f294306434eb..90b43878d76b 100644 --- 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 @@ -17,7 +17,7 @@ public interface OperationsClient { * * @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. + * @return list of Operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -29,7 +29,7 @@ public interface OperationsClient { * @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. + * @return list of Operations as paginated response with {@link PagedIterable}. */ @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 index a8456312d9a4..e7f225192a07 100644 --- 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 @@ -26,7 +26,7 @@ public interface ProductsClient { * @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. + * @return pageable list of products as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroup, String registrationName); @@ -40,7 +40,7 @@ public interface ProductsClient { * @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. + * @return pageable list of products as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroup, String registrationName, Context context); @@ -69,7 +69,7 @@ public interface ProductsClient { * @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. + * @return product information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( @@ -99,7 +99,8 @@ Response getWithResponse( * @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. + * @return extended description about the product required for installing it into Azure Stack along with {@link + * Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response listDetailsWithResponse( @@ -117,7 +118,7 @@ Response listDetailsWithResponse( * @return pageable list of products. */ @ServiceMethod(returns = ReturnType.SINGLE) - ProductListInner getProducts(String resourceGroup, String registrationName, String productName); + ProductListInner listProducts(String resourceGroup, String registrationName, String productName); /** * Returns a list of products. @@ -130,9 +131,44 @@ Response listDetailsWithResponse( * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listProductsWithResponse( + String resourceGroup, + String registrationName, + String productName, + DeviceConfiguration deviceConfiguration, + 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) Response getProductsWithResponse( String resourceGroup, String registrationName, @@ -165,7 +201,7 @@ Response getProductsWithResponse( * @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. + * @return product information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getProductWithResponse( @@ -200,7 +236,7 @@ Response getProductWithResponse( * @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. + * @return product action log along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response uploadLogWithResponse( 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 index 062a41d3d102..e13870a8978e 100644 --- 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 @@ -22,7 +22,7 @@ public interface RegistrationsClient { * @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. + * @return pageable list of registrations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroup); @@ -35,11 +35,33 @@ public interface RegistrationsClient { * @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. + * @return pageable list of registrations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroup, Context context); + /** + * Returns a list of all registrations 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 pageable list of registrations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Returns a list of all registrations 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 pageable list of registrations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + /** * Returns the properties of an Azure Stack registration. * @@ -62,7 +84,7 @@ public interface RegistrationsClient { * @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. + * @return registration information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse( @@ -89,7 +111,7 @@ Response getByResourceGroupWithResponse( * @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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse(String resourceGroup, String registrationName, Context context); @@ -118,7 +140,7 @@ Response getByResourceGroupWithResponse( * @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. + * @return registration information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse( @@ -148,7 +170,7 @@ Response createOrUpdateWithResponse( * @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. + * @return registration information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse( @@ -176,7 +198,7 @@ Response updateWithResponse( * @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. + * @return the resource containing the Azure Stack activation key along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getActivationKeyWithResponse( @@ -203,7 +225,7 @@ Response getActivationKeyWithResponse( * @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. + * @return the {@link 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 index 808c1126580b..6ba8a66931ad 100644 --- 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 @@ -5,15 +5,11 @@ 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. */ diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/CloudManifestFileEnvironmentEndpoints.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/CloudManifestFileEnvironmentEndpoints.java new file mode 100644 index 000000000000..7feb4cb4b579 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/CloudManifestFileEnvironmentEndpoints.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Cloud specific environment endpoints for AzureStack deployment. */ +@Fluent +public final class CloudManifestFileEnvironmentEndpoints { + /* + * ARM endpoint. + */ + @JsonProperty(value = "customCloudArmEndpoint") + private String customCloudArmEndpoint; + + /* + * Dsms endpoint. + */ + @JsonProperty(value = "externalDsmsEndpoint") + private String externalDsmsEndpoint; + + /** + * 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 CloudManifestFileEnvironmentEndpoints object itself. + */ + public CloudManifestFileEnvironmentEndpoints 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 CloudManifestFileEnvironmentEndpoints object itself. + */ + public CloudManifestFileEnvironmentEndpoints 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/fluent/models/CloudManifestFileResponseInner.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/CloudManifestFileResponseInner.java index 3ffed19f56ab..ec37aaa640e5 100644 --- 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 @@ -6,16 +6,12 @@ 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. */ 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 index 22838f76b411..edab38e5e4e5 100644 --- 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 @@ -5,30 +5,17 @@ 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.management.SystemData; -import com.azure.core.util.logging.ClientLogger; -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; - +public final class CustomerSubscriptionInner extends ProxyResource { /* - * Tenant Id. + * Customer subscription properties. */ - @JsonProperty(value = "properties.tenantId") - private String tenantId; + @JsonProperty(value = "properties") + private CustomerSubscriptionProperties innerProperties; /* * The entity tag used for optimistic concurrency when modifying the @@ -38,51 +25,54 @@ public class CustomerSubscriptionInner extends ProxyResource { private String etag; /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * Get the innerProperties property: Customer subscription properties. * - * @return the systemData value. + * @return the innerProperties value. */ - public SystemData systemData() { - return this.systemData; + private CustomerSubscriptionProperties innerProperties() { + return this.innerProperties; } /** - * Get the tenantId property: Tenant Id. + * Get the etag property: The entity tag used for optimistic concurrency when modifying the resource. * - * @return the tenantId value. + * @return the etag value. */ - public String tenantId() { - return this.tenantId; + public String etag() { + return this.etag; } /** - * Set the tenantId property: Tenant Id. + * Set the etag property: The entity tag used for optimistic concurrency when modifying the resource. * - * @param tenantId the tenantId value to set. + * @param etag the etag value to set. * @return the CustomerSubscriptionInner object itself. */ - public CustomerSubscriptionInner withTenantId(String tenantId) { - this.tenantId = tenantId; + public CustomerSubscriptionInner withEtag(String etag) { + this.etag = etag; return this; } /** - * Get the etag property: The entity tag used for optimistic concurrency when modifying the resource. + * Get the tenantId property: Tenant Id. * - * @return the etag value. + * @return the tenantId value. */ - public String etag() { - return this.etag; + public String tenantId() { + return this.innerProperties() == null ? null : this.innerProperties().tenantId(); } /** - * Set the etag property: The entity tag used for optimistic concurrency when modifying the resource. + * Set the tenantId property: Tenant Id. * - * @param etag the etag value to set. + * @param tenantId the tenantId value to set. * @return the CustomerSubscriptionInner object itself. */ - public CustomerSubscriptionInner withEtag(String etag) { - this.etag = etag; + public CustomerSubscriptionInner withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomerSubscriptionProperties(); + } + this.innerProperties().withTenantId(tenantId); return this; } @@ -92,5 +82,8 @@ public CustomerSubscriptionInner withEtag(String etag) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } } } diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/CustomerSubscriptionProperties.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/CustomerSubscriptionProperties.java new file mode 100644 index 000000000000..250dcb4c198b --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/CustomerSubscriptionProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Customer subscription properties. */ +@Fluent +public final class CustomerSubscriptionProperties { + /* + * Tenant Id. + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /** + * 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 CustomerSubscriptionProperties object itself. + */ + public CustomerSubscriptionProperties withTenantId(String tenantId) { + this.tenantId = tenantId; + 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/DeploymentLicenseResponseInner.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/DeploymentLicenseResponseInner.java new file mode 100644 index 000000000000..eca0b7adcb5e --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/DeploymentLicenseResponseInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A license that can be used to deploy an Azure Stack device. */ +@Fluent +public final class DeploymentLicenseResponseInner { + /* + * A license chain that can be used to temporarily activate an Azure Stack + * device. + */ + @JsonProperty(value = "temporaryLicenseChain") + private List temporaryLicenseChain; + + /* + * Signature of the license chain. + */ + @JsonProperty(value = "signature") + private String signature; + + /** + * Get the temporaryLicenseChain property: A license chain that can be used to temporarily activate an Azure Stack + * device. + * + * @return the temporaryLicenseChain value. + */ + public List temporaryLicenseChain() { + return this.temporaryLicenseChain; + } + + /** + * Set the temporaryLicenseChain property: A license chain that can be used to temporarily activate an Azure Stack + * device. + * + * @param temporaryLicenseChain the temporaryLicenseChain value to set. + * @return the DeploymentLicenseResponseInner object itself. + */ + public DeploymentLicenseResponseInner withTemporaryLicenseChain(List temporaryLicenseChain) { + this.temporaryLicenseChain = temporaryLicenseChain; + return this; + } + + /** + * Get the signature property: Signature of the license chain. + * + * @return the signature value. + */ + public String signature() { + return this.signature; + } + + /** + * Set the signature property: Signature of the license chain. + * + * @param signature the signature value to set. + * @return the DeploymentLicenseResponseInner object itself. + */ + public DeploymentLicenseResponseInner withSignature(String signature) { + this.signature = signature; + 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/ExtendedProductInner.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/ExtendedProductInner.java index c6b72a8bd392..1d6fb2ab39aa 100644 --- 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 @@ -5,22 +5,16 @@ 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); - +public final class ExtendedProductInner { /* * The URI to the .azpkg file that provides information required for * showing product in the gallery. @@ -36,65 +30,10 @@ public class ExtendedProductInner { 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. + * Specifies additional properties describing the product. */ - @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; + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private ExtendedProductProperties innerProperties; /** * Get the galleryPackageBlobSasUri property: The URI to the .azpkg file that provides information required for @@ -116,57 +55,57 @@ public String productKind() { } /** - * Get the computeRole property: Specifies kind of compute role included in the package. + * Get the innerProperties property: Specifies additional properties describing the product. * - * @return the computeRole value. + * @return the innerProperties value. */ - public ComputeRole computeRole() { - return this.computeRole; + private ExtendedProductProperties innerProperties() { + return this.innerProperties; } /** - * Get the isSystemExtension property: Specifies if product is a Virtual Machine Extension. + * Get the version property: Specifies product version. * - * @return the isSystemExtension value. + * @return the version value. */ - public Boolean isSystemExtension() { - return this.isSystemExtension; + public String version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); } /** - * Get the supportMultipleExtensions property: Indicates if specified product supports multiple extensions. + * Get the osDiskImage property: OS disk image used by product. * - * @return the supportMultipleExtensions value. + * @return the osDiskImage value. */ - public Boolean supportMultipleExtensions() { - return this.supportMultipleExtensions; + public OsDiskImage osDiskImage() { + return this.innerProperties() == null ? null : this.innerProperties().osDiskImage(); } /** - * Get the versionPropertiesVersion property: Specifies product version. + * Get the dataDiskImages property: List of attached data disks. * - * @return the versionPropertiesVersion value. + * @return the dataDiskImages value. */ - public String versionPropertiesVersion() { - return this.versionPropertiesVersion; + public List dataDiskImages() { + return this.innerProperties() == null ? null : this.innerProperties().dataDiskImages(); } /** - * Get the vmOsType property: Specifies operating system used by the product. + * Get the computeRole property: Specifies kind of compute role included in the package. * - * @return the vmOsType value. + * @return the computeRole value. */ - public OperatingSystem vmOsType() { - return this.vmOsType; + public ComputeRole computeRole() { + return this.innerProperties() == null ? null : this.innerProperties().computeRole(); } /** - * Get the vmScaleSetEnabled property: Indicates if virtual machine Scale Set is enabled in the specified product. + * Get the isSystemExtension property: Specifies if product is a Virtual Machine Extension. * - * @return the vmScaleSetEnabled value. + * @return the isSystemExtension value. */ - public Boolean vmScaleSetEnabled() { - return this.vmScaleSetEnabled; + public Boolean isSystemExtension() { + return this.innerProperties() == null ? null : this.innerProperties().isSystemExtension(); } /** @@ -175,34 +114,34 @@ public Boolean vmScaleSetEnabled() { * @return the uri value. */ public String uri() { - return this.uri; + return this.innerProperties() == null ? null : this.innerProperties().uri(); } /** - * Get the version property: Specifies product version. + * Get the supportMultipleExtensions property: Indicates if specified product supports multiple extensions. * - * @return the version value. + * @return the supportMultipleExtensions value. */ - public String version() { - return this.version; + public Boolean supportMultipleExtensions() { + return this.innerProperties() == null ? null : this.innerProperties().supportMultipleExtensions(); } /** - * Get the osDiskImage property: OS disk image used by product. + * Get the vmOsType property: Specifies operating system used by the product. * - * @return the osDiskImage value. + * @return the vmOsType value. */ - public OsDiskImage osDiskImage() { - return this.osDiskImage; + public OperatingSystem vmOsType() { + return this.innerProperties() == null ? null : this.innerProperties().vmOsType(); } /** - * Get the dataDiskImages property: List of attached data disks. + * Get the vmScaleSetEnabled property: Indicates if virtual machine Scale Set is enabled in the specified product. * - * @return the dataDiskImages value. + * @return the vmScaleSetEnabled value. */ - public List dataDiskImages() { - return this.dataDiskImages; + public Boolean vmScaleSetEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().vmScaleSetEnabled(); } /** @@ -211,11 +150,8 @@ public List dataDiskImages() { * @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()); + if (innerProperties() != null) { + innerProperties().validate(); } } } 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/fluent/models/ExtendedProductProperties.java similarity index 87% rename from sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/ExtendedProductProperties.java rename to sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/ExtendedProductProperties.java index 06febb9f9672..b74ada96e06f 100644 --- 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/fluent/models/ExtendedProductProperties.java @@ -2,19 +2,18 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.azurestack.models; +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.azure.resourcemanager.azurestack.models.DataDiskImage; +import com.azure.resourcemanager.azurestack.models.OsDiskImage; +import com.azure.resourcemanager.azurestack.models.VirtualMachineExtensionProductProperties; 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. */ 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 deleted file mode 100644 index c7e7ee06b652..000000000000 --- a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/LinkedSubscriptionInner.java +++ /dev/null @@ -1,233 +0,0 @@ -// 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.management.SystemData; -import com.azure.core.util.logging.ClientLogger; -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() { - } -} 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 index 8fecbd12675d..61ec6dbde52b 100644 --- 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 @@ -5,16 +5,12 @@ 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. */ 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 index 69af83ff6b5e..4971fa1c154f 100644 --- 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 @@ -5,137 +5,22 @@ 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.management.SystemData; -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.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; - +public final class ProductInner extends ProxyResource { /* - * Additional links available for this product. + * Properties of the product resource. */ - @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; + @JsonProperty(value = "properties") + private ProductNestedProperties innerProperties; /* * The entity tag used for optimistic concurrency when modifying the @@ -145,12 +30,32 @@ public class ProductInner extends ProxyResource { private String etag; /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * Get the innerProperties property: Properties of the product resource. + * + * @return the innerProperties value. + */ + private ProductNestedProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the etag property: The entity tag used for optimistic concurrency when modifying the resource. * - * @return the systemData value. + * @return the etag value. */ - public SystemData systemData() { - return this.systemData; + 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; } /** @@ -159,7 +64,7 @@ public SystemData systemData() { * @return the displayName value. */ public String displayName() { - return this.displayName; + return this.innerProperties() == null ? null : this.innerProperties().displayName(); } /** @@ -169,7 +74,10 @@ public String displayName() { * @return the ProductInner object itself. */ public ProductInner withDisplayName(String displayName) { - this.displayName = displayName; + if (this.innerProperties() == null) { + this.innerProperties = new ProductNestedProperties(); + } + this.innerProperties().withDisplayName(displayName); return this; } @@ -179,7 +87,7 @@ public ProductInner withDisplayName(String displayName) { * @return the description value. */ public String description() { - return this.description; + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** @@ -189,7 +97,10 @@ public String description() { * @return the ProductInner object itself. */ public ProductInner withDescription(String description) { - this.description = description; + if (this.innerProperties() == null) { + this.innerProperties = new ProductNestedProperties(); + } + this.innerProperties().withDescription(description); return this; } @@ -199,7 +110,7 @@ public ProductInner withDescription(String description) { * @return the publisherDisplayName value. */ public String publisherDisplayName() { - return this.publisherDisplayName; + return this.innerProperties() == null ? null : this.innerProperties().publisherDisplayName(); } /** @@ -209,7 +120,10 @@ public String publisherDisplayName() { * @return the ProductInner object itself. */ public ProductInner withPublisherDisplayName(String publisherDisplayName) { - this.publisherDisplayName = publisherDisplayName; + if (this.innerProperties() == null) { + this.innerProperties = new ProductNestedProperties(); + } + this.innerProperties().withPublisherDisplayName(publisherDisplayName); return this; } @@ -219,7 +133,7 @@ public ProductInner withPublisherDisplayName(String publisherDisplayName) { * @return the publisherIdentifier value. */ public String publisherIdentifier() { - return this.publisherIdentifier; + return this.innerProperties() == null ? null : this.innerProperties().publisherIdentifier(); } /** @@ -229,7 +143,10 @@ public String publisherIdentifier() { * @return the ProductInner object itself. */ public ProductInner withPublisherIdentifier(String publisherIdentifier) { - this.publisherIdentifier = publisherIdentifier; + if (this.innerProperties() == null) { + this.innerProperties = new ProductNestedProperties(); + } + this.innerProperties().withPublisherIdentifier(publisherIdentifier); return this; } @@ -239,7 +156,7 @@ public ProductInner withPublisherIdentifier(String publisherIdentifier) { * @return the offer value. */ public String offer() { - return this.offer; + return this.innerProperties() == null ? null : this.innerProperties().offer(); } /** @@ -249,7 +166,10 @@ public String offer() { * @return the ProductInner object itself. */ public ProductInner withOffer(String offer) { - this.offer = offer; + if (this.innerProperties() == null) { + this.innerProperties = new ProductNestedProperties(); + } + this.innerProperties().withOffer(offer); return this; } @@ -259,7 +179,7 @@ public ProductInner withOffer(String offer) { * @return the offerVersion value. */ public String offerVersion() { - return this.offerVersion; + return this.innerProperties() == null ? null : this.innerProperties().offerVersion(); } /** @@ -269,7 +189,10 @@ public String offerVersion() { * @return the ProductInner object itself. */ public ProductInner withOfferVersion(String offerVersion) { - this.offerVersion = offerVersion; + if (this.innerProperties() == null) { + this.innerProperties = new ProductNestedProperties(); + } + this.innerProperties().withOfferVersion(offerVersion); return this; } @@ -279,7 +202,7 @@ public ProductInner withOfferVersion(String offerVersion) { * @return the sku value. */ public String sku() { - return this.sku; + return this.innerProperties() == null ? null : this.innerProperties().sku(); } /** @@ -289,7 +212,10 @@ public String sku() { * @return the ProductInner object itself. */ public ProductInner withSku(String sku) { - this.sku = sku; + if (this.innerProperties() == null) { + this.innerProperties = new ProductNestedProperties(); + } + this.innerProperties().withSku(sku); return this; } @@ -299,7 +225,7 @@ public ProductInner withSku(String sku) { * @return the billingPartNumber value. */ public String billingPartNumber() { - return this.billingPartNumber; + return this.innerProperties() == null ? null : this.innerProperties().billingPartNumber(); } /** @@ -309,7 +235,10 @@ public String billingPartNumber() { * @return the ProductInner object itself. */ public ProductInner withBillingPartNumber(String billingPartNumber) { - this.billingPartNumber = billingPartNumber; + if (this.innerProperties() == null) { + this.innerProperties = new ProductNestedProperties(); + } + this.innerProperties().withBillingPartNumber(billingPartNumber); return this; } @@ -319,7 +248,7 @@ public ProductInner withBillingPartNumber(String billingPartNumber) { * @return the vmExtensionType value. */ public String vmExtensionType() { - return this.vmExtensionType; + return this.innerProperties() == null ? null : this.innerProperties().vmExtensionType(); } /** @@ -329,7 +258,10 @@ public String vmExtensionType() { * @return the ProductInner object itself. */ public ProductInner withVmExtensionType(String vmExtensionType) { - this.vmExtensionType = vmExtensionType; + if (this.innerProperties() == null) { + this.innerProperties = new ProductNestedProperties(); + } + this.innerProperties().withVmExtensionType(vmExtensionType); return this; } @@ -339,7 +271,7 @@ public ProductInner withVmExtensionType(String vmExtensionType) { * @return the galleryItemIdentity value. */ public String galleryItemIdentity() { - return this.galleryItemIdentity; + return this.innerProperties() == null ? null : this.innerProperties().galleryItemIdentity(); } /** @@ -349,7 +281,10 @@ public String galleryItemIdentity() { * @return the ProductInner object itself. */ public ProductInner withGalleryItemIdentity(String galleryItemIdentity) { - this.galleryItemIdentity = galleryItemIdentity; + if (this.innerProperties() == null) { + this.innerProperties = new ProductNestedProperties(); + } + this.innerProperties().withGalleryItemIdentity(galleryItemIdentity); return this; } @@ -359,7 +294,7 @@ public ProductInner withGalleryItemIdentity(String galleryItemIdentity) { * @return the iconUris value. */ public IconUris iconUris() { - return this.iconUris; + return this.innerProperties() == null ? null : this.innerProperties().iconUris(); } /** @@ -369,7 +304,10 @@ public IconUris iconUris() { * @return the ProductInner object itself. */ public ProductInner withIconUris(IconUris iconUris) { - this.iconUris = iconUris; + if (this.innerProperties() == null) { + this.innerProperties = new ProductNestedProperties(); + } + this.innerProperties().withIconUris(iconUris); return this; } @@ -379,7 +317,7 @@ public ProductInner withIconUris(IconUris iconUris) { * @return the links value. */ public List links() { - return this.links; + return this.innerProperties() == null ? null : this.innerProperties().links(); } /** @@ -389,7 +327,10 @@ public List links() { * @return the ProductInner object itself. */ public ProductInner withLinks(List links) { - this.links = links; + if (this.innerProperties() == null) { + this.innerProperties = new ProductNestedProperties(); + } + this.innerProperties().withLinks(links); return this; } @@ -399,7 +340,7 @@ public ProductInner withLinks(List links) { * @return the legalTerms value. */ public String legalTerms() { - return this.legalTerms; + return this.innerProperties() == null ? null : this.innerProperties().legalTerms(); } /** @@ -409,7 +350,10 @@ public String legalTerms() { * @return the ProductInner object itself. */ public ProductInner withLegalTerms(String legalTerms) { - this.legalTerms = legalTerms; + if (this.innerProperties() == null) { + this.innerProperties = new ProductNestedProperties(); + } + this.innerProperties().withLegalTerms(legalTerms); return this; } @@ -419,7 +363,7 @@ public ProductInner withLegalTerms(String legalTerms) { * @return the privacyPolicy value. */ public String privacyPolicy() { - return this.privacyPolicy; + return this.innerProperties() == null ? null : this.innerProperties().privacyPolicy(); } /** @@ -429,7 +373,10 @@ public String privacyPolicy() { * @return the ProductInner object itself. */ public ProductInner withPrivacyPolicy(String privacyPolicy) { - this.privacyPolicy = privacyPolicy; + if (this.innerProperties() == null) { + this.innerProperties = new ProductNestedProperties(); + } + this.innerProperties().withPrivacyPolicy(privacyPolicy); return this; } @@ -439,7 +386,7 @@ public ProductInner withPrivacyPolicy(String privacyPolicy) { * @return the payloadLength value. */ public Long payloadLength() { - return this.payloadLength; + return this.innerProperties() == null ? null : this.innerProperties().payloadLength(); } /** @@ -449,7 +396,10 @@ public Long payloadLength() { * @return the ProductInner object itself. */ public ProductInner withPayloadLength(Long payloadLength) { - this.payloadLength = payloadLength; + if (this.innerProperties() == null) { + this.innerProperties = new ProductNestedProperties(); + } + this.innerProperties().withPayloadLength(payloadLength); return this; } @@ -459,7 +409,7 @@ public ProductInner withPayloadLength(Long payloadLength) { * @return the productKind value. */ public String productKind() { - return this.productKind; + return this.innerProperties() == null ? null : this.innerProperties().productKind(); } /** @@ -469,7 +419,10 @@ public String productKind() { * @return the ProductInner object itself. */ public ProductInner withProductKind(String productKind) { - this.productKind = productKind; + if (this.innerProperties() == null) { + this.innerProperties = new ProductNestedProperties(); + } + this.innerProperties().withProductKind(productKind); return this; } @@ -479,7 +432,7 @@ public ProductInner withProductKind(String productKind) { * @return the productProperties value. */ public ProductProperties productProperties() { - return this.productProperties; + return this.innerProperties() == null ? null : this.innerProperties().productProperties(); } /** @@ -489,7 +442,10 @@ public ProductProperties productProperties() { * @return the ProductInner object itself. */ public ProductInner withProductProperties(ProductProperties productProperties) { - this.productProperties = productProperties; + if (this.innerProperties() == null) { + this.innerProperties = new ProductNestedProperties(); + } + this.innerProperties().withProductProperties(productProperties); return this; } @@ -499,7 +455,7 @@ public ProductInner withProductProperties(ProductProperties productProperties) { * @return the compatibility value. */ public Compatibility compatibility() { - return this.compatibility; + return this.innerProperties() == null ? null : this.innerProperties().compatibility(); } /** @@ -509,27 +465,10 @@ public Compatibility compatibility() { * @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; + if (this.innerProperties() == null) { + this.innerProperties = new ProductNestedProperties(); + } + this.innerProperties().withCompatibility(compatibility); return this; } @@ -539,17 +478,8 @@ public ProductInner withEtag(String etag) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (iconUris() != null) { - iconUris().validate(); - } - if (links() != null) { - links().forEach(e -> e.validate()); - } - if (productProperties() != null) { - productProperties().validate(); - } - if (compatibility() != null) { - compatibility().validate(); + if (innerProperties() != null) { + innerProperties().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 index f5e2a50ca346..101375d99a83 100644 --- 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 @@ -5,16 +5,12 @@ 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. */ 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 index b6d75a701f23..2648e1268ea1 100644 --- 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 @@ -5,15 +5,11 @@ 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. */ diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/ProductNestedProperties.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/ProductNestedProperties.java new file mode 100644 index 000000000000..71ee077b069b --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/ProductNestedProperties.java @@ -0,0 +1,505 @@ +// 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.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties portion of the product resource. */ +@Fluent +public final class ProductNestedProperties { + /* + * The display name of the product. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * The description of the product. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The user-friendly name of the product publisher. + */ + @JsonProperty(value = "publisherDisplayName") + private String publisherDisplayName; + + /* + * Publisher identifier. + */ + @JsonProperty(value = "publisherIdentifier") + private String publisherIdentifier; + + /* + * The offer representing the product. + */ + @JsonProperty(value = "offer") + private String offer; + + /* + * The version of the product offer. + */ + @JsonProperty(value = "offerVersion") + private String offerVersion; + + /* + * The product SKU. + */ + @JsonProperty(value = "sku") + private String sku; + + /* + * The part number used for billing purposes. + */ + @JsonProperty(value = "billingPartNumber") + private String billingPartNumber; + + /* + * The type of the Virtual Machine Extension. + */ + @JsonProperty(value = "vmExtensionType") + private String vmExtensionType; + + /* + * The identifier of the gallery item corresponding to the product. + */ + @JsonProperty(value = "galleryItemIdentity") + private String galleryItemIdentity; + + /* + * Additional links available for this product. + */ + @JsonProperty(value = "iconUris") + private IconUris iconUris; + + /* + * Additional links available for this product. + */ + @JsonProperty(value = "links") + private List links; + + /* + * The legal terms. + */ + @JsonProperty(value = "legalTerms") + private String legalTerms; + + /* + * The privacy policy. + */ + @JsonProperty(value = "privacyPolicy") + private String privacyPolicy; + + /* + * The length of product content. + */ + @JsonProperty(value = "payloadLength") + private Long payloadLength; + + /* + * The kind of the product (virtualMachine or virtualMachineExtension) + */ + @JsonProperty(value = "productKind") + private String productKind; + + /* + * Additional properties for the product. + */ + @JsonProperty(value = "productProperties") + private ProductProperties productProperties; + + /* + * Product compatibility with current device. + */ + @JsonProperty(value = "compatibility") + private Compatibility compatibility; + + /** + * 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 ProductNestedProperties object itself. + */ + public ProductNestedProperties 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 ProductNestedProperties object itself. + */ + public ProductNestedProperties 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 ProductNestedProperties object itself. + */ + public ProductNestedProperties 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 ProductNestedProperties object itself. + */ + public ProductNestedProperties 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 ProductNestedProperties object itself. + */ + public ProductNestedProperties 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 ProductNestedProperties object itself. + */ + public ProductNestedProperties 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 ProductNestedProperties object itself. + */ + public ProductNestedProperties 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 ProductNestedProperties object itself. + */ + public ProductNestedProperties 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 ProductNestedProperties object itself. + */ + public ProductNestedProperties 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 ProductNestedProperties object itself. + */ + public ProductNestedProperties 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 ProductNestedProperties object itself. + */ + public ProductNestedProperties 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 ProductNestedProperties object itself. + */ + public ProductNestedProperties 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 ProductNestedProperties object itself. + */ + public ProductNestedProperties 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 ProductNestedProperties object itself. + */ + public ProductNestedProperties 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 ProductNestedProperties object itself. + */ + public ProductNestedProperties 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 ProductNestedProperties object itself. + */ + public ProductNestedProperties 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 ProductNestedProperties object itself. + */ + public ProductNestedProperties 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 ProductNestedProperties object itself. + */ + public ProductNestedProperties withCompatibility(Compatibility compatibility) { + this.compatibility = compatibility; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void 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/RegistrationInner.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/RegistrationInner.java index 6de84a740ca8..938bb79bb932 100644 --- 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 @@ -5,57 +5,68 @@ 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.management.SystemData; -import com.azure.core.util.logging.ClientLogger; -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); - +public final class RegistrationInner extends Resource { /* - * The object identifier associated with the Azure Stack connecting to - * Azure. + * Registration resource. */ - @JsonProperty(value = "properties.objectId") - private String objectId; + @JsonProperty(value = "properties") + private RegistrationProperties innerProperties; /* - * The identifier of the registered Azure Stack. + * The entity tag used for optimistic concurrency when modifying the + * resource. */ - @JsonProperty(value = "properties.cloudId") - private String cloudId; + @JsonProperty(value = "etag") + private String etag; - /* - * Specifies the billing mode for the Azure Stack registration. + /** + * Get the innerProperties property: Registration resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.billingModel") - private String billingModel; + private RegistrationProperties innerProperties() { + return this.innerProperties; + } - /* - * The kind of the resource. + /** + * Get the etag property: The entity tag used for optimistic concurrency when modifying the resource. + * + * @return the etag value. */ - @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) - private String kind; + public String etag() { + return this.etag; + } - /* - * Metadata pertaining to creation and last modification of the resource. + /** + * 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. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; + public RegistrationInner withEtag(String etag) { + this.etag = etag; + return this; + } - /* - * The entity tag used for optimistic concurrency when modifying the - * resource. - */ - @JsonProperty(value = "etag") - private String etag; + /** {@inheritDoc} */ + @Override + public RegistrationInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public RegistrationInner withTags(Map tags) { + super.withTags(tags); + return this; + } /** * Get the objectId property: The object identifier associated with the Azure Stack connecting to Azure. @@ -63,7 +74,7 @@ public class RegistrationInner extends Resource { * @return the objectId value. */ public String objectId() { - return this.objectId; + return this.innerProperties() == null ? null : this.innerProperties().objectId(); } /** @@ -73,7 +84,10 @@ public String objectId() { * @return the RegistrationInner object itself. */ public RegistrationInner withObjectId(String objectId) { - this.objectId = objectId; + if (this.innerProperties() == null) { + this.innerProperties = new RegistrationProperties(); + } + this.innerProperties().withObjectId(objectId); return this; } @@ -83,7 +97,7 @@ public RegistrationInner withObjectId(String objectId) { * @return the cloudId value. */ public String cloudId() { - return this.cloudId; + return this.innerProperties() == null ? null : this.innerProperties().cloudId(); } /** @@ -93,7 +107,10 @@ public String cloudId() { * @return the RegistrationInner object itself. */ public RegistrationInner withCloudId(String cloudId) { - this.cloudId = cloudId; + if (this.innerProperties() == null) { + this.innerProperties = new RegistrationProperties(); + } + this.innerProperties().withCloudId(cloudId); return this; } @@ -103,7 +120,7 @@ public RegistrationInner withCloudId(String cloudId) { * @return the billingModel value. */ public String billingModel() { - return this.billingModel; + return this.innerProperties() == null ? null : this.innerProperties().billingModel(); } /** @@ -113,59 +130,10 @@ public String billingModel() { * @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); + if (this.innerProperties() == null) { + this.innerProperties = new RegistrationProperties(); + } + this.innerProperties().withBillingModel(billingModel); return this; } @@ -175,5 +143,8 @@ public RegistrationInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } } } diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/RegistrationParameterProperties.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/RegistrationParameterProperties.java new file mode 100644 index 000000000000..8a028dce7f85 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/RegistrationParameterProperties.java @@ -0,0 +1,55 @@ +// 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.JsonProperty; + +/** Properties of the Azure Stack registration resource. */ +@Fluent +public final class RegistrationParameterProperties { + /* + * The token identifying registered Azure Stack + */ + @JsonProperty(value = "registrationToken", required = true) + private String registrationToken; + + /** + * 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 RegistrationParameterProperties object itself. + */ + public RegistrationParameterProperties withRegistrationToken(String registrationToken) { + this.registrationToken = registrationToken; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (registrationToken() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property registrationToken in model RegistrationParameterProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RegistrationParameterProperties.class); +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/RegistrationProperties.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/RegistrationProperties.java new file mode 100644 index 000000000000..87c7be97a972 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/RegistrationProperties.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.fasterxml.jackson.annotation.JsonProperty; + +/** Properties portion of the registration resource. */ +@Fluent +public final class RegistrationProperties { + /* + * The object identifier associated with the Azure Stack connecting to + * Azure. + */ + @JsonProperty(value = "objectId") + private String objectId; + + /* + * The identifier of the registered Azure Stack. + */ + @JsonProperty(value = "cloudId") + private String cloudId; + + /* + * Specifies the billing mode for the Azure Stack registration. + */ + @JsonProperty(value = "billingModel") + private String billingModel; + + /** + * 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 RegistrationProperties object itself. + */ + public RegistrationProperties 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 RegistrationProperties object itself. + */ + public RegistrationProperties 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 RegistrationProperties object itself. + */ + public RegistrationProperties withBillingModel(String billingModel) { + this.billingModel = billingModel; + 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/Uri.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/Uri.java new file mode 100644 index 000000000000..b34baee7bf3c --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/fluent/models/Uri.java @@ -0,0 +1,35 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** The URI. */ +@Immutable +public final class Uri { + /* + * The URI. + */ + @JsonProperty(value = "uri", access = JsonProperty.Access.WRITE_ONLY) + private String uri; + + /** + * 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/implementation/AzureStackManagementClientBuilder.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/AzureStackManagementClientBuilder.java index 90ff22db5cc3..6f69c68f2a25 100644 --- 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 @@ -7,7 +7,6 @@ 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; @@ -70,34 +69,34 @@ public AzureStackManagementClientBuilder environment(AzureEnvironment environmen } /* - * The default poll interval for long-running operation + * The HTTP pipeline to send requests through */ - private Duration defaultPollInterval; + private HttpPipeline pipeline; /** - * Sets The default poll interval for long-running operation. + * Sets The HTTP pipeline to send requests through. * - * @param defaultPollInterval the defaultPollInterval value. + * @param pipeline the pipeline value. * @return the AzureStackManagementClientBuilder. */ - public AzureStackManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; + public AzureStackManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; return this; } /* - * The HTTP pipeline to send requests through + * The default poll interval for long-running operation */ - private HttpPipeline pipeline; + private Duration defaultPollInterval; /** - * Sets The HTTP pipeline to send requests through. + * Sets The default poll interval for long-running operation. * - * @param pipeline the pipeline value. + * @param defaultPollInterval the defaultPollInterval value. * @return the AzureStackManagementClientBuilder. */ - public AzureStackManagementClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; + public AzureStackManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; return this; } @@ -129,15 +128,12 @@ public AzureStackManagementClientImpl buildClient() { if (environment == null) { this.environment = AzureEnvironment.AZURE; } + if (pipeline == null) { + this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + } 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(); } 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 index 86920b3c6f49..c2d6f0c833e7 100644 --- 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 @@ -15,6 +15,7 @@ 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.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; @@ -24,7 +25,7 @@ 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.DeploymentLicensesClient; import com.azure.resourcemanager.azurestack.fluent.OperationsClient; import com.azure.resourcemanager.azurestack.fluent.ProductsClient; import com.azure.resourcemanager.azurestack.fluent.RegistrationsClient; @@ -34,15 +35,12 @@ 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. @@ -143,6 +141,18 @@ public CloudManifestFilesClient getCloudManifestFiles() { return this.cloudManifestFiles; } + /** The DeploymentLicensesClient object to access its operations. */ + private final DeploymentLicensesClient deploymentLicenses; + + /** + * Gets the DeploymentLicensesClient object to access its operations. + * + * @return the DeploymentLicensesClient object. + */ + public DeploymentLicensesClient getDeploymentLicenses() { + return this.deploymentLicenses; + } + /** The CustomerSubscriptionsClient object to access its operations. */ private final CustomerSubscriptionsClient customerSubscriptions; @@ -179,18 +189,6 @@ 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. * @@ -214,13 +212,13 @@ public LinkedSubscriptionsClient getLinkedSubscriptions() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2020-06-01-preview"; + this.apiVersion = "2022-06-01"; this.operations = new OperationsClientImpl(this); this.cloudManifestFiles = new CloudManifestFilesClientImpl(this); + this.deploymentLicenses = new DeploymentLicensesClientImpl(this); this.customerSubscriptions = new CustomerSubscriptionsClientImpl(this); this.products = new ProductsClientImpl(this); this.registrations = new RegistrationsClientImpl(this); - this.linkedSubscriptions = new LinkedSubscriptionsClientImpl(this); } /** @@ -239,10 +237,7 @@ public Context getContext() { * @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; + return CoreUtils.mergeContexts(this.getContext(), context); } /** @@ -306,7 +301,7 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, managementError = null; } } catch (IOException | RuntimeException ioe) { - logger.logThrowableAsWarning(ioe); + LOGGER.logThrowableAsWarning(ioe); } } } else { @@ -365,4 +360,6 @@ public Mono getBodyAsString(Charset charset) { return Mono.just(new String(responseBody, charset)); } } + + private static final ClientLogger LOGGER = new ClientLogger(AzureStackManagementClientImpl.class); } 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 index 7168ef38c2b7..c0ac92f88f0d 100644 --- 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 @@ -21,15 +21,12 @@ 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; @@ -82,7 +79,8 @@ Mono> get( * * @throws 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. + * @return cloud specific manifest GET response along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithResponseAsync() { @@ -106,7 +104,8 @@ private Mono> listWithResponseAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return cloud specific manifest GET response along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithResponseAsync(Context context) { @@ -126,19 +125,11 @@ private Mono> listWithResponseAsync(Con * * @throws 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. + * @return cloud specific manifest GET response on successful completion of {@link Mono}. */ @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(); - } - }); + return listWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -160,7 +151,7 @@ public CloudManifestFileResponseInner list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return cloud specific manifest GET response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response listWithResponse(Context context) { @@ -175,7 +166,8 @@ public Response listWithResponse(Context context * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return cloud specific manifest GET response along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -214,7 +206,8 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return cloud specific manifest GET response along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -249,19 +242,12 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return cloud specific manifest GET response on successful completion of {@link Mono}. */ @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(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -271,20 +257,13 @@ private Mono getAsync(String verificationVersion * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return cloud specific manifest GET response on successful completion of {@link Mono}. */ @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(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -311,7 +290,7 @@ public CloudManifestFileResponseInner get(String verificationVersion) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return cloud specific manifest GET response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( 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 index ef57d5072e04..1dc5a3540a3a 100644 --- 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 @@ -12,10 +12,9 @@ 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 static final ClientLogger LOGGER = new ClientLogger(CloudManifestFilesImpl.class); private final CloudManifestFilesClient innerClient; 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 index 825cd7cd7b98..af85ce72b753 100644 --- 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 @@ -4,7 +4,6 @@ package com.azure.resourcemanager.azurestack.implementation; -import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.azurestack.fluent.models.CustomerSubscriptionInner; import com.azure.resourcemanager.azurestack.models.CustomerSubscription; @@ -32,18 +31,14 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); + public String etag() { + return this.innerModel().etag(); } public String tenantId() { return this.innerModel().tenantId(); } - public String etag() { - return this.innerModel().etag(); - } - public CustomerSubscriptionInner innerModel() { return this.innerObject; } @@ -112,13 +107,13 @@ public CustomerSubscription refresh(Context context) { return this; } - public CustomerSubscriptionImpl withTenantId(String tenantId) { - this.innerModel().withTenantId(tenantId); + public CustomerSubscriptionImpl withEtag(String etag) { + this.innerModel().withEtag(etag); return this; } - public CustomerSubscriptionImpl withEtag(String etag) { - this.innerModel().withEtag(etag); + public CustomerSubscriptionImpl withTenantId(String tenantId) { + this.innerModel().withTenantId(tenantId); 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 index c10166ec199a..befe2e28d74d 100644 --- 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 @@ -28,7 +28,6 @@ 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; @@ -36,8 +35,6 @@ /** 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; @@ -146,7 +143,8 @@ Mono> listNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return pageable list of customer subscriptions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -204,7 +202,8 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return pageable list of customer subscriptions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -258,7 +257,7 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return pageable list of customer subscriptions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroup, String registrationName) { @@ -275,7 +274,7 @@ private PagedFlux listAsync(String resourceGroup, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return pageable list of customer subscriptions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( @@ -293,7 +292,7 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return pageable list of customer subscriptions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroup, String registrationName) { @@ -309,7 +308,7 @@ public PagedIterable list(String resourceGroup, Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return pageable list of customer subscriptions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( @@ -326,7 +325,7 @@ public PagedIterable list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return customer subscription along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -382,7 +381,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return customer subscription along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -434,20 +433,13 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return customer subscription on successful completion of {@link Mono}. */ @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(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -477,7 +469,7 @@ public CustomerSubscriptionInner get( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return customer subscription along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( @@ -494,7 +486,7 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -550,7 +542,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -602,12 +594,12 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroup, String registrationName, String customerSubscriptionName) { return deleteWithResponseAsync(resourceGroup, registrationName, customerSubscriptionName) - .flatMap((Response res) -> Mono.empty()); + .flatMap(ignored -> Mono.empty()); } /** @@ -635,7 +627,7 @@ public void delete(String resourceGroup, String registrationName, String custome * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse( @@ -653,7 +645,7 @@ public Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return customer subscription along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createWithResponseAsync( @@ -722,7 +714,7 @@ private Mono> createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return customer subscription along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createWithResponseAsync( @@ -788,7 +780,7 @@ private Mono> createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return customer subscription on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync( @@ -798,14 +790,7 @@ private Mono createAsync( CustomerSubscriptionInner customerCreationParameters) { return createWithResponseAsync( resourceGroup, registrationName, customerSubscriptionName, customerCreationParameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -841,7 +826,7 @@ public CustomerSubscriptionInner create( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return customer subscription along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createWithResponse( @@ -862,7 +847,8 @@ public Response createWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return pageable list of customer subscriptions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -898,7 +884,8 @@ private Mono> listNextSinglePageAsync(S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return pageable list of customer subscriptions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { 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 index 5aedb8764760..0a4c03c2808e 100644 --- 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 @@ -13,10 +13,9 @@ 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 static final ClientLogger LOGGER = new ClientLogger(CustomerSubscriptionsImpl.class); private final CustomerSubscriptionsClient innerClient; @@ -79,7 +78,7 @@ public Response deleteWithResponse( public CustomerSubscription getById(String id) { String resourceGroup = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroup == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -87,14 +86,14 @@ public CustomerSubscription getById(String id) { } String registrationName = Utils.getValueFromIdByName(id, "registrations"); if (registrationName == null) { - throw logger + 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 + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -108,7 +107,7 @@ public CustomerSubscription getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroup = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroup == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -116,14 +115,14 @@ public Response getByIdWithResponse(String id, Context con } String registrationName = Utils.getValueFromIdByName(id, "registrations"); if (registrationName == null) { - throw logger + 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 + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -137,7 +136,7 @@ public Response getByIdWithResponse(String id, Context con public void deleteById(String id) { String resourceGroup = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroup == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -145,14 +144,14 @@ public void deleteById(String id) { } String registrationName = Utils.getValueFromIdByName(id, "registrations"); if (registrationName == null) { - throw logger + 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 + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -160,13 +159,13 @@ public void deleteById(String id) { "The resource ID '%s' is not valid. Missing path segment 'customerSubscriptions'.", id))); } - this.deleteWithResponse(resourceGroup, registrationName, customerSubscriptionName, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroup, registrationName, customerSubscriptionName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { String resourceGroup = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroup == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -174,14 +173,14 @@ public Response deleteByIdWithResponse(String id, Context context) { } String registrationName = Utils.getValueFromIdByName(id, "registrations"); if (registrationName == null) { - throw logger + 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 + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/DeploymentLicenseResponseImpl.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/DeploymentLicenseResponseImpl.java new file mode 100644 index 000000000000..547626a9001a --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/DeploymentLicenseResponseImpl.java @@ -0,0 +1,44 @@ +// 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.fluent.models.DeploymentLicenseResponseInner; +import com.azure.resourcemanager.azurestack.models.DeploymentLicenseResponse; +import java.util.Collections; +import java.util.List; + +public final class DeploymentLicenseResponseImpl implements DeploymentLicenseResponse { + private DeploymentLicenseResponseInner innerObject; + + private final com.azure.resourcemanager.azurestack.AzureStackManager serviceManager; + + DeploymentLicenseResponseImpl( + DeploymentLicenseResponseInner innerObject, + com.azure.resourcemanager.azurestack.AzureStackManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List temporaryLicenseChain() { + List inner = this.innerModel().temporaryLicenseChain(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String signature() { + return this.innerModel().signature(); + } + + public DeploymentLicenseResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestack.AzureStackManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/DeploymentLicensesClientImpl.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/DeploymentLicensesClientImpl.java new file mode 100644 index 000000000000..dcef7a676a31 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/DeploymentLicensesClientImpl.java @@ -0,0 +1,204 @@ +// 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.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.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.resourcemanager.azurestack.fluent.DeploymentLicensesClient; +import com.azure.resourcemanager.azurestack.fluent.models.DeploymentLicenseResponseInner; +import com.azure.resourcemanager.azurestack.models.DeploymentLicenseRequest; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DeploymentLicensesClient. */ +public final class DeploymentLicensesClientImpl implements DeploymentLicensesClient { + /** The proxy service used to perform REST calls. */ + private final DeploymentLicensesService service; + + /** The service client containing this operation class. */ + private final AzureStackManagementClientImpl client; + + /** + * Initializes an instance of DeploymentLicensesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DeploymentLicensesClientImpl(AzureStackManagementClientImpl client) { + this.service = + RestProxy.create(DeploymentLicensesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackManagementClientDeploymentLicenses to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackManagement") + private interface DeploymentLicensesService { + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.AzureStack/generateDeploymentLicense") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DeploymentLicenseRequest deploymentLicenseRequest, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates a license that can be used to deploy an Azure Stack device. + * + * @param deploymentLicenseRequest Request body for creating a deployment license. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a license that can be used to deploy an Azure Stack device along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + DeploymentLicenseRequest deploymentLicenseRequest) { + 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 (deploymentLicenseRequest == null) { + return Mono + .error( + new IllegalArgumentException("Parameter deploymentLicenseRequest is required and cannot be null.")); + } else { + deploymentLicenseRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + deploymentLicenseRequest, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a license that can be used to deploy an Azure Stack device. + * + * @param deploymentLicenseRequest Request body for creating a deployment license. + * @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 a license that can be used to deploy an Azure Stack device along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + DeploymentLicenseRequest deploymentLicenseRequest, 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 (deploymentLicenseRequest == null) { + return Mono + .error( + new IllegalArgumentException("Parameter deploymentLicenseRequest is required and cannot be null.")); + } else { + deploymentLicenseRequest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + deploymentLicenseRequest, + accept, + context); + } + + /** + * Creates a license that can be used to deploy an Azure Stack device. + * + * @param deploymentLicenseRequest Request body for creating a deployment license. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a license that can be used to deploy an Azure Stack device on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(DeploymentLicenseRequest deploymentLicenseRequest) { + return createWithResponseAsync(deploymentLicenseRequest).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates a license that can be used to deploy an Azure Stack device. + * + * @param deploymentLicenseRequest Request body for creating a deployment license. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a license that can be used to deploy an Azure Stack device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentLicenseResponseInner create(DeploymentLicenseRequest deploymentLicenseRequest) { + return createAsync(deploymentLicenseRequest).block(); + } + + /** + * Creates a license that can be used to deploy an Azure Stack device. + * + * @param deploymentLicenseRequest Request body for creating a deployment license. + * @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 a license that can be used to deploy an Azure Stack device along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + DeploymentLicenseRequest deploymentLicenseRequest, Context context) { + return createWithResponseAsync(deploymentLicenseRequest, context).block(); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/DeploymentLicensesImpl.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/DeploymentLicensesImpl.java new file mode 100644 index 000000000000..334fbe2cb8ff --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/DeploymentLicensesImpl.java @@ -0,0 +1,61 @@ +// 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.fluent.DeploymentLicensesClient; +import com.azure.resourcemanager.azurestack.fluent.models.DeploymentLicenseResponseInner; +import com.azure.resourcemanager.azurestack.models.DeploymentLicenseRequest; +import com.azure.resourcemanager.azurestack.models.DeploymentLicenseResponse; +import com.azure.resourcemanager.azurestack.models.DeploymentLicenses; + +public final class DeploymentLicensesImpl implements DeploymentLicenses { + private static final ClientLogger LOGGER = new ClientLogger(DeploymentLicensesImpl.class); + + private final DeploymentLicensesClient innerClient; + + private final com.azure.resourcemanager.azurestack.AzureStackManager serviceManager; + + public DeploymentLicensesImpl( + DeploymentLicensesClient innerClient, com.azure.resourcemanager.azurestack.AzureStackManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public DeploymentLicenseResponse create(DeploymentLicenseRequest deploymentLicenseRequest) { + DeploymentLicenseResponseInner inner = this.serviceClient().create(deploymentLicenseRequest); + if (inner != null) { + return new DeploymentLicenseResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createWithResponse( + DeploymentLicenseRequest deploymentLicenseRequest, Context context) { + Response inner = + this.serviceClient().createWithResponse(deploymentLicenseRequest, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DeploymentLicenseResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private DeploymentLicensesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestack.AzureStackManager manager() { + return this.serviceManager; + } +} 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 index 0074c24c6c61..a23ab906ff1e 100644 --- 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 @@ -32,49 +32,45 @@ public String productKind() { return this.innerModel().productKind(); } - public ComputeRole computeRole() { - return this.innerModel().computeRole(); - } - - public Boolean isSystemExtension() { - return this.innerModel().isSystemExtension(); + public String version() { + return this.innerModel().version(); } - public Boolean supportMultipleExtensions() { - return this.innerModel().supportMultipleExtensions(); + public OsDiskImage osDiskImage() { + return this.innerModel().osDiskImage(); } - public String versionPropertiesVersion() { - return this.innerModel().versionPropertiesVersion(); + public List dataDiskImages() { + List inner = this.innerModel().dataDiskImages(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } } - public OperatingSystem vmOsType() { - return this.innerModel().vmOsType(); + public ComputeRole computeRole() { + return this.innerModel().computeRole(); } - public Boolean vmScaleSetEnabled() { - return this.innerModel().vmScaleSetEnabled(); + public Boolean isSystemExtension() { + return this.innerModel().isSystemExtension(); } public String uri() { return this.innerModel().uri(); } - public String version() { - return this.innerModel().version(); + public Boolean supportMultipleExtensions() { + return this.innerModel().supportMultipleExtensions(); } - public OsDiskImage osDiskImage() { - return this.innerModel().osDiskImage(); + public OperatingSystem vmOsType() { + return this.innerModel().vmOsType(); } - public List dataDiskImages() { - List inner = this.innerModel().dataDiskImages(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } + public Boolean vmScaleSetEnabled() { + return this.innerModel().vmScaleSetEnabled(); } public ExtendedProductInner innerModel() { 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 deleted file mode 100644 index fa447abcc952..000000000000 --- a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/LinkedSubscriptionImpl.java +++ /dev/null @@ -1,225 +0,0 @@ -// 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.management.SystemData; -import com.azure.core.util.Context; -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 java.util.Collections; -import java.util.Map; - -public final class LinkedSubscriptionImpl - implements LinkedSubscription, LinkedSubscription.Definition, LinkedSubscription.Update { - private LinkedSubscriptionInner innerObject; - - private final com.azure.resourcemanager.azurestack.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 com.azure.resourcemanager.azurestack.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, com.azure.resourcemanager.azurestack.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, com.azure.resourcemanager.azurestack.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 deleted file mode 100644 index 2e25338001a4..000000000000 --- a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/LinkedSubscriptionsClientImpl.java +++ /dev/null @@ -1,1254 +0,0 @@ -// 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * 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 deleted file mode 100644 index 3ac3cd0bbeae..000000000000 --- a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/LinkedSubscriptionsImpl.java +++ /dev/null @@ -1,178 +0,0 @@ -// 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.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 com.azure.resourcemanager.azurestack.AzureStackManager serviceManager; - - public LinkedSubscriptionsImpl( - LinkedSubscriptionsClient innerClient, com.azure.resourcemanager.azurestack.AzureStackManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByResourceGroup(String resourceGroup) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroup); - return Utils.mapPage(inner, inner1 -> new LinkedSubscriptionImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroup, Context context) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroup, context); - return Utils.mapPage(inner, inner1 -> new LinkedSubscriptionImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new LinkedSubscriptionImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, 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 com.azure.resourcemanager.azurestack.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/OperationsClientImpl.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/OperationsClientImpl.java index 6bd965ed58da..c0bfcd4b1952 100644 --- 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 @@ -25,7 +25,6 @@ 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; @@ -33,8 +32,6 @@ /** 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; @@ -85,7 +82,7 @@ Mono> listNext( * * @throws 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. + * @return list of Operations along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -118,7 +115,7 @@ private Mono> listSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return list of Operations along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -148,7 +145,7 @@ private Mono> listSinglePageAsync(Context context) * * @throws 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. + * @return list of Operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -162,7 +159,7 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return list of Operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -175,7 +172,7 @@ private PagedFlux listAsync(Context context) { * * @throws 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. + * @return list of Operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -189,7 +186,7 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return list of Operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -203,7 +200,7 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return list of Operations along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -239,7 +236,7 @@ private Mono> listNextSinglePageAsync(String nextL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return list of Operations along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { 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 index 6142e113527b..9c1e8814138a 100644 --- 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 @@ -11,10 +11,9 @@ 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 static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); private final OperationsClient innerClient; 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 index fc117af7a79b..86b021518ce4 100644 --- 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 @@ -4,7 +4,6 @@ package com.azure.resourcemanager.azurestack.implementation; -import com.azure.core.management.SystemData; import com.azure.resourcemanager.azurestack.fluent.models.ProductInner; import com.azure.resourcemanager.azurestack.models.Compatibility; import com.azure.resourcemanager.azurestack.models.IconUris; @@ -36,8 +35,8 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); + public String etag() { + return this.innerModel().etag(); } public String displayName() { @@ -117,10 +116,6 @@ public Compatibility compatibility() { return this.innerModel().compatibility(); } - public String etag() { - return this.innerModel().etag(); - } - public ProductInner innerModel() { return this.innerObject; } 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 index d152eaffa0f3..ce58fe931f2e 100644 --- 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 @@ -27,7 +27,6 @@ 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; @@ -39,8 +38,6 @@ /** 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; @@ -111,6 +108,23 @@ Mono> listDetails( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack" + + "/registrations/{registrationName}/products/{productName}/listProducts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listProducts( + @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" @@ -181,7 +195,7 @@ Mono> listNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return pageable list of products along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroup, String registrationName) { @@ -238,7 +252,7 @@ private Mono> listSinglePageAsync(String resourceGro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return pageable list of products along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -292,7 +306,7 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return pageable list of products as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroup, String registrationName) { @@ -309,7 +323,7 @@ private PagedFlux listAsync(String resourceGroup, String registrat * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return pageable list of products as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroup, String registrationName, Context context) { @@ -326,7 +340,7 @@ private PagedFlux listAsync(String resourceGroup, String registrat * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return pageable list of products as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroup, String registrationName) { @@ -342,7 +356,7 @@ public PagedIterable list(String resourceGroup, String registratio * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return pageable list of products as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroup, String registrationName, Context context) { @@ -358,7 +372,7 @@ public PagedIterable list(String resourceGroup, String registratio * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return product information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -412,7 +426,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return product information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -462,19 +476,12 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return product information on successful completion of {@link Mono}. */ @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(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -503,7 +510,7 @@ public ProductInner get(String resourceGroup, String registrationName, String pr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return product information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( @@ -520,7 +527,8 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return extended description about the product required for installing it into Azure Stack along with {@link + * Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDetailsWithResponseAsync( @@ -574,7 +582,8 @@ private Mono> listDetailsWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return extended description about the product required for installing it into Azure Stack along with {@link + * Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDetailsWithResponseAsync( @@ -624,20 +633,14 @@ private Mono> listDetailsWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return extended description about the product required for installing it into Azure Stack on successful + * completion of {@link Mono}. */ @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(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -666,7 +669,8 @@ public ExtendedProductInner listDetails(String resourceGroup, String registratio * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return extended description about the product required for installing it into Azure Stack along with {@link + * Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response listDetailsWithResponse( @@ -684,9 +688,206 @@ public Response listDetailsWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listProductsWithResponseAsync( + 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 + .listProducts( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroup, + registrationName, + productName, + this.client.getApiVersion(), + deviceConfiguration, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listProductsWithResponseAsync( + 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 + .listProducts( + 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listProductsAsync( + String resourceGroup, String registrationName, String productName, DeviceConfiguration deviceConfiguration) { + return listProductsWithResponseAsync(resourceGroup, registrationName, productName, deviceConfiguration) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listProductsAsync( + String resourceGroup, String registrationName, String productName) { + final DeviceConfiguration deviceConfiguration = null; + return listProductsWithResponseAsync(resourceGroup, registrationName, productName, deviceConfiguration) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 listProducts(String resourceGroup, String registrationName, String productName) { + final DeviceConfiguration deviceConfiguration = null; + return listProductsAsync(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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listProductsWithResponse( + String resourceGroup, + String registrationName, + String productName, + DeviceConfiguration deviceConfiguration, + Context context) { + return listProductsWithResponseAsync(resourceGroup, registrationName, productName, deviceConfiguration, 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getProductsWithResponseAsync( String resourceGroup, String registrationName, String productName, DeviceConfiguration deviceConfiguration) { if (this.client.getEndpoint() == null) { @@ -743,7 +944,7 @@ private Mono> getProductsWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return pageable list of products along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getProductsWithResponseAsync( @@ -802,20 +1003,13 @@ private Mono> getProductsWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return pageable list of products on successful completion of {@link Mono}. */ @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(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -827,20 +1021,13 @@ private Mono getProductsAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return pageable list of products on successful completion of {@link Mono}. */ @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(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -871,7 +1058,7 @@ public ProductListInner getProducts(String resourceGroup, String registrationNam * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return pageable list of products along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getProductsWithResponse( @@ -894,7 +1081,7 @@ public Response getProductsWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return product information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getProductWithResponseAsync( @@ -953,7 +1140,7 @@ private Mono> getProductWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return product information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getProductWithResponseAsync( @@ -1012,20 +1199,13 @@ private Mono> getProductWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return product information on successful completion of {@link Mono}. */ @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(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1037,20 +1217,13 @@ private Mono getProductAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return product information on successful completion of {@link Mono}. */ @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(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1081,7 +1254,7 @@ public ProductInner getProduct(String resourceGroup, String registrationName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return product information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getProductWithResponse( @@ -1104,7 +1277,7 @@ public Response getProductWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return product action log along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> uploadLogWithResponseAsync( @@ -1166,7 +1339,7 @@ private Mono> uploadLogWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return product action log along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> uploadLogWithResponseAsync( @@ -1225,7 +1398,7 @@ private Mono> uploadLogWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return product action log on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono uploadLogAsync( @@ -1234,14 +1407,7 @@ private Mono uploadLogAsync( 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(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1253,20 +1419,13 @@ private Mono uploadLogAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return product action log on successful completion of {@link Mono}. */ @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(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1297,7 +1456,7 @@ public ProductLogInner uploadLog(String resourceGroup, String registrationName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return product action log along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response uploadLogWithResponse( @@ -1318,7 +1477,7 @@ public Response uploadLogWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return pageable list of products along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1354,7 +1513,7 @@ private Mono> listNextSinglePageAsync(String nextLin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return pageable list of products along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { 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 index d9e8033529b6..0a7d2c4cecff 100644 --- 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 @@ -21,10 +21,9 @@ 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 static final ClientLogger LOGGER = new ClientLogger(ProductsImpl.class); private final ProductsClient innerClient; @@ -94,6 +93,36 @@ public Response listDetailsWithResponse( } } + public ProductList listProducts(String resourceGroup, String registrationName, String productName) { + ProductListInner inner = this.serviceClient().listProducts(resourceGroup, registrationName, productName); + if (inner != null) { + return new ProductListImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listProductsWithResponse( + String resourceGroup, + String registrationName, + String productName, + DeviceConfiguration deviceConfiguration, + Context context) { + Response inner = + this + .serviceClient() + .listProductsWithResponse(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 ProductList getProducts(String resourceGroup, String registrationName, String productName) { ProductListInner inner = this.serviceClient().getProducts(resourceGroup, registrationName, productName); if (inner != null) { 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 index 7a1c7ecf4744..7583641b0f08 100644 --- 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 @@ -6,7 +6,6 @@ import com.azure.core.http.rest.Response; import com.azure.core.management.Region; -import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.azurestack.fluent.models.RegistrationInner; import com.azure.resourcemanager.azurestack.models.ActivationKeyResult; @@ -46,6 +45,10 @@ public Map tags() { } } + public String etag() { + return this.innerModel().etag(); + } + public String objectId() { return this.innerModel().objectId(); } @@ -58,18 +61,6 @@ 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()); } @@ -78,6 +69,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroup; + } + public RegistrationInner innerModel() { return this.innerObject; } 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 index e73366114a72..89d8a7bb3707 100644 --- 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 @@ -30,7 +30,6 @@ 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; @@ -40,8 +39,6 @@ /** 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; @@ -80,6 +77,17 @@ Mono> listByResourceGroup( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureStack/registrations") + @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" @@ -180,6 +188,16 @@ Mono> listNext( @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); } /** @@ -189,7 +207,7 @@ Mono> listNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return pageable list of registrations along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroup) { @@ -240,7 +258,7 @@ private Mono> listByResourceGroupSinglePageAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return pageable list of registrations along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -288,7 +306,7 @@ private Mono> listByResourceGroupSinglePageAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return pageable list of registrations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroup) { @@ -304,7 +322,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return pageable list of registrations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroup, Context context) { @@ -320,7 +338,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return pageable list of registrations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroup) { @@ -335,13 +353,154 @@ public PagedIterable listByResourceGroup(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return pageable list of registrations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroup, Context context) { return new PagedIterable<>(listByResourceGroupAsync(resourceGroup, context)); } + /** + * Returns a list of all registrations 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 pageable list of registrations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a list of all registrations 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 pageable list of registrations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 registrations 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 pageable list of registrations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Returns a list of all registrations 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 pageable list of registrations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns a list of all registrations 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 pageable list of registrations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Returns a list of all registrations 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 pageable list of registrations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + /** * Returns the properties of an Azure Stack registration. * @@ -350,7 +509,7 @@ public PagedIterable listByResourceGroup(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return registration information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -399,7 +558,7 @@ private Mono> getByResourceGroupWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return registration information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -444,19 +603,12 @@ private Mono> getByResourceGroupWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return registration information on successful completion of {@link Mono}. */ @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(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -483,7 +635,7 @@ public RegistrationInner getByResourceGroup(String resourceGroup, String registr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return registration information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse( @@ -499,7 +651,7 @@ public Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroup, String registrationName) { @@ -547,7 +699,7 @@ private Mono> deleteWithResponseAsync(String resourceGroup, Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -592,11 +744,11 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroup, String registrationName) { - return deleteWithResponseAsync(resourceGroup, registrationName).flatMap((Response res) -> Mono.empty()); + return deleteWithResponseAsync(resourceGroup, registrationName).flatMap(ignored -> Mono.empty()); } /** @@ -622,7 +774,7 @@ public void delete(String resourceGroup, String registrationName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroup, String registrationName, Context context) { @@ -638,7 +790,7 @@ public Response deleteWithResponse(String resourceGroup, String registrati * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return registration information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -694,7 +846,7 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return registration information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -746,20 +898,13 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return registration information on successful completion of {@link Mono}. */ @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(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -789,7 +934,7 @@ public RegistrationInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return registration information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse( @@ -806,7 +951,7 @@ public Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return registration information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -862,7 +1007,7 @@ private Mono> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return registration information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -914,20 +1059,13 @@ private Mono> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return registration information on successful completion of {@link Mono}. */ @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(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -956,7 +1094,7 @@ public RegistrationInner update(String resourceGroup, String registrationName, R * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return registration information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( @@ -972,7 +1110,8 @@ public Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return the resource containing the Azure Stack activation key along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getActivationKeyWithResponseAsync( @@ -1021,7 +1160,8 @@ private Mono> getActivationKeyWithResponseAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return the resource containing the Azure Stack activation key along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getActivationKeyWithResponseAsync( @@ -1066,19 +1206,12 @@ private Mono> getActivationKeyWithResponseAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return the resource containing the Azure Stack activation key on successful completion of {@link Mono}. */ @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(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1105,7 +1238,7 @@ public ActivationKeyResultInner getActivationKey(String resourceGroup, String re * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return the resource containing the Azure Stack activation key along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getActivationKeyWithResponse( @@ -1121,7 +1254,7 @@ public Response getActivationKeyWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> enableRemoteManagementWithResponseAsync( @@ -1169,7 +1302,7 @@ private Mono> enableRemoteManagementWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> enableRemoteManagementWithResponseAsync( @@ -1213,12 +1346,12 @@ private Mono> enableRemoteManagementWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono enableRemoteManagementAsync(String resourceGroup, String registrationName) { return enableRemoteManagementWithResponseAsync(resourceGroup, registrationName) - .flatMap((Response res) -> Mono.empty()); + .flatMap(ignored -> Mono.empty()); } /** @@ -1244,7 +1377,7 @@ public void enableRemoteManagement(String resourceGroup, String registrationName * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response enableRemoteManagementWithResponse( @@ -1259,7 +1392,7 @@ public Response enableRemoteManagementWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return pageable list of registrations along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1295,7 +1428,7 @@ private Mono> listNextSinglePageAsync(String ne * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return pageable list of registrations along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -1322,4 +1455,77 @@ private Mono> listNextSinglePageAsync(String ne 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 pageable list of registrations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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/RegistrationsImpl.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/implementation/RegistrationsImpl.java index 8876a6eea40f..2fbb584da5a7 100644 --- 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 @@ -15,10 +15,9 @@ 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 static final ClientLogger LOGGER = new ClientLogger(RegistrationsImpl.class); private final RegistrationsClient innerClient; @@ -40,6 +39,16 @@ public PagedIterable listByResourceGroup(String resourceGroup, Con return Utils.mapPage(inner, inner1 -> new RegistrationImpl(inner1, this.manager())); } + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new RegistrationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new RegistrationImpl(inner1, this.manager())); + } + public Registration getByResourceGroup(String resourceGroup, String registrationName) { RegistrationInner inner = this.serviceClient().getByResourceGroup(resourceGroup, registrationName); if (inner != null) { @@ -108,7 +117,7 @@ public Response enableRemoteManagementWithResponse( public Registration getById(String id) { String resourceGroup = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroup == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -116,7 +125,7 @@ public Registration getById(String id) { } String registrationName = Utils.getValueFromIdByName(id, "registrations"); if (registrationName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'registrations'.", id))); @@ -127,7 +136,7 @@ public Registration getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroup = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroup == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -135,7 +144,7 @@ public Response getByIdWithResponse(String id, Context context) { } String registrationName = Utils.getValueFromIdByName(id, "registrations"); if (registrationName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'registrations'.", id))); @@ -146,7 +155,7 @@ public Response getByIdWithResponse(String id, Context context) { public void deleteById(String id) { String resourceGroup = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroup == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -154,18 +163,18 @@ public void deleteById(String id) { } String registrationName = Utils.getValueFromIdByName(id, "registrations"); if (registrationName == null) { - throw logger + 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(); + this.deleteWithResponse(resourceGroup, registrationName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { String resourceGroup = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroup == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -173,7 +182,7 @@ public Response deleteByIdWithResponse(String id, Context context) { } String registrationName = Utils.getValueFromIdByName(id, "registrations"); if (registrationName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'registrations'.", id))); 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 index d0f116983677..df14a0cbd8f6 100644 --- 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 @@ -27,7 +27,11 @@ public static Category fromString(String name) { return fromString(name, Category.class); } - /** @return known Category values. */ + /** + * Gets known Category values. + * + * @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 index 7a384ffc37be..9140c3695bfe 100644 --- 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 @@ -5,17 +5,12 @@ 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.azure.resourcemanager.azurestack.fluent.models.CloudManifestFileEnvironmentEndpoints; 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); - +public final class CloudManifestFileDeploymentData { /* * Dsms external certificates. */ @@ -29,16 +24,10 @@ public class CloudManifestFileDeploymentData { private String customCloudVerificationKey; /* - * ARM endpoint. + * Environment endpoints. */ - @JsonProperty(value = "customEnvironmentEndpoints.customCloudArmEndpoint") - private String customCloudArmEndpoint; - - /* - * Dsms endpoint. - */ - @JsonProperty(value = "customEnvironmentEndpoints.externalDsmsEndpoint") - private String externalDsmsEndpoint; + @JsonProperty(value = "customEnvironmentEndpoints") + private CloudManifestFileEnvironmentEndpoints innerCustomEnvironmentEndpoints; /** * Get the externalDsmsCertificates property: Dsms external certificates. @@ -80,13 +69,24 @@ public CloudManifestFileDeploymentData withCustomCloudVerificationKey(String cus return this; } + /** + * Get the innerCustomEnvironmentEndpoints property: Environment endpoints. + * + * @return the innerCustomEnvironmentEndpoints value. + */ + private CloudManifestFileEnvironmentEndpoints innerCustomEnvironmentEndpoints() { + return this.innerCustomEnvironmentEndpoints; + } + /** * Get the customCloudArmEndpoint property: ARM endpoint. * * @return the customCloudArmEndpoint value. */ public String customCloudArmEndpoint() { - return this.customCloudArmEndpoint; + return this.innerCustomEnvironmentEndpoints() == null + ? null + : this.innerCustomEnvironmentEndpoints().customCloudArmEndpoint(); } /** @@ -96,7 +96,10 @@ public String customCloudArmEndpoint() { * @return the CloudManifestFileDeploymentData object itself. */ public CloudManifestFileDeploymentData withCustomCloudArmEndpoint(String customCloudArmEndpoint) { - this.customCloudArmEndpoint = customCloudArmEndpoint; + if (this.innerCustomEnvironmentEndpoints() == null) { + this.innerCustomEnvironmentEndpoints = new CloudManifestFileEnvironmentEndpoints(); + } + this.innerCustomEnvironmentEndpoints().withCustomCloudArmEndpoint(customCloudArmEndpoint); return this; } @@ -106,7 +109,9 @@ public CloudManifestFileDeploymentData withCustomCloudArmEndpoint(String customC * @return the externalDsmsEndpoint value. */ public String externalDsmsEndpoint() { - return this.externalDsmsEndpoint; + return this.innerCustomEnvironmentEndpoints() == null + ? null + : this.innerCustomEnvironmentEndpoints().externalDsmsEndpoint(); } /** @@ -116,7 +121,10 @@ public String externalDsmsEndpoint() { * @return the CloudManifestFileDeploymentData object itself. */ public CloudManifestFileDeploymentData withExternalDsmsEndpoint(String externalDsmsEndpoint) { - this.externalDsmsEndpoint = externalDsmsEndpoint; + if (this.innerCustomEnvironmentEndpoints() == null) { + this.innerCustomEnvironmentEndpoints = new CloudManifestFileEnvironmentEndpoints(); + } + this.innerCustomEnvironmentEndpoints().withExternalDsmsEndpoint(externalDsmsEndpoint); return this; } @@ -126,5 +134,8 @@ public CloudManifestFileDeploymentData withExternalDsmsEndpoint(String externalD * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerCustomEnvironmentEndpoints() != null) { + innerCustomEnvironmentEndpoints().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 index 7f6278f7f8cd..565e339c3fd4 100644 --- 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 @@ -5,15 +5,11 @@ 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. */ 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 index 38f0d07d3be5..4bc388c04f4b 100644 --- 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 @@ -25,7 +25,7 @@ public interface CloudManifestFiles { * @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. + * @return cloud specific manifest GET response along with {@link Response}. */ Response listWithResponse(Context context); @@ -49,7 +49,7 @@ public interface CloudManifestFiles { * @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. + * @return cloud specific manifest GET response along with {@link 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 index 1162ee4cbe32..483f3e6b9987 100644 --- 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 @@ -5,16 +5,12 @@ 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 */ 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 index cc75569d3102..71e822ea3117 100644 --- 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 @@ -55,7 +55,11 @@ public static CompatibilityIssue fromString(String name) { return fromString(name, CompatibilityIssue.class); } - /** @return known CompatibilityIssue values. */ + /** + * Gets known CompatibilityIssue values. + * + * @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 index a3456618a7fc..074b398a231e 100644 --- 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 @@ -30,7 +30,11 @@ public static ComputeRole fromString(String name) { return fromString(name, ComputeRole.class); } - /** @return known ComputeRole values. */ + /** + * Gets known ComputeRole values. + * + * @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/CustomerSubscription.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/CustomerSubscription.java index 6076c8b60883..258f50a01c8a 100644 --- 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 @@ -4,7 +4,6 @@ package com.azure.resourcemanager.azurestack.models; -import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.azurestack.fluent.models.CustomerSubscriptionInner; @@ -32,11 +31,11 @@ public interface CustomerSubscription { String type(); /** - * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * Gets the etag property: The entity tag used for optimistic concurrency when modifying the resource. * - * @return the systemData value. + * @return the etag value. */ - SystemData systemData(); + String etag(); /** * Gets the tenantId property: Tenant Id. @@ -45,13 +44,6 @@ public interface CustomerSubscription { */ 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. * @@ -83,7 +75,7 @@ interface WithParentResource { * 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 { + interface WithCreate extends DefinitionStages.WithEtag, DefinitionStages.WithTenantId { /** * Executes the create request. * @@ -99,16 +91,6 @@ interface WithCreate extends DefinitionStages.WithTenantId, DefinitionStages.Wit */ 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 { /** @@ -119,6 +101,16 @@ interface WithEtag { */ WithCreate withEtag(String etag); } + /** 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); + } } /** * Refreshes the resource to sync with Azure. 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 index 1393b0977436..b0af28a7a69d 100644 --- 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 @@ -5,17 +5,13 @@ 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. */ 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 index 86e4d68275a6..666b9c8e9449 100644 --- 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 @@ -18,7 +18,7 @@ public interface CustomerSubscriptions { * @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. + * @return pageable list of customer subscriptions as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroup, String registrationName); @@ -31,7 +31,7 @@ public interface CustomerSubscriptions { * @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. + * @return pageable list of customer subscriptions as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroup, String registrationName, Context context); @@ -58,7 +58,7 @@ public interface CustomerSubscriptions { * @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. + * @return customer subscription along with {@link Response}. */ Response getWithResponse( String resourceGroup, String registrationName, String customerSubscriptionName, Context context); @@ -85,7 +85,7 @@ Response getWithResponse( * @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. + * @return the {@link Response}. */ Response deleteWithResponse( String resourceGroup, String registrationName, String customerSubscriptionName, Context context); @@ -97,7 +97,7 @@ Response deleteWithResponse( * @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. + * @return customer subscription along with {@link Response}. */ CustomerSubscription getById(String id); @@ -109,7 +109,7 @@ Response deleteWithResponse( * @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. + * @return customer subscription along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); @@ -131,7 +131,7 @@ Response deleteWithResponse( * @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. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); 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 index 27626083bc78..fab8f53753b2 100644 --- 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 @@ -5,15 +5,11 @@ 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. */ diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/DeploymentLicenseRequest.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/DeploymentLicenseRequest.java new file mode 100644 index 000000000000..3be922c266db --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/DeploymentLicenseRequest.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Request details for generating a deployment license. */ +@Fluent +public final class DeploymentLicenseRequest { + /* + * Signing verification public key version. + */ + @JsonProperty(value = "verificationVersion") + private String verificationVersion; + + /** + * Get the verificationVersion property: Signing verification public key version. + * + * @return the verificationVersion value. + */ + public String verificationVersion() { + return this.verificationVersion; + } + + /** + * Set the verificationVersion property: Signing verification public key version. + * + * @param verificationVersion the verificationVersion value to set. + * @return the DeploymentLicenseRequest object itself. + */ + public DeploymentLicenseRequest withVerificationVersion(String verificationVersion) { + this.verificationVersion = verificationVersion; + 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/DeploymentLicenseResponse.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/DeploymentLicenseResponse.java new file mode 100644 index 000000000000..35e834cae43a --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/DeploymentLicenseResponse.java @@ -0,0 +1,33 @@ +// 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.DeploymentLicenseResponseInner; +import java.util.List; + +/** An immutable client-side representation of DeploymentLicenseResponse. */ +public interface DeploymentLicenseResponse { + /** + * Gets the temporaryLicenseChain property: A license chain that can be used to temporarily activate an Azure Stack + * device. + * + * @return the temporaryLicenseChain value. + */ + List temporaryLicenseChain(); + + /** + * Gets the signature property: Signature of the license chain. + * + * @return the signature value. + */ + String signature(); + + /** + * Gets the inner com.azure.resourcemanager.azurestack.fluent.models.DeploymentLicenseResponseInner object. + * + * @return the inner object. + */ + DeploymentLicenseResponseInner innerModel(); +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/DeploymentLicenses.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/DeploymentLicenses.java new file mode 100644 index 000000000000..a31ecab743ce --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/DeploymentLicenses.java @@ -0,0 +1,35 @@ +// 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 DeploymentLicenses. */ +public interface DeploymentLicenses { + /** + * Creates a license that can be used to deploy an Azure Stack device. + * + * @param deploymentLicenseRequest Request body for creating a deployment license. + * @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 a license that can be used to deploy an Azure Stack device. + */ + DeploymentLicenseResponse create(DeploymentLicenseRequest deploymentLicenseRequest); + + /** + * Creates a license that can be used to deploy an Azure Stack device. + * + * @param deploymentLicenseRequest Request body for creating a deployment license. + * @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 a license that can be used to deploy an Azure Stack device along with {@link Response}. + */ + Response createWithResponse( + DeploymentLicenseRequest deploymentLicenseRequest, Context context); +} 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 index 3bb6c87d9895..982ddd7d0350 100644 --- 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 @@ -5,15 +5,11 @@ 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. */ 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 index 7c4abe3f93d1..6c4821b5d949 100644 --- 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 @@ -5,15 +5,11 @@ 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. */ 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 index bf07e51282f9..f43e1c038ce8 100644 --- 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 @@ -25,46 +25,39 @@ public interface ExtendedProduct { 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. + * Gets the version property: Specifies product version. * - * @return the isSystemExtension value. + * @return the version value. */ - Boolean isSystemExtension(); + String version(); /** - * Gets the supportMultipleExtensions property: Indicates if specified product supports multiple extensions. + * Gets the osDiskImage property: OS disk image used by product. * - * @return the supportMultipleExtensions value. + * @return the osDiskImage value. */ - Boolean supportMultipleExtensions(); + OsDiskImage osDiskImage(); /** - * Gets the versionPropertiesVersion property: Specifies product version. + * Gets the dataDiskImages property: List of attached data disks. * - * @return the versionPropertiesVersion value. + * @return the dataDiskImages value. */ - String versionPropertiesVersion(); + List dataDiskImages(); /** - * Gets the vmOsType property: Specifies operating system used by the product. + * Gets the computeRole property: Specifies kind of compute role included in the package. * - * @return the vmOsType value. + * @return the computeRole value. */ - OperatingSystem vmOsType(); + ComputeRole computeRole(); /** - * Gets the vmScaleSetEnabled property: Indicates if virtual machine Scale Set is enabled in the specified product. + * Gets the isSystemExtension property: Specifies if product is a Virtual Machine Extension. * - * @return the vmScaleSetEnabled value. + * @return the isSystemExtension value. */ - Boolean vmScaleSetEnabled(); + Boolean isSystemExtension(); /** * Gets the uri property: The URI. @@ -74,25 +67,25 @@ public interface ExtendedProduct { String uri(); /** - * Gets the version property: Specifies product version. + * Gets the supportMultipleExtensions property: Indicates if specified product supports multiple extensions. * - * @return the version value. + * @return the supportMultipleExtensions value. */ - String version(); + Boolean supportMultipleExtensions(); /** - * Gets the osDiskImage property: OS disk image used by product. + * Gets the vmOsType property: Specifies operating system used by the product. * - * @return the osDiskImage value. + * @return the vmOsType value. */ - OsDiskImage osDiskImage(); + OperatingSystem vmOsType(); /** - * Gets the dataDiskImages property: List of attached data disks. + * Gets the vmScaleSetEnabled property: Indicates if virtual machine Scale Set is enabled in the specified product. * - * @return the dataDiskImages value. + * @return the vmScaleSetEnabled value. */ - List dataDiskImages(); + Boolean vmScaleSetEnabled(); /** * Gets the inner com.azure.resourcemanager.azurestack.fluent.models.ExtendedProductInner object. 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 index 664545c9b1f5..e48607794b6c 100644 --- 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 @@ -5,15 +5,11 @@ 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. */ 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 deleted file mode 100644 index a5c9af45d705..000000000000 --- a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/LinkedSubscription.java +++ /dev/null @@ -1,280 +0,0 @@ -// 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.management.SystemData; -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 deleted file mode 100644 index cc85602cd0d7..000000000000 --- a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/LinkedSubscriptionParameter.java +++ /dev/null @@ -1,122 +0,0 @@ -// 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 deleted file mode 100644 index 3e2497159757..000000000000 --- a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/LinkedSubscriptions.java +++ /dev/null @@ -1,158 +0,0 @@ -// 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 deleted file mode 100644 index 1e38a09ffdaa..000000000000 --- a/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/LinkedSubscriptionsList.java +++ /dev/null @@ -1,81 +0,0 @@ -// 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 index 4c37162bfd2e..acc57933f86a 100644 --- 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 @@ -24,7 +24,11 @@ public static Location fromString(String name) { return fromString(name, Location.class); } - /** @return known Location values. */ + /** + * Gets known Location values. + * + * @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 index fca64ec17fa5..02a801666055 100644 --- 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 @@ -5,15 +5,11 @@ 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. */ 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 index c18aa793f041..6bc1e2954dad 100644 --- 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 @@ -30,7 +30,11 @@ public static OperatingSystem fromString(String name) { return fromString(name, OperatingSystem.class); } - /** @return known OperatingSystem values. */ + /** + * Gets known OperatingSystem values. + * + * @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/OperationList.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/main/java/com/azure/resourcemanager/azurestack/models/OperationList.java index 7e4b41bc1d4a..01b94c6c1341 100644 --- 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 @@ -5,17 +5,13 @@ 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 */ 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 index 649b3eb660f1..cafe78df800b 100644 --- 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 @@ -14,7 +14,7 @@ public interface 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. + * @return list of Operations as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -25,7 +25,7 @@ public interface Operations { * @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. + * @return list of Operations as paginated response with {@link PagedIterable}. */ 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 index 1bb9086f456b..8dfc2ba9bbef 100644 --- 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 @@ -5,15 +5,11 @@ 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. */ 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 index fb95c4172b3e..58ef108a6e11 100644 --- 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 @@ -4,7 +4,6 @@ package com.azure.resourcemanager.azurestack.models; -import com.azure.core.management.SystemData; import com.azure.resourcemanager.azurestack.fluent.models.ProductInner; import java.util.List; @@ -32,11 +31,11 @@ public interface Product { String type(); /** - * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * Gets the etag property: The entity tag used for optimistic concurrency when modifying the resource. * - * @return the systemData value. + * @return the etag value. */ - SystemData systemData(); + String etag(); /** * Gets the displayName property: The display name of the product. @@ -164,13 +163,6 @@ public interface Product { */ 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. * 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 index 34c3bb4f6c87..e9ecd0e38bdb 100644 --- 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 @@ -5,15 +5,11 @@ 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. */ 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 index 31cd68b7c563..0c7a44e618e6 100644 --- 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 @@ -5,15 +5,11 @@ 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. */ 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 index 0c9a79d97c4c..b444adb3b9cb 100644 --- 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 @@ -18,7 +18,7 @@ public interface Products { * @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. + * @return pageable list of products as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroup, String registrationName); @@ -31,7 +31,7 @@ public interface Products { * @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. + * @return pageable list of products as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroup, String registrationName, Context context); @@ -58,7 +58,7 @@ public interface Products { * @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. + * @return product information along with {@link Response}. */ Response getWithResponse( String resourceGroup, String registrationName, String productName, Context context); @@ -86,7 +86,8 @@ Response getWithResponse( * @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. + * @return extended description about the product required for installing it into Azure Stack along with {@link + * Response}. */ Response listDetailsWithResponse( String resourceGroup, String registrationName, String productName, Context context); @@ -102,7 +103,7 @@ Response listDetailsWithResponse( * @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); + ProductList listProducts(String resourceGroup, String registrationName, String productName); /** * Returns a list of products. @@ -115,8 +116,41 @@ Response listDetailsWithResponse( * @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 along with {@link Response}. + */ + Response listProductsWithResponse( + String resourceGroup, + String registrationName, + String productName, + DeviceConfiguration deviceConfiguration, + 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 along with {@link Response}. + */ Response getProductsWithResponse( String resourceGroup, String registrationName, @@ -148,7 +182,7 @@ Response getProductsWithResponse( * @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. + * @return product information along with {@link Response}. */ Response getProductWithResponse( String resourceGroup, @@ -181,7 +215,7 @@ Response getProductWithResponse( * @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. + * @return product action log along with {@link Response}. */ Response uploadLogWithResponse( String resourceGroup, 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 index 23210d4b906c..62dc311b8f53 100644 --- 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 @@ -6,7 +6,6 @@ import com.azure.core.http.rest.Response; import com.azure.core.management.Region; -import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.azurestack.fluent.models.RegistrationInner; import java.util.Map; @@ -48,6 +47,13 @@ public interface Registration { */ Map tags(); + /** + * Gets the etag property: The entity tag used for optimistic concurrency when modifying the resource. + * + * @return the etag value. + */ + String etag(); + /** * Gets the objectId property: The object identifier associated with the Azure Stack connecting to Azure. * @@ -69,27 +75,6 @@ public interface Registration { */ 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. * @@ -104,6 +89,13 @@ public interface Registration { */ String regionName(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.azurestack.fluent.models.RegistrationInner object. * @@ -243,7 +235,7 @@ interface WithRegistrationToken { * @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. + * @return the resource containing the Azure Stack activation key along with {@link Response}. */ Response getActivationKeyWithResponse(Context context); @@ -262,7 +254,7 @@ interface WithRegistrationToken { * @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. + * @return the {@link 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 index 4755525e402a..a4d0ea3037f6 100644 --- 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 @@ -5,17 +5,13 @@ 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. */ 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 index 1b5a91f04e1a..329a54c2aa14 100644 --- 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 @@ -5,16 +5,18 @@ 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.azure.resourcemanager.azurestack.fluent.models.RegistrationParameterProperties; import com.fasterxml.jackson.annotation.JsonProperty; /** Registration resource. */ -@JsonFlatten @Fluent -public class RegistrationParameter { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RegistrationParameter.class); +public final class RegistrationParameter { + /* + * Properties of the Azure Stack registration resource + */ + @JsonProperty(value = "properties", required = true) + private RegistrationParameterProperties innerProperties = new RegistrationParameterProperties(); /* * Location of the resource. @@ -22,11 +24,14 @@ public class RegistrationParameter { @JsonProperty(value = "location", required = true) private Location location; - /* - * The token identifying registered Azure Stack + /** + * Get the innerProperties property: Properties of the Azure Stack registration resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.registrationToken", required = true) - private String registrationToken; + private RegistrationParameterProperties innerProperties() { + return this.innerProperties; + } /** * Get the location property: Location of the resource. @@ -54,7 +59,7 @@ public RegistrationParameter withLocation(Location location) { * @return the registrationToken value. */ public String registrationToken() { - return this.registrationToken; + return this.innerProperties() == null ? null : this.innerProperties().registrationToken(); } /** @@ -64,7 +69,10 @@ public String registrationToken() { * @return the RegistrationParameter object itself. */ public RegistrationParameter withRegistrationToken(String registrationToken) { - this.registrationToken = registrationToken; + if (this.innerProperties() == null) { + this.innerProperties = new RegistrationParameterProperties(); + } + this.innerProperties().withRegistrationToken(registrationToken); return this; } @@ -74,16 +82,20 @@ public RegistrationParameter withRegistrationToken(String registrationToken) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (location() == null) { - throw logger + if (innerProperties() == null) { + throw LOGGER .logExceptionAsError( - new IllegalArgumentException("Missing required property location in model RegistrationParameter")); + new IllegalArgumentException( + "Missing required property innerProperties in model RegistrationParameter")); + } else { + innerProperties().validate(); } - if (registrationToken() == null) { - throw logger + if (location() == null) { + throw LOGGER .logExceptionAsError( - new IllegalArgumentException( - "Missing required property registrationToken in model RegistrationParameter")); + new IllegalArgumentException("Missing required property location in model RegistrationParameter")); } } + + private static final ClientLogger LOGGER = new ClientLogger(RegistrationParameter.class); } 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 index 0f4b81ae0c20..f443a8b8039a 100644 --- 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 @@ -17,7 +17,7 @@ public interface Registrations { * @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. + * @return pageable list of registrations as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroup); @@ -29,10 +29,30 @@ public interface Registrations { * @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. + * @return pageable list of registrations as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroup, Context context); + /** + * Returns a list of all registrations 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 pageable list of registrations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Returns a list of all registrations 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 pageable list of registrations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + /** * Returns the properties of an Azure Stack registration. * @@ -54,7 +74,7 @@ public interface Registrations { * @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. + * @return registration information along with {@link Response}. */ Response getByResourceGroupWithResponse( String resourceGroup, String registrationName, Context context); @@ -79,7 +99,7 @@ Response getByResourceGroupWithResponse( * @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. + * @return the {@link Response}. */ Response deleteWithResponse(String resourceGroup, String registrationName, Context context); @@ -104,7 +124,7 @@ Response getByResourceGroupWithResponse( * @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. + * @return the resource containing the Azure Stack activation key along with {@link Response}. */ Response getActivationKeyWithResponse( String resourceGroup, String registrationName, Context context); @@ -129,7 +149,7 @@ Response getActivationKeyWithResponse( * @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. + * @return the {@link Response}. */ Response enableRemoteManagementWithResponse(String resourceGroup, String registrationName, Context context); @@ -140,7 +160,7 @@ Response getActivationKeyWithResponse( * @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. + * @return registration information along with {@link Response}. */ Registration getById(String id); @@ -152,7 +172,7 @@ Response getActivationKeyWithResponse( * @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. + * @return registration information along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); @@ -174,7 +194,7 @@ Response getActivationKeyWithResponse( * @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. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); 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 index 09b34d993473..bdded9d9b683 100644 --- 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 @@ -5,17 +5,12 @@ 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.azure.resourcemanager.azurestack.fluent.models.Uri; 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. */ @@ -28,6 +23,12 @@ public class VirtualMachineExtensionProductProperties { @JsonProperty(value = "isSystemExtension", access = JsonProperty.Access.WRITE_ONLY) private Boolean isSystemExtension; + /* + * Specifies a download location where content can be downloaded from. + */ + @JsonProperty(value = "sourceBlob", access = JsonProperty.Access.WRITE_ONLY) + private Uri innerSourceBlob; + /* * Indicates if specified product supports multiple extensions. */ @@ -53,12 +54,6 @@ public class VirtualMachineExtensionProductProperties { @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. * @@ -77,6 +72,15 @@ public Boolean isSystemExtension() { return this.isSystemExtension; } + /** + * Get the innerSourceBlob property: Specifies a download location where content can be downloaded from. + * + * @return the innerSourceBlob value. + */ + private Uri innerSourceBlob() { + return this.innerSourceBlob; + } + /** * Get the supportMultipleExtensions property: Indicates if specified product supports multiple extensions. * @@ -119,7 +123,7 @@ public Boolean vmScaleSetEnabled() { * @return the uri value. */ public String uri() { - return this.uri; + return this.innerSourceBlob() == null ? null : this.innerSourceBlob().uri(); } /** @@ -128,5 +132,8 @@ public String uri() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerSourceBlob() != null) { + innerSourceBlob().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 index f9fd3d6ceecc..255336d592fa 100644 --- 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 @@ -5,16 +5,12 @@ 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. */ diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/CloudManifestFileGetSamples.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/CloudManifestFileGetSamples.java new file mode 100644 index 000000000000..af399dbb28d3 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/CloudManifestFileGetSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for CloudManifestFile Get. */ +public final class CloudManifestFileGetSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/CloudManifestFile/Get.json + */ + /** + * Sample code: Returns the properties of a cloud specific manifest file. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsThePropertiesOfACloudSpecificManifestFile( + com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager.cloudManifestFiles().getWithResponse("latest", null, Context.NONE); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/CloudManifestFileListSamples.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/CloudManifestFileListSamples.java new file mode 100644 index 000000000000..5930470e02d2 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/CloudManifestFileListSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for CloudManifestFile List. */ +public final class CloudManifestFileListSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/CloudManifestFile/List.json + */ + /** + * Sample code: Returns the properties of a cloud specific manifest file with latest version. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsThePropertiesOfACloudSpecificManifestFileWithLatestVersion( + com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager.cloudManifestFiles().listWithResponse(Context.NONE); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/CustomerSubscriptionsCreateSamples.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/CustomerSubscriptionsCreateSamples.java new file mode 100644 index 000000000000..fabe0f2ffb06 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/CustomerSubscriptionsCreateSamples.java @@ -0,0 +1,26 @@ +// 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.generated; + +/** Samples for CustomerSubscriptions Create. */ +public final class CustomerSubscriptionsCreateSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/CustomerSubscription/Put.json + */ + /** + * Sample code: Creates a new customer subscription under a registration. + * + * @param manager Entry point to AzureStackManager. + */ + public static void createsANewCustomerSubscriptionUnderARegistration( + com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager + .customerSubscriptions() + .define("E09A4E93-29A7-4EBA-A6D4-76202383F07F") + .withExistingRegistration("azurestack", "testregistration") + .withTenantId("dbab3982-796f-4d03-9908-044c08aef8a2") + .create(); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/CustomerSubscriptionsDeleteSamples.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/CustomerSubscriptionsDeleteSamples.java new file mode 100644 index 000000000000..a92079ae7b44 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/CustomerSubscriptionsDeleteSamples.java @@ -0,0 +1,25 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for CustomerSubscriptions Delete. */ +public final class CustomerSubscriptionsDeleteSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/CustomerSubscription/Delete.json + */ + /** + * Sample code: Deletes a customer subscription under a registration. + * + * @param manager Entry point to AzureStackManager. + */ + public static void deletesACustomerSubscriptionUnderARegistration( + com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager + .customerSubscriptions() + .deleteWithResponse("azurestack", "testregistration", "E09A4E93-29A7-4EBA-A6D4-76202383F07F", Context.NONE); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/CustomerSubscriptionsGetSamples.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/CustomerSubscriptionsGetSamples.java new file mode 100644 index 000000000000..34e13c6853f3 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/CustomerSubscriptionsGetSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for CustomerSubscriptions Get. */ +public final class CustomerSubscriptionsGetSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/CustomerSubscription/Get.json + */ + /** + * Sample code: Returns the specified product. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsTheSpecifiedProduct(com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager + .customerSubscriptions() + .getWithResponse("azurestack", "testregistration", "E09A4E93-29A7-4EBA-A6D4-76202383F07F", Context.NONE); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/CustomerSubscriptionsListSamples.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/CustomerSubscriptionsListSamples.java new file mode 100644 index 000000000000..c2f4ed837eab --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/CustomerSubscriptionsListSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for CustomerSubscriptions List. */ +public final class CustomerSubscriptionsListSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/CustomerSubscription/List.json + */ + /** + * Sample code: Returns a list of products. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsAListOfProducts(com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager.customerSubscriptions().list("azurestack", "testregistration", Context.NONE); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/DeploymentLicenseCreateSamples.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/DeploymentLicenseCreateSamples.java new file mode 100644 index 000000000000..5a2486b7990a --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/DeploymentLicenseCreateSamples.java @@ -0,0 +1,26 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestack.models.DeploymentLicenseRequest; + +/** Samples for DeploymentLicense Create. */ +public final class DeploymentLicenseCreateSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/DeploymentLicense/Post.json + */ + /** + * Sample code: Creates a license that can be used to deploy an Azure Stack device. + * + * @param manager Entry point to AzureStackManager. + */ + public static void createsALicenseThatCanBeUsedToDeployAnAzureStackDevice( + com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager + .deploymentLicenses() + .createWithResponse(new DeploymentLicenseRequest().withVerificationVersion("1"), Context.NONE); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/OperationsListSamples.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/OperationsListSamples.java new file mode 100644 index 000000000000..e6cd6a1ef1dc --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/OperationsListSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/Operation/List.json + */ + /** + * Sample code: Returns the list of supported REST operations. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsTheListOfSupportedRESTOperations( + com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/ProductsGetProductSamples.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/ProductsGetProductSamples.java new file mode 100644 index 000000000000..3555710a9f21 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/ProductsGetProductSamples.java @@ -0,0 +1,29 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Products GetProduct. */ +public final class ProductsGetProductSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/Product/GetPost.json + */ + /** + * Sample code: Returns the specified product. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsTheSpecifiedProduct(com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager + .products() + .getProductWithResponse( + "azurestack", + "testregistration", + "Microsoft.OSTCExtensions.VMAccessForLinux.1.4.7.1", + null, + Context.NONE); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/ProductsGetProductsSamples.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/ProductsGetProductsSamples.java new file mode 100644 index 000000000000..d0ff97dc8ce1 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/ProductsGetProductsSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Products GetProducts. */ +public final class ProductsGetProductsSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/Product/ListPost.json + */ + /** + * Sample code: Returns a list of products. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsAListOfProducts(com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager.products().getProductsWithResponse("azurestack", "testregistration", "_all", null, Context.NONE); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/ProductsGetSamples.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/ProductsGetSamples.java new file mode 100644 index 000000000000..f80d7dc3a82c --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/ProductsGetSamples.java @@ -0,0 +1,25 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Products Get. */ +public final class ProductsGetSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/Product/Get.json + */ + /** + * Sample code: Returns the specified product. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsTheSpecifiedProduct(com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager + .products() + .getWithResponse( + "azurestack", "testregistration", "Microsoft.OSTCExtensions.VMAccessForLinux.1.4.7.1", Context.NONE); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/ProductsListDetailsSamples.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/ProductsListDetailsSamples.java new file mode 100644 index 000000000000..d44d33ee7c31 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/ProductsListDetailsSamples.java @@ -0,0 +1,26 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Products ListDetails. */ +public final class ProductsListDetailsSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/Product/Post.json + */ + /** + * Sample code: Returns the extended properties of a product. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsTheExtendedPropertiesOfAProduct( + com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager + .products() + .listDetailsWithResponse( + "azurestack", "testregistration", "Microsoft.OSTCExtensions.VMAccessForLinux.1.4.7.1", Context.NONE); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/ProductsListProductsSamples.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/ProductsListProductsSamples.java new file mode 100644 index 000000000000..f4bf252d84ff --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/ProductsListProductsSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Products ListProducts. */ +public final class ProductsListProductsSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/Product/ListPost.json + */ + /** + * Sample code: Returns a list of products. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsAListOfProducts(com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager.products().listProductsWithResponse("azurestack", "testregistration", "_all", null, Context.NONE); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/ProductsListSamples.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/ProductsListSamples.java new file mode 100644 index 000000000000..60231050c0e5 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/ProductsListSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Products List. */ +public final class ProductsListSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/Product/List.json + */ + /** + * Sample code: Returns a list of products. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsAListOfProducts(com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager.products().list("azurestack", "testregistration", Context.NONE); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/ProductsUploadLogSamples.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/ProductsUploadLogSamples.java new file mode 100644 index 000000000000..6689b4f5ad10 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/ProductsUploadLogSamples.java @@ -0,0 +1,29 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Products UploadLog. */ +public final class ProductsUploadLogSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/Product/UploadLog.json + */ + /** + * Sample code: Returns the specified product. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsTheSpecifiedProduct(com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager + .products() + .uploadLogWithResponse( + "azurestack", + "testregistration", + "Microsoft.OSTCExtensions.VMAccessForLinux.1.4.7.1", + null, + Context.NONE); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/RegistrationsCreateOrUpdateSamples.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/RegistrationsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..56637392ba09 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/RegistrationsCreateOrUpdateSamples.java @@ -0,0 +1,30 @@ +// 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.generated; + +import com.azure.resourcemanager.azurestack.models.Location; + +/** Samples for Registrations CreateOrUpdate. */ +public final class RegistrationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/Registration/Put.json + */ + /** + * Sample code: Create or update an Azure Stack registration. + * + * @param manager Entry point to AzureStackManager. + */ + public static void createOrUpdateAnAzureStackRegistration( + com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager + .registrations() + .define("testregistration") + .withLocation(Location.GLOBAL) + .withExistingResourceGroup("azurestack") + .withRegistrationToken( + "EyjIAWXSAw5nTw9KZWWiOiJeZxZlbg9wBwvUdCiSIM9iaMVjdeLkijoinwIzyJa2Ytgtowm2yy00OdG4lTlLyJmtztHjZGfJZTC0NZK1iIWiY2XvdWRJzCi6iJy5nDy0oDk1LTNHmWeTnDUwyS05oDI0LTrINzYwoGq5mjAzziIsim1HCmtldHBsYwnLu3LuZGljYXrpB25FBmfIbgVkIJp0CNvLLCJOYXJkd2FYzuLUZM8iOlt7IM51bunvcMVZiJoYlCjcaw9ZiJPBIjNkzDJHmda3yte5ndqZMdq4YmZkZmi5oDM3OTY3ZwNMIL0SIM5PyYI6WyJLZTy0ztJJMwZKy2m0OWNLODDLMwm2zTm0ymzKyjmWySisiJA3njlHmtdlY2q4NjRjnwFIZtC1YZi5ZGyZodM3Y2vjIl0siMnwDsi6wyi2oDUZoTbiY2RhNDa0ymrKoWe4YtK5otblzWrJzGyzNCISIjmYnzC4M2vmnZdIoDRKM2i5ytfkmJlhnDc1zdhLzWm1il0sim5HBwuiOijIqzF1MTvhmDIXmIIsimrpc2SiolsioWNlZjVhnZM1otQ0nDu3NmjlN2M3zmfjzmyZMTJhZtiiLcjLZjLmmZJhmWVhytG0NTu0OTqZNWu1Mda0MZbIYtfjyijdLCj1DWlKijoinwM5Mwu3NjytMju5Os00oTIwlWi0OdmTnGzHotiWm2RjyTCxIIwiBWvTb3J5ijPbijAYZDA3M2fjNzu0YTRMZTfhodkxzDnkogY5ZtAWzdyXIiwINZcWzThLnDQ4otrJndAzZGI5MGzlYtY1ZJA5ZdfiNMQIXX1DlcJpC3n1zxiiOijZb21lB25LIIWIdmVyC2LVbiI6IJeuMcJ9") + .create(); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/RegistrationsDeleteSamples.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/RegistrationsDeleteSamples.java new file mode 100644 index 000000000000..500ea2fa2ccc --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/RegistrationsDeleteSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Registrations Delete. */ +public final class RegistrationsDeleteSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/Registration/Delete.json + */ + /** + * Sample code: Delete the requested Azure Stack registration. + * + * @param manager Entry point to AzureStackManager. + */ + public static void deleteTheRequestedAzureStackRegistration( + com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager.registrations().deleteWithResponse("azurestack", "testregistration", Context.NONE); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/RegistrationsEnableRemoteManagementSamples.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/RegistrationsEnableRemoteManagementSamples.java new file mode 100644 index 000000000000..7e9451a05b85 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/RegistrationsEnableRemoteManagementSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Registrations EnableRemoteManagement. */ +public final class RegistrationsEnableRemoteManagementSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/RemoteManagement/Post.json + */ + /** + * Sample code: Returns empty response for successful action.. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsEmptyResponseForSuccessfulAction( + com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager.registrations().enableRemoteManagementWithResponse("azurestack", "testregistration", Context.NONE); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/RegistrationsGetActivationKeySamples.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/RegistrationsGetActivationKeySamples.java new file mode 100644 index 000000000000..59a8ab51681a --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/RegistrationsGetActivationKeySamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Registrations GetActivationKey. */ +public final class RegistrationsGetActivationKeySamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/Registration/Post.json + */ + /** + * Sample code: Returns Azure Stack Activation Key. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsAzureStackActivationKey(com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager.registrations().getActivationKeyWithResponse("azurestack", "testregistration", Context.NONE); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/RegistrationsGetByResourceGroupSamples.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/RegistrationsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..746794cd6272 --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/RegistrationsGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Registrations GetByResourceGroup. */ +public final class RegistrationsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/Registration/Get.json + */ + /** + * Sample code: Returns the properties of an Azure Stack registration. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsThePropertiesOfAnAzureStackRegistration( + com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager.registrations().getByResourceGroupWithResponse("azurestack", "testregistration", Context.NONE); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/RegistrationsListByResourceGroupSamples.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/RegistrationsListByResourceGroupSamples.java new file mode 100644 index 000000000000..e48c5add27dd --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/RegistrationsListByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Registrations ListByResourceGroup. */ +public final class RegistrationsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/Registration/List.json + */ + /** + * Sample code: Returns a list of all registrations. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsAListOfAllRegistrations(com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager.registrations().listByResourceGroup("azurestack", Context.NONE); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/RegistrationsListSamples.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/RegistrationsListSamples.java new file mode 100644 index 000000000000..4e182f4ba6af --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/RegistrationsListSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Registrations List. */ +public final class RegistrationsListSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/Registration/ListBySubscription.json + */ + /** + * Sample code: Returns a list of all registrations under current subscription. + * + * @param manager Entry point to AzureStackManager. + */ + public static void returnsAListOfAllRegistrationsUnderCurrentSubscription( + com.azure.resourcemanager.azurestack.AzureStackManager manager) { + manager.registrations().list(Context.NONE); + } +} diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/RegistrationsUpdateSamples.java b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/RegistrationsUpdateSamples.java new file mode 100644 index 000000000000..13e24d6fd56d --- /dev/null +++ b/sdk/azurestack/azure-resourcemanager-azurestack/src/samples/java/com/azure/resourcemanager/azurestack/generated/RegistrationsUpdateSamples.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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestack.models.Registration; + +/** Samples for Registrations Update. */ +public final class RegistrationsUpdateSamples { + /* + * x-ms-original-file: specification/azurestack/resource-manager/Microsoft.AzureStack/stable/2022-06-01/examples/Registration/Patch.json + */ + /** + * Sample code: Patch an Azure Stack registration. + * + * @param manager Entry point to AzureStackManager. + */ + public static void patchAnAzureStackRegistration(com.azure.resourcemanager.azurestack.AzureStackManager manager) { + Registration resource = + manager + .registrations() + .getByResourceGroupWithResponse("azurestack", "testregistration", Context.NONE) + .getValue(); + resource + .update() + .withRegistrationToken( + "EyjIAWXSAw5nTw9KZWWiOiJeZxZlbg9wBwvUdCiSIM9iaMVjdeLkijoinwIzyJa2Ytgtowm2yy00OdG4lTlLyJmtztHjZGfJZTC0NZK1iIWiY2XvdWRJzCi6iJy5nDy0oDk1LTNHmWeTnDUwyS05oDI0LTrINzYwoGq5mjAzziIsim1HCmtldHBsYwnLu3LuZGljYXrpB25FBmfIbgVkIJp0CNvLLCJOYXJkd2FYzuLUZM8iOlt7IM51bunvcMVZiJoYlCjcaw9ZiJPBIjNkzDJHmda3yte5ndqZMdq4YmZkZmi5oDM3OTY3ZwNMIL0SIM5PyYI6WyJLZTy0ztJJMwZKy2m0OWNLODDLMwm2zTm0ymzKyjmWySisiJA3njlHmtdlY2q4NjRjnwFIZtC1YZi5ZGyZodM3Y2vjIl0siMnwDsi6wyi2oDUZoTbiY2RhNDa0ymrKoWe4YtK5otblzWrJzGyzNCISIjmYnzC4M2vmnZdIoDRKM2i5ytfkmJlhnDc1zdhLzWm1il0sim5HBwuiOijIqzF1MTvhmDIXmIIsimrpc2SiolsioWNlZjVhnZM1otQ0nDu3NmjlN2M3zmfjzmyZMTJhZtiiLcjLZjLmmZJhmWVhytG0NTu0OTqZNWu1Mda0MZbIYtfjyijdLCj1DWlKijoinwM5Mwu3NjytMju5Os00oTIwlWi0OdmTnGzHotiWm2RjyTCxIIwiBWvTb3J5ijPbijAYZDA3M2fjNzu0YTRMZTfhodkxzDnkogY5ZtAWzdyXIiwINZcWzThLnDQ4otrJndAzZGI5MGzlYtY1ZJA5ZdfiNMQIXX1DlcJpC3n1zxiiOijZb21lB25LIIWIdmVyC2LVbiI6IJeuMcJ9") + .apply(); + } +}