diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index f64b70065d1d9..f4d4d0a9047ed 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -432,7 +432,7 @@ com.azure.resourcemanager:azure-resourcemanager-managednetworkfabric;2.0.0;2.1.0 com.azure.resourcemanager:azure-resourcemanager-iotfirmwaredefense;2.0.0;2.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-quantum;1.0.0-beta.3;1.0.0-beta.4 com.azure.resourcemanager:azure-resourcemanager-chaos;1.4.0;1.5.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-sphere;1.1.0;1.2.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-sphere;1.1.0;1.2.0 com.azure.resourcemanager:azure-resourcemanager-defendereasm;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-apicenter;1.1.0;1.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-hybridconnectivity;1.2.0;1.3.0-beta.1 diff --git a/sdk/sphere/azure-resourcemanager-sphere/CHANGELOG.md b/sdk/sphere/azure-resourcemanager-sphere/CHANGELOG.md index af53206dfbb37..5678fdae6aa78 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/CHANGELOG.md +++ b/sdk/sphere/azure-resourcemanager-sphere/CHANGELOG.md @@ -1,14 +1,116 @@ # Release History -## 1.2.0-beta.1 (Unreleased) +## 1.2.0 (2026-10-14) -### Features Added +- Azure Resource Manager Azure Sphere client library for Java. This package contains Microsoft Azure SDK for Azure Sphere Management SDK. Azure Sphere resource management API. Package api-version 2024-04-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.CountDeviceResponse` was removed + +#### `models.ImageListResult` was removed + +#### `models.PagedDeviceInsight` was removed + +#### `models.OperationListResult` was removed + +#### `models.DeviceGroupListResult` was removed + +#### `models.DeploymentListResult` was removed + +#### `models.ProductListResult` was removed + +#### `models.CatalogListResult` was removed + +#### `models.DeviceListResult` was removed + +#### `models.CertificateListResult` was removed + +#### `models.DeviceGroupProperties` was modified + +* `validate()` was removed + +#### `AzureSphereManager` was modified + +* `fluent.AzureSphereMgmtClient serviceClient()` -> `fluent.AzureSphereManagementClient serviceClient()` + +#### `models.CatalogUpdate` was modified + +* `validate()` was removed + +#### `models.ProofOfPossessionNonceRequest` was modified + +* `validate()` was removed + +#### `models.DeviceProperties` was modified + +* `validate()` was removed + +#### `models.CertificateProperties` was modified + +* `validate()` was removed + +#### `models.DeviceUpdate` was modified + +* `validate()` was removed + +#### `models.OperationDisplay` was modified + +* `OperationDisplay()` was changed to private access +* `validate()` was removed + +#### `models.DeploymentProperties` was modified + +* `validate()` was removed + +#### `models.ListDeviceGroupsRequest` was modified + +* `validate()` was removed + +#### `models.DeviceUpdateProperties` was modified + +* `validate()` was removed + +#### `models.DeviceGroupUpdateProperties` was modified + +* `validate()` was removed + +#### `models.CountElementsResponse` was modified + +* `validate()` was removed +* `models.CountElementsResponse withValue(int)` -> `models.CountElementsResponse withValue(int)` + +#### `models.GenerateCapabilityImageRequest` was modified + +* `validate()` was removed + +#### `models.CatalogProperties` was modified + +* `validate()` was removed + +#### `models.ProductUpdateProperties` was modified + +* `validate()` was removed + +#### `models.ProductUpdate` was modified + +* `validate()` was removed + +#### `models.ClaimDevicesRequest` was modified + +* `validate()` was removed + +#### `models.DeviceGroupUpdate` was modified + +* `validate()` was removed + +#### `models.ImageProperties` was modified + +* `validate()` was removed + +#### `models.ProductProperties` was modified -### Other Changes +* `validate()` was removed ## 1.1.0 (2024-12-19) diff --git a/sdk/sphere/azure-resourcemanager-sphere/README.md b/sdk/sphere/azure-resourcemanager-sphere/README.md index c83cb85ce4574..47bc91d2b7351 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/README.md +++ b/sdk/sphere/azure-resourcemanager-sphere/README.md @@ -1,8 +1,8 @@ -# Azure Resource Manager AzureSphere client library for Java +# Azure Resource Manager Azure Sphere client library for Java -Azure Resource Manager AzureSphere client library for Java. +Azure Resource Manager Azure Sphere client library for Java. -This package contains Microsoft Azure SDK for AzureSphere Management SDK. Azure Sphere resource management API. Package tag package-2024-04-01. 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 Azure Sphere Management SDK. Azure Sphere resource management API. Package api-version 2024-04-01. 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-sphere - 1.2.0-beta.1 + 1.2.0 ``` [//]: # ({x-version-update-end}) @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ AzureSphereManager manager = AzureSphereManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -107,5 +107,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ - - diff --git a/sdk/sphere/azure-resourcemanager-sphere/SAMPLE.md b/sdk/sphere/azure-resourcemanager-sphere/SAMPLE.md index 7327f883c4150..ca7f428e62d36 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/SAMPLE.md +++ b/sdk/sphere/azure-resourcemanager-sphere/SAMPLE.md @@ -77,9 +77,7 @@ */ public final class CatalogsCountDevicesSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PostCountDevicesCatalog. - * json + * x-ms-original-file: 2024-04-01/PostCountDevicesCatalog.json */ /** * Sample code: Catalogs_CountDevices. @@ -100,8 +98,7 @@ public final class CatalogsCountDevicesSamples { */ public final class CatalogsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PutCatalog.json + * x-ms-original-file: 2024-04-01/PutCatalog.json */ /** * Sample code: Catalogs_CreateOrUpdate. @@ -126,8 +123,7 @@ public final class CatalogsCreateOrUpdateSamples { */ public final class CatalogsDeleteSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/DeleteCatalog.json + * x-ms-original-file: 2024-04-01/DeleteCatalog.json */ /** * Sample code: Catalogs_Delete. @@ -148,8 +144,7 @@ public final class CatalogsDeleteSamples { */ public final class CatalogsGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetCatalog.json + * x-ms-original-file: 2024-04-01/GetCatalog.json */ /** * Sample code: Catalogs_Get. @@ -171,8 +166,7 @@ public final class CatalogsGetByResourceGroupSamples { */ public final class CatalogsListSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetCatalogsSub.json + * x-ms-original-file: 2024-04-01/GetCatalogsSub.json */ /** * Sample code: Catalogs_ListBySubscription. @@ -193,8 +187,7 @@ public final class CatalogsListSamples { */ public final class CatalogsListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetCatalogsRG.json + * x-ms-original-file: 2024-04-01/GetCatalogsRG.json */ /** * Sample code: Catalogs_ListByResourceGroup. @@ -215,8 +208,7 @@ public final class CatalogsListByResourceGroupSamples { */ public final class CatalogsListDeploymentsSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/ - * PostListDeploymentsByCatalog.json + * x-ms-original-file: 2024-04-01/PostListDeploymentsByCatalog.json */ /** * Sample code: Catalogs_ListDeployments. @@ -241,8 +233,7 @@ import com.azure.resourcemanager.sphere.models.ListDeviceGroupsRequest; */ public final class CatalogsListDeviceGroupsSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/ - * PostListDeviceGroupsCatalog.json + * x-ms-original-file: 2024-04-01/PostListDeviceGroupsCatalog.json */ /** * Sample code: Catalogs_ListDeviceGroups. @@ -266,8 +257,7 @@ public final class CatalogsListDeviceGroupsSamples { */ public final class CatalogsListDeviceInsightsSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/ - * PostListDeviceInsightsCatalog.json + * x-ms-original-file: 2024-04-01/PostListDeviceInsightsCatalog.json */ /** * Sample code: Catalogs_ListDeviceInsights. @@ -290,9 +280,7 @@ public final class CatalogsListDeviceInsightsSamples { */ public final class CatalogsListDevicesSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PostListDevicesByCatalog. - * json + * x-ms-original-file: 2024-04-01/PostListDevicesByCatalog.json */ /** * Sample code: Catalogs_ListDevices. @@ -316,8 +304,7 @@ import com.azure.resourcemanager.sphere.models.Catalog; */ public final class CatalogsUpdateSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PatchCatalog.json + * x-ms-original-file: 2024-04-01/PatchCatalog.json */ /** * Sample code: Catalogs_Update. @@ -344,9 +331,7 @@ import com.azure.resourcemanager.sphere.models.ImageProperties; */ public final class CatalogsUploadImageSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PostUploadImageCatalog. - * json + * x-ms-original-file: 2024-04-01/PostUploadImageCatalog.json */ /** * Sample code: Catalogs_UploadImage. @@ -370,8 +355,7 @@ public final class CatalogsUploadImageSamples { */ public final class CertificatesGetSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetCertificate.json + * x-ms-original-file: 2024-04-01/GetCertificate.json */ /** * Sample code: Certificates_Get. @@ -393,8 +377,7 @@ public final class CertificatesGetSamples { */ public final class CertificatesListByCatalogSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetCertificates.json + * x-ms-original-file: 2024-04-01/GetCertificates.json */ /** * Sample code: Certificates_ListByCatalog. @@ -416,8 +399,7 @@ public final class CertificatesListByCatalogSamples { */ public final class CertificatesRetrieveCertChainSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/ - * PostRetrieveCatalogCertChain.json + * x-ms-original-file: 2024-04-01/PostRetrieveCatalogCertChain.json */ /** * Sample code: Certificates_RetrieveCertChain. @@ -442,8 +424,7 @@ import com.azure.resourcemanager.sphere.models.ProofOfPossessionNonceRequest; */ public final class CertificatesRetrieveProofOfPossessionNonceSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/ - * PostRetrieveProofOfPossessionNonce.json + * x-ms-original-file: 2024-04-01/PostRetrieveProofOfPossessionNonce.json */ /** * Sample code: Certificates_RetrieveProofOfPossessionNonce. @@ -468,8 +449,7 @@ public final class CertificatesRetrieveProofOfPossessionNonceSamples { */ public final class DeploymentsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PutDeployment.json + * x-ms-original-file: 2024-04-01/PutDeployment.json */ /** * Sample code: Deployments_CreateOrUpdate. @@ -493,8 +473,7 @@ public final class DeploymentsCreateOrUpdateSamples { */ public final class DeploymentsDeleteSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/DeleteDeployment.json + * x-ms-original-file: 2024-04-01/DeleteDeployment.json */ /** * Sample code: Deployments_Delete. @@ -517,8 +496,7 @@ public final class DeploymentsDeleteSamples { */ public final class DeploymentsGetSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetDeployment.json + * x-ms-original-file: 2024-04-01/GetDeployment.json */ /** * Sample code: Deployments_Get. @@ -541,8 +519,7 @@ public final class DeploymentsGetSamples { */ public final class DeploymentsListByDeviceGroupSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetDeployments.json + * x-ms-original-file: 2024-04-01/GetDeployments.json */ /** * Sample code: Deployments_ListByDeviceGroup. @@ -568,8 +545,7 @@ import java.util.Arrays; */ public final class DeviceGroupsClaimDevicesSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PostClaimDevices.json + * x-ms-original-file: 2024-04-01/PostClaimDevices.json */ /** * Sample code: DeviceGroups_ClaimDevices. @@ -594,8 +570,7 @@ public final class DeviceGroupsClaimDevicesSamples { */ public final class DeviceGroupsCountDevicesSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/ - * PostCountDevicesDeviceGroup.json + * x-ms-original-file: 2024-04-01/PostCountDevicesDeviceGroup.json */ /** * Sample code: DeviceGroups_CountDevices. @@ -622,8 +597,7 @@ import com.azure.resourcemanager.sphere.models.UpdatePolicy; */ public final class DeviceGroupsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PutDeviceGroup.json + * x-ms-original-file: 2024-04-01/PutDeviceGroup.json */ /** * Sample code: DeviceGroups_CreateOrUpdate. @@ -650,8 +624,7 @@ public final class DeviceGroupsCreateOrUpdateSamples { */ public final class DeviceGroupsDeleteSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/DeleteDeviceGroup.json + * x-ms-original-file: 2024-04-01/DeleteDeviceGroup.json */ /** * Sample code: DeviceGroups_Delete. @@ -673,8 +646,7 @@ public final class DeviceGroupsDeleteSamples { */ public final class DeviceGroupsGetSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetDeviceGroup.json + * x-ms-original-file: 2024-04-01/GetDeviceGroup.json */ /** * Sample code: DeviceGroups_Get. @@ -697,8 +669,7 @@ public final class DeviceGroupsGetSamples { */ public final class DeviceGroupsListByProductSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetDeviceGroups.json + * x-ms-original-file: 2024-04-01/GetDeviceGroups.json */ /** * Sample code: DeviceGroups_ListByProduct. @@ -723,8 +694,7 @@ import com.azure.resourcemanager.sphere.models.DeviceGroup; */ public final class DeviceGroupsUpdateSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PatchDeviceGroup.json + * x-ms-original-file: 2024-04-01/PatchDeviceGroup.json */ /** * Sample code: DeviceGroups_Update. @@ -749,8 +719,7 @@ public final class DeviceGroupsUpdateSamples { */ public final class DevicesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PutDevice.json + * x-ms-original-file: 2024-04-01/PutDevice.json */ /** * Sample code: Devices_CreateOrUpdate. @@ -775,8 +744,7 @@ public final class DevicesCreateOrUpdateSamples { */ public final class DevicesDeleteSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/DeleteDevice.json + * x-ms-original-file: 2024-04-01/DeleteDevice.json */ /** * Sample code: Devices_Delete. @@ -804,8 +772,7 @@ import java.util.Arrays; */ public final class DevicesGenerateCapabilityImageSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/ - * PostGenerateDeviceCapabilityImage.json + * x-ms-original-file: 2024-04-01/PostGenerateDeviceCapabilityImage.json */ /** * Sample code: Devices_GenerateCapabilityImage. @@ -831,8 +798,7 @@ public final class DevicesGenerateCapabilityImageSamples { */ public final class DevicesGetSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetDevice.json + * x-ms-original-file: 2024-04-01/GetDevice.json */ /** * Sample code: Devices_Get. @@ -856,8 +822,7 @@ public final class DevicesGetSamples { */ public final class DevicesListByDeviceGroupSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetDevices.json + * x-ms-original-file: 2024-04-01/GetDevices.json */ /** * Sample code: Devices_ListByDeviceGroup. @@ -882,8 +847,7 @@ import com.azure.resourcemanager.sphere.models.Device; */ public final class DevicesUpdateSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PatchDevice.json + * x-ms-original-file: 2024-04-01/PatchDevice.json */ /** * Sample code: Devices_Update. @@ -911,8 +875,7 @@ import com.azure.resourcemanager.sphere.models.ImageProperties; */ public final class ImagesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PutImage.json + * x-ms-original-file: 2024-04-01/PutImage.json */ /** * Sample code: Image_CreateOrUpdate. @@ -937,8 +900,7 @@ public final class ImagesCreateOrUpdateSamples { */ public final class ImagesDeleteSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/DeleteImage.json + * x-ms-original-file: 2024-04-01/DeleteImage.json */ /** * Sample code: Images_Delete. @@ -961,8 +923,7 @@ public final class ImagesDeleteSamples { */ public final class ImagesGetSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetImage.json + * x-ms-original-file: 2024-04-01/GetImage.json */ /** * Sample code: Images_Get. @@ -985,8 +946,7 @@ public final class ImagesGetSamples { */ public final class ImagesListByCatalogSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetImages.json + * x-ms-original-file: 2024-04-01/GetImages.json */ /** * Sample code: Images_ListByCatalog. @@ -1008,8 +968,7 @@ public final class ImagesListByCatalogSamples { */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetOperations.json + * x-ms-original-file: 2024-04-01/GetOperations.json */ /** * Sample code: Operations_List. @@ -1030,9 +989,7 @@ public final class OperationsListSamples { */ public final class ProductsCountDevicesSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PostCountDevicesProduct. - * json + * x-ms-original-file: 2024-04-01/PostCountDevicesProduct.json */ /** * Sample code: Products_CountDevices. @@ -1054,8 +1011,7 @@ public final class ProductsCountDevicesSamples { */ public final class ProductsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PutProduct.json + * x-ms-original-file: 2024-04-01/PutProduct.json */ /** * Sample code: Products_CreateOrUpdate. @@ -1076,8 +1032,7 @@ public final class ProductsCreateOrUpdateSamples { */ public final class ProductsDeleteSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/DeleteProduct.json + * x-ms-original-file: 2024-04-01/DeleteProduct.json */ /** * Sample code: Products_Delete. @@ -1098,8 +1053,7 @@ public final class ProductsDeleteSamples { */ public final class ProductsGenerateDefaultDeviceGroupsSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/ - * PostGenerateDefaultDeviceGroups.json + * x-ms-original-file: 2024-04-01/PostGenerateDefaultDeviceGroups.json */ /** * Sample code: Products_GenerateDefaultDeviceGroups. @@ -1123,8 +1077,7 @@ public final class ProductsGenerateDefaultDeviceGroupsSamples { */ public final class ProductsGetSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetProduct.json + * x-ms-original-file: 2024-04-01/GetProduct.json */ /** * Sample code: Products_Get. @@ -1146,8 +1099,7 @@ public final class ProductsGetSamples { */ public final class ProductsListByCatalogSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetProducts.json + * x-ms-original-file: 2024-04-01/GetProducts.json */ /** * Sample code: Products_ListByCatalog. @@ -1170,8 +1122,7 @@ import com.azure.resourcemanager.sphere.models.Product; */ public final class ProductsUpdateSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PatchProduct.json + * x-ms-original-file: 2024-04-01/PatchProduct.json */ /** * Sample code: Products_Update. diff --git a/sdk/sphere/azure-resourcemanager-sphere/pom.xml b/sdk/sphere/azure-resourcemanager-sphere/pom.xml index ec11b95de059f..77ffb013e8098 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/pom.xml +++ b/sdk/sphere/azure-resourcemanager-sphere/pom.xml @@ -1,9 +1,9 @@ - + 4.0.0 com.azure @@ -14,11 +14,11 @@ com.azure.resourcemanager azure-resourcemanager-sphere - 1.2.0-beta.1 + 1.2.0 jar - Microsoft Azure SDK for AzureSphere Management - This package contains Microsoft Azure SDK for AzureSphere Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Sphere resource management API. Package tag package-2024-04-01. + Microsoft Azure SDK for Azure Sphere Management + This package contains Microsoft Azure SDK for Azure Sphere Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Sphere resource management API. Package api-version 2024-04-01. https://github.com/Azure/azure-sdk-for-java @@ -45,7 +45,7 @@ UTF-8 0 0 - false + true diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/AzureSphereManager.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/AzureSphereManager.java index 63706a02bbb7c..25dfe2ecd15eb 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/AzureSphereManager.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/AzureSphereManager.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere; @@ -22,9 +22,10 @@ import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.sphere.fluent.AzureSphereMgmtClient; -import com.azure.resourcemanager.sphere.implementation.AzureSphereMgmtClientBuilder; +import com.azure.resourcemanager.sphere.fluent.AzureSphereManagementClient; +import com.azure.resourcemanager.sphere.implementation.AzureSphereManagementClientBuilder; import com.azure.resourcemanager.sphere.implementation.CatalogsImpl; import com.azure.resourcemanager.sphere.implementation.CertificatesImpl; import com.azure.resourcemanager.sphere.implementation.DeploymentsImpl; @@ -45,6 +46,7 @@ import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; @@ -69,12 +71,12 @@ public final class AzureSphereManager { private Devices devices; - private final AzureSphereMgmtClient clientObject; + private final AzureSphereManagementClient clientObject; private AzureSphereManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = new AzureSphereMgmtClientBuilder().pipeline(httpPipeline) + this.clientObject = new AzureSphereManagementClientBuilder().pipeline(httpPipeline) .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .subscriptionId(profile.getSubscriptionId()) .defaultPollInterval(defaultPollInterval) @@ -82,11 +84,11 @@ private AzureSphereManager(HttpPipeline httpPipeline, AzureProfile profile, Dura } /** - * Creates an instance of AzureSphere service API entry point. + * Creates an instance of Azure Sphere service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the AzureSphere service API instance. + * @return the Azure Sphere service API instance. */ public static AzureSphereManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); @@ -95,11 +97,11 @@ public static AzureSphereManager authenticate(TokenCredential credential, AzureP } /** - * Creates an instance of AzureSphere service API entry point. + * Creates an instance of Azure Sphere service API entry point. * * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. * @param profile the Azure profile for client. - * @return the AzureSphere service API instance. + * @return the Azure Sphere service API instance. */ public static AzureSphereManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); @@ -121,6 +123,9 @@ public static Configurable configure() { */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-sphere.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -218,22 +223,24 @@ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { } /** - * Creates an instance of AzureSphere service API entry point. + * Creates an instance of Azure Sphere service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the AzureSphere service API instance. + * @return the Azure Sphere service API instance. */ public AzureSphereManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.sphere") .append("/") - .append("1.1.0"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -376,12 +383,12 @@ public Devices devices() { } /** - * Gets wrapped service client AzureSphereMgmtClient providing direct access to the underlying auto-generated API - * implementation, based on Azure REST API. + * Gets wrapped service client AzureSphereManagementClient providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. * - * @return Wrapped service client AzureSphereMgmtClient. + * @return Wrapped service client AzureSphereManagementClient. */ - public AzureSphereMgmtClient serviceClient() { + public AzureSphereManagementClient serviceClient() { return this.clientObject; } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/AzureSphereMgmtClient.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/AzureSphereManagementClient.java similarity index 88% rename from sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/AzureSphereMgmtClient.java rename to sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/AzureSphereManagementClient.java index 5a4f1d01f66cf..e2540ef76e3f2 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/AzureSphereMgmtClient.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/AzureSphereManagementClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.fluent; @@ -8,30 +8,30 @@ import java.time.Duration; /** - * The interface for AzureSphereMgmtClient class. + * The interface for AzureSphereManagementClient class. */ -public interface AzureSphereMgmtClient { +public interface AzureSphereManagementClient { /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ String getEndpoint(); /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ String getApiVersion(); + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + /** * Gets The HTTP pipeline to send requests through. * diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/CatalogsClient.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/CatalogsClient.java index d66f6cffc0bce..3591dbed9e4a3 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/CatalogsClient.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/CatalogsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.fluent; @@ -25,53 +25,6 @@ * An instance of this class provides access to all the operations defined in CatalogsClient. */ public interface CatalogsClient { - /** - * List Catalog resources by subscription ID. - * - * @throws com.azure.core.management.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 of a Catalog list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List Catalog resources by subscription 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 of a Catalog list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * List Catalog resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 of a Catalog list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List Catalog resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @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 of a Catalog list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - /** * Get a Catalog. * @@ -242,6 +195,53 @@ Response updateWithResponse(String resourceGroupName, String catal @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String catalogName, Context context); + /** + * List Catalog resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 of a Catalog list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Catalog resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 of a Catalog list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List Catalog resources by subscription ID. + * + * @throws com.azure.core.management.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 of a Catalog list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List Catalog resources by subscription 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 of a Catalog list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + /** * Counts devices in catalog. * diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/CertificatesClient.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/CertificatesClient.java index b76a551fcd5e8..3c160c9e3069f 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/CertificatesClient.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/CertificatesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.fluent; @@ -19,66 +19,66 @@ */ public interface CertificatesClient { /** - * List Certificate resources by Catalog. + * Get a Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. + * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. + * @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 of a Certificate list operation as paginated response with {@link PagedIterable}. + * @return a Certificate along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByCatalog(String resourceGroupName, String catalogName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String catalogName, String serialNumber, + Context context); /** - * List Certificate resources by Catalog. + * Get a Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param filter Filter the result list using the given expression. - * @param top The number of result items to return. - * @param skip The number of result items to skip. - * @param maxpagesize The maximum number of result items per page. - * @param context The context to associate with this operation. + * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 of a Certificate list operation as paginated response with {@link PagedIterable}. + * @return a Certificate. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByCatalog(String resourceGroupName, String catalogName, String filter, - Integer top, Integer skip, Integer maxpagesize, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + CertificateInner get(String resourceGroupName, String catalogName, String serialNumber); /** - * Get a Certificate. + * List Certificate resources by Catalog. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. - * @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 Certificate along with {@link Response}. + * @return the response of a Certificate list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String catalogName, String serialNumber, - Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCatalog(String resourceGroupName, String catalogName); /** - * Get a Certificate. + * List Certificate resources by Catalog. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. + * @param filter Filter the result list using the given expression. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @param maxpagesize The maximum number of result items per page. + * @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 Certificate. + * @return the response of a Certificate list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - CertificateInner get(String resourceGroupName, String catalogName, String serialNumber); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCatalog(String resourceGroupName, String catalogName, String filter, + Integer top, Integer skip, Integer maxpagesize, Context context); /** * Retrieves cert chain. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/DeploymentsClient.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/DeploymentsClient.java index c02caa703a712..1c8404478e650 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/DeploymentsClient.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/DeploymentsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.fluent; @@ -17,45 +17,6 @@ * An instance of this class provides access to all the operations defined in DeploymentsClient. */ public interface DeploymentsClient { - /** - * List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be - * used for product or device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device 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 the response of a Deployment list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, - String deviceGroupName); - - /** - * List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be - * used for product or device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param filter Filter the result list using the given expression. - * @param top The number of result items to return. - * @param skip The number of result items to skip. - * @param maxpagesize The maximum number of result items per page. - * @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 of a Deployment list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, - String deviceGroupName, String filter, Integer top, Integer skip, Integer maxpagesize, Context context); - /** * Get a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device * group name. @@ -109,7 +70,7 @@ DeploymentInner get(String resourceGroupName, String catalogName, String 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 the {@link SyncPoller} for polling of an deployment resource belonging to a device group resource. + * @return the {@link SyncPoller} for polling of a deployment resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DeploymentInner> beginCreateOrUpdate(String resourceGroupName, @@ -131,7 +92,7 @@ SyncPoller, DeploymentInner> beginCreateOrUpdate(Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 {@link SyncPoller} for polling of an deployment resource belonging to a device group resource. + * @return the {@link SyncPoller} for polling of a deployment resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DeploymentInner> beginCreateOrUpdate(String resourceGroupName, @@ -152,7 +113,7 @@ SyncPoller, DeploymentInner> beginCreateOrUpdate(Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 an deployment resource belonging to a device group resource. + * @return a deployment resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.SINGLE) DeploymentInner createOrUpdate(String resourceGroupName, String catalogName, String productName, @@ -173,7 +134,7 @@ DeploymentInner createOrUpdate(String resourceGroupName, String catalogName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 an deployment resource belonging to a device group resource. + * @return a deployment resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.SINGLE) DeploymentInner createOrUpdate(String resourceGroupName, String catalogName, String productName, @@ -254,4 +215,43 @@ void delete(String resourceGroupName, String catalogName, String productName, St @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deploymentName, Context context); + + /** + * List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be + * used for product or device group name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param catalogName Name of catalog. + * @param productName Name of product. + * @param deviceGroupName Name of device 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 the response of a Deployment list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, + String deviceGroupName); + + /** + * List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be + * used for product or device group name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param catalogName Name of catalog. + * @param productName Name of product. + * @param deviceGroupName Name of device group. + * @param filter Filter the result list using the given expression. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @param maxpagesize The maximum number of result items per page. + * @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 of a Deployment list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String filter, Integer top, Integer skip, Integer maxpagesize, Context context); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/DeviceGroupsClient.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/DeviceGroupsClient.java index 5de380b9aaf79..6f91810695aca 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/DeviceGroupsClient.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/DeviceGroupsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.fluent; @@ -20,42 +20,6 @@ * An instance of this class provides access to all the operations defined in DeviceGroupsClient. */ public interface DeviceGroupsClient { - /** - * List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used - * for product name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of 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 the response of a DeviceGroup list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByProduct(String resourceGroupName, String catalogName, String productName); - - /** - * List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used - * for product name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param filter Filter the result list using the given expression. - * @param top The number of result items to return. - * @param skip The number of result items to skip. - * @param maxpagesize The maximum number of result items per page. - * @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 of a DeviceGroup list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByProduct(String resourceGroupName, String catalogName, String productName, - String filter, Integer top, Integer skip, Integer maxpagesize, Context context); - /** * Get a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. @@ -102,7 +66,7 @@ Response getWithResponse(String resourceGroupName, String cata * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 {@link SyncPoller} for polling of an device group resource belonging to a product resource. + * @return the {@link SyncPoller} for polling of a device group resource belonging to a product resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DeviceGroupInner> beginCreateOrUpdate(String resourceGroupName, @@ -121,7 +85,7 @@ SyncPoller, DeviceGroupInner> beginCreateOrUpdate(S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 {@link SyncPoller} for polling of an device group resource belonging to a product resource. + * @return the {@link SyncPoller} for polling of a device group resource belonging to a product resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DeviceGroupInner> beginCreateOrUpdate(String resourceGroupName, @@ -139,7 +103,7 @@ SyncPoller, DeviceGroupInner> beginCreateOrUpdate(S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 an device group resource belonging to a product resource. + * @return a device group resource belonging to a product resource. */ @ServiceMethod(returns = ReturnType.SINGLE) DeviceGroupInner createOrUpdate(String resourceGroupName, String catalogName, String productName, @@ -158,7 +122,7 @@ DeviceGroupInner createOrUpdate(String resourceGroupName, String catalogName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 an device group resource belonging to a product resource. + * @return a device group resource belonging to a product resource. */ @ServiceMethod(returns = ReturnType.SINGLE) DeviceGroupInner createOrUpdate(String resourceGroupName, String catalogName, String productName, @@ -176,7 +140,7 @@ DeviceGroupInner createOrUpdate(String resourceGroupName, String catalogName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 {@link SyncPoller} for polling of an device group resource belonging to a product resource. + * @return the {@link SyncPoller} for polling of a device group resource belonging to a product resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DeviceGroupInner> beginUpdate(String resourceGroupName, String catalogName, @@ -195,7 +159,7 @@ SyncPoller, DeviceGroupInner> beginUpdate(String re * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 {@link SyncPoller} for polling of an device group resource belonging to a product resource. + * @return the {@link SyncPoller} for polling of a device group resource belonging to a product resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DeviceGroupInner> beginUpdate(String resourceGroupName, String catalogName, @@ -213,7 +177,7 @@ SyncPoller, DeviceGroupInner> beginUpdate(String re * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 an device group resource belonging to a product resource. + * @return a device group resource belonging to a product resource. */ @ServiceMethod(returns = ReturnType.SINGLE) DeviceGroupInner update(String resourceGroupName, String catalogName, String productName, String deviceGroupName, @@ -232,7 +196,7 @@ DeviceGroupInner update(String resourceGroupName, String catalogName, String pro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 an device group resource belonging to a product resource. + * @return a device group resource belonging to a product resource. */ @ServiceMethod(returns = ReturnType.SINGLE) DeviceGroupInner update(String resourceGroupName, String catalogName, String productName, String deviceGroupName, @@ -305,6 +269,42 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, Context context); + /** + * List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used + * for product name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param catalogName Name of catalog. + * @param productName Name of 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 the response of a DeviceGroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProduct(String resourceGroupName, String catalogName, String productName); + + /** + * List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used + * for product name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param catalogName Name of catalog. + * @param productName Name of product. + * @param filter Filter the result list using the given expression. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @param maxpagesize The maximum number of result items per page. + * @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 of a DeviceGroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProduct(String resourceGroupName, String catalogName, String productName, + String filter, Integer top, Integer skip, Integer maxpagesize, Context context); + /** * Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk * claiming devices to a catalog only. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/DevicesClient.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/DevicesClient.java index 9e6322247bf44..10abfb1bdd579 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/DevicesClient.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/DevicesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.fluent; @@ -20,41 +20,6 @@ * An instance of this class provides access to all the operations defined in DevicesClient. */ public interface DevicesClient { - /** - * List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used - * for product or device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device 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 the response of a Device list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, - String deviceGroupName); - - /** - * List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used - * for product or device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device 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 the response of a Device list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, - String deviceGroupName, Context context); - /** * Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not * belong to a device group and product. @@ -105,7 +70,7 @@ DeviceInner get(String resourceGroupName, String catalogName, String productName * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 {@link SyncPoller} for polling of an device resource belonging to a device group resource. + * @return the {@link SyncPoller} for polling of a device resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DeviceInner> beginCreateOrUpdate(String resourceGroupName, String catalogName, @@ -125,7 +90,7 @@ SyncPoller, DeviceInner> beginCreateOrUpdate(String reso * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 {@link SyncPoller} for polling of an device resource belonging to a device group resource. + * @return the {@link SyncPoller} for polling of a device resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DeviceInner> beginCreateOrUpdate(String resourceGroupName, String catalogName, @@ -144,7 +109,7 @@ SyncPoller, DeviceInner> beginCreateOrUpdate(String reso * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 an device resource belonging to a device group resource. + * @return a device resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.SINGLE) DeviceInner createOrUpdate(String resourceGroupName, String catalogName, String productName, String deviceGroupName, @@ -164,7 +129,7 @@ DeviceInner createOrUpdate(String resourceGroupName, String catalogName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 an device resource belonging to a device group resource. + * @return a device resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.SINGLE) DeviceInner createOrUpdate(String resourceGroupName, String catalogName, String productName, String deviceGroupName, @@ -183,7 +148,7 @@ DeviceInner createOrUpdate(String resourceGroupName, String catalogName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 {@link SyncPoller} for polling of an device resource belonging to a device group resource. + * @return the {@link SyncPoller} for polling of a device resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DeviceInner> beginUpdate(String resourceGroupName, String catalogName, @@ -203,7 +168,7 @@ SyncPoller, DeviceInner> beginUpdate(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 {@link SyncPoller} for polling of an device resource belonging to a device group resource. + * @return the {@link SyncPoller} for polling of a device resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DeviceInner> beginUpdate(String resourceGroupName, String catalogName, @@ -222,7 +187,7 @@ SyncPoller, DeviceInner> beginUpdate(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 an device resource belonging to a device group resource. + * @return a device resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.SINGLE) DeviceInner update(String resourceGroupName, String catalogName, String productName, String deviceGroupName, @@ -242,7 +207,7 @@ DeviceInner update(String resourceGroupName, String catalogName, String productN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 an device resource belonging to a device group resource. + * @return a device resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.SINGLE) DeviceInner update(String resourceGroupName, String catalogName, String productName, String deviceGroupName, @@ -316,6 +281,41 @@ void delete(String resourceGroupName, String catalogName, String productName, St void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName, Context context); + /** + * List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used + * for product or device group name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param catalogName Name of catalog. + * @param productName Name of product. + * @param deviceGroupName Name of device 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 the response of a Device list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, + String deviceGroupName); + + /** + * List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used + * for product or device group name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param catalogName Name of catalog. + * @param productName Name of product. + * @param deviceGroupName Name of device 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 the response of a Device list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, Context context); + /** * Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product * names to generate the image for a device that does not belong to a specific device group and product. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/ImagesClient.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/ImagesClient.java index de16245b13d1f..d20a734c54b2d 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/ImagesClient.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/ImagesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.fluent; @@ -17,38 +17,6 @@ * An instance of this class provides access to all the operations defined in ImagesClient. */ public interface ImagesClient { - /** - * List Image resources by Catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 of a Image list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByCatalog(String resourceGroupName, String catalogName); - - /** - * List Image resources by Catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param filter Filter the result list using the given expression. - * @param top The number of result items to return. - * @param skip The number of result items to skip. - * @param maxpagesize The maximum number of result items per page. - * @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 of a Image list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByCatalog(String resourceGroupName, String catalogName, String filter, Integer top, - Integer skip, Integer maxpagesize, Context context); - /** * Get a Image. * @@ -200,4 +168,36 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String catalogName, String imageName, Context context); + + /** + * List Image resources by Catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param catalogName Name of catalog. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 of a Image list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCatalog(String resourceGroupName, String catalogName); + + /** + * List Image resources by Catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param catalogName Name of catalog. + * @param filter Filter the result list using the given expression. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @param maxpagesize The maximum number of result items per page. + * @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 of a Image list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCatalog(String resourceGroupName, String catalogName, String filter, Integer top, + Integer skip, Integer maxpagesize, Context context); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/OperationsClient.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/OperationsClient.java index fa904d1972694..34eb24eb061a8 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/OperationsClient.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/OperationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.fluent; diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/ProductsClient.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/ProductsClient.java index 684c9df9b38b4..ce3783026f77a 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/ProductsClient.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/ProductsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.fluent; @@ -20,33 +20,6 @@ * An instance of this class provides access to all the operations defined in ProductsClient. */ public interface ProductsClient { - /** - * List Product resources by Catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 of a Product list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByCatalog(String resourceGroupName, String catalogName); - - /** - * List Product resources by Catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @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 of a Product list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByCatalog(String resourceGroupName, String catalogName, Context context); - /** * Get a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. * @@ -87,7 +60,7 @@ Response getWithResponse(String resourceGroupName, String catalogN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 {@link SyncPoller} for polling of an product resource belonging to a catalog resource. + * @return the {@link SyncPoller} for polling of a product resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ProductInner> beginCreateOrUpdate(String resourceGroupName, String catalogName, @@ -104,7 +77,7 @@ SyncPoller, ProductInner> beginCreateOrUpdate(String re * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 {@link SyncPoller} for polling of an product resource belonging to a catalog resource. + * @return the {@link SyncPoller} for polling of a product resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ProductInner> beginCreateOrUpdate(String resourceGroupName, String catalogName, @@ -120,7 +93,7 @@ SyncPoller, ProductInner> beginCreateOrUpdate(String re * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 an product resource belonging to a catalog resource. + * @return a product resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.SINGLE) ProductInner createOrUpdate(String resourceGroupName, String catalogName, String productName, @@ -137,7 +110,7 @@ ProductInner createOrUpdate(String resourceGroupName, String catalogName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 an product resource belonging to a catalog resource. + * @return a product resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.SINGLE) ProductInner createOrUpdate(String resourceGroupName, String catalogName, String productName, ProductInner resource, @@ -153,7 +126,7 @@ ProductInner createOrUpdate(String resourceGroupName, String catalogName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 {@link SyncPoller} for polling of an product resource belonging to a catalog resource. + * @return the {@link SyncPoller} for polling of a product resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ProductInner> beginUpdate(String resourceGroupName, String catalogName, @@ -170,7 +143,7 @@ SyncPoller, ProductInner> beginUpdate(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 {@link SyncPoller} for polling of an product resource belonging to a catalog resource. + * @return the {@link SyncPoller} for polling of a product resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ProductInner> beginUpdate(String resourceGroupName, String catalogName, @@ -186,7 +159,7 @@ SyncPoller, ProductInner> beginUpdate(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 an product resource belonging to a catalog resource. + * @return a product resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.SINGLE) ProductInner update(String resourceGroupName, String catalogName, String productName, ProductUpdate properties); @@ -202,7 +175,7 @@ SyncPoller, ProductInner> beginUpdate(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 an product resource belonging to a catalog resource. + * @return a product resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.SINGLE) ProductInner update(String resourceGroupName, String catalogName, String productName, ProductUpdate properties, @@ -265,6 +238,33 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String catalogName, String productName, Context context); + /** + * List Product resources by Catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param catalogName Name of catalog. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 of a Product list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCatalog(String resourceGroupName, String catalogName); + + /** + * List Product resources by Catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param catalogName Name of catalog. + * @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 of a Product list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCatalog(String resourceGroupName, String catalogName, Context context); + /** * Counts devices in product. '.default' and '.unassigned' are system defined values and cannot be used for product * name. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/CatalogInner.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/CatalogInner.java index 298890c77e258..e30bf5729eed4 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/CatalogInner.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/CatalogInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.fluent.models; @@ -127,17 +127,6 @@ public CatalogInner withTags(Map tags) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/CertificateChainResponseInner.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/CertificateChainResponseInner.java index 8926263a40053..84e5cdb2702ed 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/CertificateChainResponseInner.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/CertificateChainResponseInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.fluent.models; @@ -24,7 +24,7 @@ public final class CertificateChainResponseInner implements JsonSerializable { /* * Device ID @@ -63,7 +62,7 @@ public final class DeviceInsightInner implements JsonSerializable { /* * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: @@ -28,8 +28,8 @@ public final class OperationInner implements JsonSerializable { private String name; /* - * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for - * ARM/control-plane operations. + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure + * Resource Manager/control-plane operations. */ private Boolean isDataAction; @@ -45,14 +45,14 @@ public final class OperationInner implements JsonSerializable { private Origin origin; /* - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ private ActionType actionType; /** * Creates an instance of OperationInner class. */ - public OperationInner() { + private OperationInner() { } /** @@ -67,7 +67,7 @@ public String name() { /** * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane - * operations and "false" for ARM/control-plane operations. + * operations and "false" for Azure Resource Manager/control-plane operations. * * @return the isDataAction value. */ @@ -84,17 +84,6 @@ public OperationDisplay display() { return this.display; } - /** - * Set the display property: Localized display information for this particular operation. - * - * @param display the display value to set. - * @return the OperationInner object itself. - */ - public OperationInner withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - /** * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and * audit logs UX. Default value is "user,system". @@ -106,8 +95,8 @@ public Origin origin() { } /** - * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal - * only APIs. + * Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. * * @return the actionType value. */ @@ -115,17 +104,6 @@ public ActionType actionType() { return this.actionType; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/ProductInner.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/ProductInner.java index 67ceee12ae2c4..8b982dbb03275 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/ProductInner.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/ProductInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.fluent.models; @@ -14,7 +14,7 @@ import java.io.IOException; /** - * An product resource belonging to a catalog resource. + * A product resource belonging to a catalog resource. */ @Fluent public final class ProductInner extends ProxyResource { @@ -108,17 +108,6 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/ProofOfPossessionNonceResponseInner.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/ProofOfPossessionNonceResponseInner.java index c995d548b5fa1..f376df3307ba9 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/ProofOfPossessionNonceResponseInner.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/ProofOfPossessionNonceResponseInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.fluent.models; @@ -58,7 +58,7 @@ public final class ProofOfPossessionNonceResponseInner extends CertificateProper /** * Creates an instance of ProofOfPossessionNonceResponseInner class. */ - public ProofOfPossessionNonceResponseInner() { + private ProofOfPossessionNonceResponseInner() { } /** @@ -131,15 +131,6 @@ public String certificate() { return this.certificate; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/SignedCapabilityImageResponseInner.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/SignedCapabilityImageResponseInner.java index 5820b3f23246c..39b7b24b0e6ba 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/SignedCapabilityImageResponseInner.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/SignedCapabilityImageResponseInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.fluent.models; @@ -24,7 +24,7 @@ public final class SignedCapabilityImageResponseInner implements JsonSerializabl /** * Creates an instance of SignedCapabilityImageResponseInner class. */ - public SignedCapabilityImageResponseInner() { + private SignedCapabilityImageResponseInner() { } /** @@ -36,14 +36,6 @@ public String image() { return this.image; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/package-info.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/package-info.java index 44b34f3f416cd..e38ee68971d47 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/package-info.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the inner data models for AzureSphereMgmtClient. + * Package containing the inner data models for AzureSphere. * Azure Sphere resource management API. */ package com.azure.resourcemanager.sphere.fluent.models; diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/package-info.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/package-info.java index 725f0e0fae443..60e9d763eaa87 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/package-info.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the service clients for AzureSphereMgmtClient. + * Package containing the service clients for AzureSphere. * Azure Sphere resource management API. */ package com.azure.resourcemanager.sphere.fluent; diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/AzureSphereMgmtClientBuilder.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/AzureSphereManagementClientBuilder.java similarity index 63% rename from sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/AzureSphereMgmtClientBuilder.java rename to sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/AzureSphereManagementClientBuilder.java index 6ea35a81ce8eb..0876f371a71f8 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/AzureSphereMgmtClientBuilder.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/AzureSphereManagementClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.implementation; @@ -15,39 +15,39 @@ import java.time.Duration; /** - * A builder for creating a new instance of the AzureSphereMgmtClientImpl type. + * A builder for creating a new instance of the AzureSphereManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = { AzureSphereMgmtClientImpl.class }) -public final class AzureSphereMgmtClientBuilder { +@ServiceClientBuilder(serviceClients = { AzureSphereManagementClientImpl.class }) +public final class AzureSphereManagementClientBuilder { /* - * The ID of the target subscription. + * Service host */ - private String subscriptionId; + private String endpoint; /** - * Sets The ID of the target subscription. + * Sets Service host. * - * @param subscriptionId the subscriptionId value. - * @return the AzureSphereMgmtClientBuilder. + * @param endpoint the endpoint value. + * @return the AzureSphereManagementClientBuilder. */ - public AzureSphereMgmtClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; + public AzureSphereManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; return this; } /* - * server parameter + * The ID of the target subscription. The value must be an UUID. */ - private String endpoint; + private String subscriptionId; /** - * Sets server parameter. + * Sets The ID of the target subscription. The value must be an UUID. * - * @param endpoint the endpoint value. - * @return the AzureSphereMgmtClientBuilder. + * @param subscriptionId the subscriptionId value. + * @return the AzureSphereManagementClientBuilder. */ - public AzureSphereMgmtClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + public AzureSphereManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; return this; } @@ -60,9 +60,9 @@ public AzureSphereMgmtClientBuilder endpoint(String endpoint) { * Sets The environment to connect to. * * @param environment the environment value. - * @return the AzureSphereMgmtClientBuilder. + * @return the AzureSphereManagementClientBuilder. */ - public AzureSphereMgmtClientBuilder environment(AzureEnvironment environment) { + public AzureSphereManagementClientBuilder environment(AzureEnvironment environment) { this.environment = environment; return this; } @@ -76,9 +76,9 @@ public AzureSphereMgmtClientBuilder environment(AzureEnvironment environment) { * Sets The HTTP pipeline to send requests through. * * @param pipeline the pipeline value. - * @return the AzureSphereMgmtClientBuilder. + * @return the AzureSphereManagementClientBuilder. */ - public AzureSphereMgmtClientBuilder pipeline(HttpPipeline pipeline) { + public AzureSphereManagementClientBuilder pipeline(HttpPipeline pipeline) { this.pipeline = pipeline; return this; } @@ -92,9 +92,9 @@ public AzureSphereMgmtClientBuilder pipeline(HttpPipeline pipeline) { * Sets The default poll interval for long-running operation. * * @param defaultPollInterval the defaultPollInterval value. - * @return the AzureSphereMgmtClientBuilder. + * @return the AzureSphereManagementClientBuilder. */ - public AzureSphereMgmtClientBuilder defaultPollInterval(Duration defaultPollInterval) { + public AzureSphereManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { this.defaultPollInterval = defaultPollInterval; return this; } @@ -108,19 +108,19 @@ public AzureSphereMgmtClientBuilder defaultPollInterval(Duration defaultPollInte * Sets The serializer to serialize an object into a string. * * @param serializerAdapter the serializerAdapter value. - * @return the AzureSphereMgmtClientBuilder. + * @return the AzureSphereManagementClientBuilder. */ - public AzureSphereMgmtClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + public AzureSphereManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { this.serializerAdapter = serializerAdapter; return this; } /** - * Builds an instance of AzureSphereMgmtClientImpl with the provided parameters. + * Builds an instance of AzureSphereManagementClientImpl with the provided parameters. * - * @return an instance of AzureSphereMgmtClientImpl. + * @return an instance of AzureSphereManagementClientImpl. */ - public AzureSphereMgmtClientImpl buildClient() { + public AzureSphereManagementClientImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; HttpPipeline localPipeline = (pipeline != null) @@ -131,8 +131,8 @@ public AzureSphereMgmtClientImpl buildClient() { SerializerAdapter localSerializerAdapter = (serializerAdapter != null) ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); - AzureSphereMgmtClientImpl client = new AzureSphereMgmtClientImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + AzureSphereManagementClientImpl client = new AzureSphereManagementClientImpl(localPipeline, + localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/AzureSphereMgmtClientImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/AzureSphereManagementClientImpl.java similarity index 76% rename from sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/AzureSphereMgmtClientImpl.java rename to sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/AzureSphereManagementClientImpl.java index 51d87189e728b..f300ac8ca90fd 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/AzureSphereMgmtClientImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/AzureSphereManagementClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.implementation; @@ -15,15 +15,19 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.SyncPollerFactory; +import com.azure.core.util.BinaryData; 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; +import com.azure.core.util.polling.PollResponse; import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.sphere.fluent.AzureSphereMgmtClient; +import com.azure.resourcemanager.sphere.fluent.AzureSphereManagementClient; import com.azure.resourcemanager.sphere.fluent.CatalogsClient; import com.azure.resourcemanager.sphere.fluent.CertificatesClient; import com.azure.resourcemanager.sphere.fluent.DeploymentsClient; @@ -42,31 +46,17 @@ import reactor.core.publisher.Mono; /** - * Initializes a new instance of the AzureSphereMgmtClientImpl type. + * Initializes a new instance of the AzureSphereManagementClientImpl type. */ -@ServiceClient(builder = AzureSphereMgmtClientBuilder.class) -public final class AzureSphereMgmtClientImpl implements AzureSphereMgmtClient { +@ServiceClient(builder = AzureSphereManagementClientBuilder.class) +public final class AzureSphereManagementClientImpl implements AzureSphereManagementClient { /** - * The ID of the target subscription. - */ - private final String subscriptionId; - - /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** - * server parameter. + * Service host. */ private final String endpoint; /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -75,12 +65,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -88,6 +78,20 @@ public String getApiVersion() { return this.apiVersion; } + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + /** * The HTTP pipeline to send requests through. */ @@ -243,22 +247,22 @@ public DevicesClient getDevices() { } /** - * Initializes an instance of AzureSphereMgmtClient client. + * Initializes an instance of AzureSphereManagementClient client. * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param subscriptionId The ID of the target subscription. - * @param endpoint server parameter. + * @param endpoint Service host. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ - AzureSphereMgmtClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + AzureSphereManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.subscriptionId = subscriptionId; this.apiVersion = "2024-04-01"; this.operations = new OperationsClientImpl(this); this.catalogs = new CatalogsClientImpl(this); @@ -307,6 +311,41 @@ public PollerFlux, U> getLroResult(Mono type of poll result. + * @param type of final result. + * @return SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + + /** + * Waits for completion and gets the final result, or throws an error. + * + * @param poller the synchronous poller. + * @param type of poll result. + * @param type of final result. + * @return the final result. + * @throws ManagementException if the long running operation fails. + */ + public U getLroFinalResultOrError(SyncPoller, U> poller) { + PollResponse> response = poller.waitForCompletion(); + ManagementException exception = getLroException(response.getStatus(), response.getValue()); + if (exception != null) { + throw exception; + } + return poller.getFinalResult(); + } + /** * Gets the final result, or an error, based on last async poll response. * @@ -316,17 +355,25 @@ public PollerFlux, U> getLroResult(Mono Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { - if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + ManagementException exception = getLroException(response.getStatus(), response.getValue()); + if (exception != null) { + return Mono.error(exception); + } + return response.getFinalResult(); + } + + private ManagementException getLroException(LongRunningOperationStatus status, PollResult result) { + PollResult.Error lroError = result == null ? null : result.getError(); + if (status != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED || lroError != null) { String errorMessage; ManagementError managementError = null; HttpResponse errorResponse = null; - PollResult.Error lroError = response.getValue().getError(); if (lroError != null) { errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); - errorMessage = response.getValue().getError().getMessage(); - String errorBody = response.getValue().getError().getResponseBody(); + errorMessage = lroError.getMessage(); + String errorBody = lroError.getResponseBody(); if (errorBody != null) { // try to deserialize error body to ManagementError try { @@ -345,12 +392,11 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, } if (managementError == null) { // fallback to default ManagementError - managementError = new ManagementError(response.getStatus().toString(), errorMessage); + managementError = new ManagementError(status.toString(), errorMessage); } - return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); - } else { - return response.getFinalResult(); + return new ManagementException(errorMessage, errorResponse, managementError); } + return null; } private static final class HttpResponseImpl extends HttpResponse { @@ -364,7 +410,7 @@ private static final class HttpResponseImpl extends HttpResponse { super(null); this.statusCode = statusCode; this.httpHeaders = httpHeaders; - this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + this.responseBody = responseBody == null ? new byte[0] : responseBody.getBytes(StandardCharsets.UTF_8); } public int getStatusCode() { @@ -396,5 +442,5 @@ public Mono getBodyAsString(Charset charset) { } } - private static final ClientLogger LOGGER = new ClientLogger(AzureSphereMgmtClientImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(AzureSphereManagementClientImpl.class); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CatalogImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CatalogImpl.java index 7087cf6a5339c..e24f21f7fc423 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CatalogImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CatalogImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.implementation; @@ -93,10 +93,7 @@ public CatalogImpl withExistingResourceGroup(String resourceGroupName) { } public Catalog create() { - this.innerObject = serviceManager.serviceClient() - .getCatalogs() - .createOrUpdate(resourceGroupName, catalogName, this.innerModel(), Context.NONE); - return this; + return this.create(Context.NONE); } public Catalog create(Context context) { @@ -118,11 +115,7 @@ public CatalogImpl update() { } public Catalog apply() { - this.innerObject = serviceManager.serviceClient() - .getCatalogs() - .updateWithResponse(resourceGroupName, catalogName, updateProperties, Context.NONE) - .getValue(); - return this; + return this.apply(Context.NONE); } public Catalog apply(Context context) { @@ -136,16 +129,16 @@ public Catalog apply(Context context) { CatalogImpl(CatalogInner innerObject, com.azure.resourcemanager.sphere.AzureSphereManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.catalogName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "catalogs"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}", + "resourceGroupName"); + this.catalogName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}", + "catalogName"); } public Catalog refresh() { - this.innerObject = serviceManager.serviceClient() - .getCatalogs() - .getByResourceGroupWithResponse(resourceGroupName, catalogName, Context.NONE) - .getValue(); - return this; + return this.refresh(Context.NONE); } public Catalog refresh(Context context) { @@ -239,6 +232,6 @@ public CatalogImpl withProperties(CatalogProperties properties) { } private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CatalogsClientImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CatalogsClientImpl.java index b6dd7624202a5..e9c67edd0616e 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CatalogsClientImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CatalogsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.implementation; @@ -29,6 +29,7 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; @@ -41,13 +42,13 @@ import com.azure.resourcemanager.sphere.fluent.models.DeviceInner; import com.azure.resourcemanager.sphere.fluent.models.DeviceInsightInner; import com.azure.resourcemanager.sphere.fluent.models.ImageInner; -import com.azure.resourcemanager.sphere.models.CatalogListResult; +import com.azure.resourcemanager.sphere.implementation.models.CatalogListResult; +import com.azure.resourcemanager.sphere.implementation.models.DeploymentListResult; +import com.azure.resourcemanager.sphere.implementation.models.DeviceGroupListResult; +import com.azure.resourcemanager.sphere.implementation.models.DeviceListResult; +import com.azure.resourcemanager.sphere.implementation.models.PagedDeviceInsight; import com.azure.resourcemanager.sphere.models.CatalogUpdate; -import com.azure.resourcemanager.sphere.models.DeploymentListResult; -import com.azure.resourcemanager.sphere.models.DeviceGroupListResult; -import com.azure.resourcemanager.sphere.models.DeviceListResult; import com.azure.resourcemanager.sphere.models.ListDeviceGroupsRequest; -import com.azure.resourcemanager.sphere.models.PagedDeviceInsight; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -64,76 +65,136 @@ public final class CatalogsClientImpl implements CatalogsClient { /** * The service client containing this operation class. */ - private final AzureSphereMgmtClientImpl client; + private final AzureSphereManagementClientImpl client; /** * Initializes an instance of CatalogsClientImpl. * * @param client the instance of the service client containing this operation class. */ - CatalogsClientImpl(AzureSphereMgmtClientImpl client) { + CatalogsClientImpl(AzureSphereManagementClientImpl client) { this.service = RestProxy.create(CatalogsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureSphereMgmtClientCatalogs to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for AzureSphereManagementClientCatalogs to be used by the proxy service + * to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "AzureSphereMgmtClien") + @Host("{endpoint}") + @ServiceInterface(name = "AzureSphereManagementClientCatalogs") public interface CatalogsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureSphere/catalogs") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}") - @ExpectedResponses({ 200 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CatalogInner resource, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, - @BodyParam("application/json") CatalogInner resource, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CatalogInner resource, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CatalogUpdate properties, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CatalogUpdate properties, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, - @BodyParam("application/json") CatalogUpdate properties, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureSphere/catalogs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureSphere/catalogs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/countDevices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> countDevices(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, @HeaderParam("Accept") String accept, Context context); @@ -142,7 +203,7 @@ Mono>> delete(@HostParam("$host") String endpoint, @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/countDevices") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> countDevices(@HostParam("$host") String endpoint, + Response countDevicesSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, @HeaderParam("Accept") String accept, Context context); @@ -151,7 +212,18 @@ Mono> countDevices(@HostParam("$host") Strin @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/listDeployments") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listDeployments(@HostParam("$host") String endpoint, + Mono> listDeployments(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, @QueryParam("$skip") Integer skip, + @QueryParam("$maxpagesize") Integer maxpagesize, @PathParam("catalogName") String catalogName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/listDeployments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listDeploymentsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @QueryParam("$skip") Integer skip, @@ -162,19 +234,42 @@ Mono> listDeployments(@HostParam("$host") String @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/listDeviceGroups") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listDeviceGroups(@HostParam("$host") String endpoint, + Mono> listDeviceGroups(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, @QueryParam("$skip") Integer skip, + @QueryParam("$maxpagesize") Integer maxpagesize, @PathParam("catalogName") String catalogName, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ListDeviceGroupsRequest listDeviceGroupsRequest, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/listDeviceGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listDeviceGroupsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, @QueryParam("$skip") Integer skip, + @QueryParam("$maxpagesize") Integer maxpagesize, @PathParam("catalogName") String catalogName, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ListDeviceGroupsRequest listDeviceGroupsRequest, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/listDeviceInsights") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listDeviceInsights(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @QueryParam("$skip") Integer skip, @QueryParam("$maxpagesize") Integer maxpagesize, @PathParam("catalogName") String catalogName, - @BodyParam("application/json") ListDeviceGroupsRequest listDeviceGroupsRequest, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/listDeviceInsights") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listDeviceInsights(@HostParam("$host") String endpoint, + Response listDeviceInsightsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @QueryParam("$skip") Integer skip, @@ -185,7 +280,7 @@ Mono> listDeviceInsights(@HostParam("$host") String @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/listDevices") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listDevices(@HostParam("$host") String endpoint, + Mono> listDevices(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @QueryParam("$skip") Integer skip, @@ -193,299 +288,129 @@ Mono> listDevices(@HostParam("$host") String endpoint @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/listDevices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listDevicesSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, @QueryParam("$skip") Integer skip, + @QueryParam("$maxpagesize") Integer maxpagesize, @PathParam("catalogName") String catalogName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/uploadImage") @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> uploadImage(@HostParam("$host") String endpoint, + Mono>> uploadImage(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, - @BodyParam("application/json") ImageInner uploadImageRequest, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") ImageInner uploadImageRequest, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/uploadImage") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response uploadImageSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") ImageInner uploadImageRequest, 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, + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listDeploymentsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listDeviceGroupsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listDeviceInsightsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Mono> listDeploymentsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listDevicesNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * List Catalog resources by subscription ID. - * - * @throws 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 of a Catalog list operation 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.getApiVersion(), - this.client.getSubscriptionId(), 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())); - } - - /** - * List Catalog resources by subscription ID. - * - * @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 of a Catalog list operation 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.getApiVersion(), this.client.getSubscriptionId(), accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List Catalog resources by subscription ID. - * - * @throws 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 of a Catalog list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * List Catalog resources by subscription ID. - * - * @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 of a Catalog list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * List Catalog resources by subscription ID. - * - * @throws 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 of a Catalog list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * List Catalog resources by subscription ID. - * - * @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 of a Catalog list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * List Catalog resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 of a Catalog list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } + Response listDeploymentsNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); - /** - * List Catalog resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @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 of a Catalog list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listDeviceGroupsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); - /** - * List Catalog resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 of a Catalog list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listDeviceGroupsNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); - /** - * List Catalog resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @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 of a Catalog list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listDeviceInsightsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); - /** - * List Catalog resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 of a Catalog list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listDeviceInsightsNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); - /** - * List Catalog resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @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 of a Catalog list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listDevicesNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listDevicesNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -501,21 +426,6 @@ public PagedIterable listByResourceGroup(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String catalogName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), @@ -523,41 +433,6 @@ private Mono> getByResourceGroupWithResponseAsync(String .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get a Catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @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 Catalog along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String catalogName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, accept, context); - } - /** * Get a Catalog. * @@ -574,33 +449,16 @@ private Mono getByResourceGroupAsync(String resourceGroupName, Str .flatMap(res -> Mono.justOrEmpty(res.getValue())); } - /** - * Get a Catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @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 Catalog along with {@link Response}. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, String catalogName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, catalogName, context).block(); + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, accept, context); } - /** - * Get a Catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Catalog. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public CatalogInner getByResourceGroup(String resourceGroupName, String catalogName) { return getByResourceGroupWithResponse(resourceGroupName, catalogName, Context.NONE).getValue(); @@ -620,30 +478,12 @@ public CatalogInner getByResourceGroup(String resourceGroupName, String catalogN @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String catalogName, CatalogInner 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 (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName 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 contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, resource, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, catalogName, contentType, accept, resource, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -653,39 +493,15 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param resource Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Sphere catalog along with {@link Response} on successful completion of {@link Mono}. + * @return an Azure Sphere catalog along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String catalogName, CatalogInner 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 (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName 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.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, resource, accept, context); + private Response createOrUpdateWithResponse(String resourceGroupName, String catalogName, + CatalogInner resource) { + return createOrUpdateWithResponse(resourceGroupName, catalogName, resource, Context.NONE); } /** @@ -694,18 +510,19 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param resource Resource create parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an Azure Sphere catalog. + * @return an Azure Sphere catalog along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CatalogInner> beginCreateOrUpdateAsync(String resourceGroupName, - String catalogName, CatalogInner resource) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, catalogName, resource); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - CatalogInner.class, CatalogInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String catalogName, + CatalogInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, contentType, accept, resource, context); } /** @@ -714,7 +531,6 @@ private PollerFlux, CatalogInner> beginCreateOrUpdateAs * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param resource Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -722,47 +538,27 @@ private PollerFlux, CatalogInner> beginCreateOrUpdateAs */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, CatalogInner> beginCreateOrUpdateAsync(String resourceGroupName, - String catalogName, CatalogInner resource, Context context) { - context = this.client.mergeContext(context); + String catalogName, CatalogInner resource) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, catalogName, resource, context); + = createOrUpdateWithResponseAsync(resourceGroupName, catalogName, resource); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - CatalogInner.class, CatalogInner.class, context); + CatalogInner.class, CatalogInner.class, this.client.getContext()); } - /** - * Create a Catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an Azure Sphere catalog. - */ + @Override @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, CatalogInner> beginCreateOrUpdate(String resourceGroupName, String catalogName, CatalogInner resource) { - return this.beginCreateOrUpdateAsync(resourceGroupName, catalogName, resource).getSyncPoller(); + return beginCreateOrUpdate(resourceGroupName, catalogName, resource, Context.NONE); } - /** - * Create a Catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an Azure Sphere catalog. - */ + @Override @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, CatalogInner> beginCreateOrUpdate(String resourceGroupName, String catalogName, CatalogInner resource, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, catalogName, resource, context).getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, catalogName, resource, context); + return this.client.getLroResult(response, CatalogInner.class, CatalogInner.class, + context); } /** @@ -783,57 +579,18 @@ private Mono createOrUpdateAsync(String resourceGroupName, String .flatMap(this.client::getLroFinalResultOrError); } - /** - * Create a Catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Sphere catalog on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String catalogName, CatalogInner resource, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, catalogName, resource, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create a Catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Sphere catalog. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public CatalogInner createOrUpdate(String resourceGroupName, String catalogName, CatalogInner resource) { - return createOrUpdateAsync(resourceGroupName, catalogName, resource).block(); + return createOrUpdate(resourceGroupName, catalogName, resource, Context.NONE); } - /** - * Create a Catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Sphere catalog. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public CatalogInner createOrUpdate(String resourceGroupName, String catalogName, CatalogInner resource, Context context) { - return createOrUpdateAsync(resourceGroupName, catalogName, resource, context).block(); + return this.client + .getLroFinalResultOrError(beginCreateOrUpdate(resourceGroupName, catalogName, resource, context)); } /** @@ -850,30 +607,10 @@ public CatalogInner createOrUpdate(String resourceGroupName, String catalogName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, String catalogName, CatalogUpdate properties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, properties, accept, context)) + return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, contentType, accept, properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -883,90 +620,81 @@ private Mono> updateWithResponseAsync(String resourceGrou * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param properties The resource properties to be updated. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Sphere catalog along with {@link Response} on successful completion of {@link Mono}. + * @return an Azure Sphere catalog on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String catalogName, + private Mono updateAsync(String resourceGroupName, String catalogName, CatalogUpdate properties) { + return updateWithResponseAsync(resourceGroupName, catalogName, properties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + @Override + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String catalogName, CatalogUpdate properties, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, catalogName, properties, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, contentType, accept, properties, context); + } + + @Override + @ServiceMethod(returns = ReturnType.SINGLE) + public CatalogInner update(String resourceGroupName, String catalogName, CatalogUpdate properties) { + return updateWithResponse(resourceGroupName, catalogName, properties, Context.NONE).getValue(); } /** - * Update a Catalog. + * Delete a Catalog. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Sphere catalog on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String catalogName, CatalogUpdate properties) { - return updateWithResponseAsync(resourceGroupName, catalogName, properties) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono>> deleteWithResponseAsync(String resourceGroupName, String catalogName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Update a Catalog. + * Delete a Catalog. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param properties The resource properties to be updated. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Sphere catalog along with {@link Response}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String catalogName, - CatalogUpdate properties, Context context) { - return updateWithResponseAsync(resourceGroupName, catalogName, properties, context).block(); + private Response deleteWithResponse(String resourceGroupName, String catalogName) { + return deleteWithResponse(resourceGroupName, catalogName, Context.NONE); } /** - * Update a Catalog. + * Delete a Catalog. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Sphere catalog. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CatalogInner update(String resourceGroupName, String catalogName, CatalogUpdate properties) { - return updateWithResponse(resourceGroupName, catalogName, properties, Context.NONE).getValue(); + private Response deleteWithResponse(String resourceGroupName, String catalogName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, context); } /** @@ -977,30 +705,27 @@ public CatalogInner update(String resourceGroupName, String catalogName, Catalog * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 {@link Response} on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String catalogName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String catalogName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, catalogName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + @Override + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName) { + return beginDelete(resourceGroupName, catalogName, Context.NONE); + } + + @Override + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, + Context context) { + Response response = deleteWithResponse(resourceGroupName, catalogName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -1008,164 +733,183 @@ private Mono>> deleteWithResponseAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @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 {@link Response} on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String catalogName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, catalogName, accept, context); + private Mono deleteAsync(String resourceGroupName, String catalogName) { + return beginDeleteAsync(resourceGroupName, catalogName).last().flatMap(this.client::getLroFinalResultOrError); + } + + @Override + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String catalogName) { + delete(resourceGroupName, catalogName, Context.NONE); + } + + @Override + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String catalogName, Context context) { + this.client.getLroFinalResultOrError(beginDelete(resourceGroupName, catalogName, context)); } /** - * Delete a Catalog. + * List Catalog resources by resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 {@link PollerFlux} for polling of long-running operation. + * @return the response of a Catalog list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String catalogName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, catalogName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete a Catalog. + * List Catalog resources by resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @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 {@link PollerFlux} for polling of long-running operation. + * @return the response of a Catalog list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String catalogName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, catalogName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** - * Delete a Catalog. + * List Catalog resources by resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 {@link SyncPoller} for polling of long-running operation. + * @return the response of a Catalog list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName) { - return this.beginDeleteAsync(resourceGroupName, catalogName).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { + return listByResourceGroupSinglePage(resourceGroupName, Context.NONE); } /** - * Delete a Catalog. + * List Catalog resources by resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. * @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 {@link SyncPoller} for polling of long-running operation. + * @return the response of a Catalog list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, - Context context) { - return this.beginDeleteAsync(resourceGroupName, catalogName, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + @Override + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return listByResourceGroup(resourceGroupName, Context.NONE); + } + + @Override + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); } /** - * Delete a Catalog. + * List Catalog resources by subscription ID. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 {@link Mono} that completes when a successful response is received. + * @return the response of a Catalog list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String catalogName) { - return beginDeleteAsync(resourceGroupName, catalogName).last().flatMap(this.client::getLroFinalResultOrError); + private Mono> listSinglePageAsync() { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete a Catalog. + * List Catalog resources by subscription ID. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @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 {@link Mono} that completes when a successful response is received. + * @return the response of a Catalog list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String catalogName, Context context) { - return beginDeleteAsync(resourceGroupName, catalogName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** - * Delete a Catalog. + * List Catalog resources by subscription ID. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 of a Catalog list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String catalogName) { - deleteAsync(resourceGroupName, catalogName).block(); + private PagedResponse listSinglePage() { + return listSinglePage(Context.NONE); } /** - * Delete a Catalog. + * List Catalog resources by subscription ID. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. * @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 of a Catalog list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String catalogName, Context context) { - deleteAsync(resourceGroupName, catalogName, context).block(); + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + @Override + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return list(Context.NONE); + } + + @Override + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); } /** @@ -1182,21 +926,6 @@ public void delete(String resourceGroupName, String catalogName, Context context @ServiceMethod(returns = ReturnType.SINGLE) private Mono> countDevicesWithResponseAsync(String resourceGroupName, String catalogName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.countDevices(this.client.getEndpoint(), this.client.getApiVersion(), @@ -1204,42 +933,6 @@ private Mono> countDevicesWithResponseAsync( .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Counts devices in catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @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 response to the action call for count devices in a catalog along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> countDevicesWithResponseAsync(String resourceGroupName, - String catalogName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.countDevices(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, accept, context); - } - /** * Counts devices in catalog. * @@ -1256,33 +949,16 @@ private Mono countDevicesAsync(String resourceGroupNa .flatMap(res -> Mono.justOrEmpty(res.getValue())); } - /** - * Counts devices in catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @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 response to the action call for count devices in a catalog along with {@link Response}. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public Response countDevicesWithResponse(String resourceGroupName, String catalogName, Context context) { - return countDevicesWithResponseAsync(resourceGroupName, catalogName, context).block(); + final String accept = "application/json"; + return service.countDevicesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, accept, context); } - /** - * Counts devices in catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response to the action call for count devices in a catalog. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public CountDevicesResponseInner countDevices(String resourceGroupName, String catalogName) { return countDevicesWithResponse(resourceGroupName, catalogName, Context.NONE).getValue(); @@ -1306,21 +982,6 @@ public CountDevicesResponseInner countDevices(String resourceGroupName, String c @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeploymentsSinglePageAsync(String resourceGroupName, String catalogName, String filter, Integer top, Integer skip, Integer maxpagesize) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listDeployments(this.client.getEndpoint(), this.client.getApiVersion(), @@ -1331,49 +992,6 @@ private Mono> listDeploymentsSinglePageAsync(Stri .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Lists deployments for catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param filter Filter the result list using the given expression. - * @param top The number of result items to return. - * @param skip The number of result items to skip. - * @param maxpagesize The maximum number of result items per page. - * @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 of a Deployment list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeploymentsSinglePageAsync(String resourceGroupName, - String catalogName, String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listDeployments(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, filter, top, skip, maxpagesize, catalogName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - /** * Lists deployments for catalog. * @@ -1426,17 +1044,15 @@ private PagedFlux listDeploymentsAsync(String resourceGroupName * @param top The number of result items to return. * @param skip The number of result items to skip. * @param maxpagesize The maximum number of result items per page. - * @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 of a Deployment list operation as paginated response with {@link PagedFlux}. + * @return the response of a Deployment list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listDeploymentsAsync(String resourceGroupName, String catalogName, String filter, - Integer top, Integer skip, Integer maxpagesize, Context context) { - return new PagedFlux<>(() -> listDeploymentsSinglePageAsync(resourceGroupName, catalogName, filter, top, skip, - maxpagesize, context), nextLink -> listDeploymentsNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listDeploymentsSinglePage(String resourceGroupName, String catalogName, + String filter, Integer top, Integer skip, Integer maxpagesize) { + return listDeploymentsSinglePage(resourceGroupName, catalogName, filter, top, skip, maxpagesize, Context.NONE); } /** @@ -1444,41 +1060,44 @@ private PagedFlux listDeploymentsAsync(String resourceGroupName * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. + * @param filter Filter the result list using the given expression. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @param maxpagesize The maximum number of result items per page. + * @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 of a Deployment list operation as paginated response with {@link PagedIterable}. + * @return the response of a Deployment list operation along with {@link PagedResponse}. */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listDeploymentsSinglePage(String resourceGroupName, String catalogName, + String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { + final String accept = "application/json"; + Response res = service.listDeploymentsSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, filter, top, skip, + maxpagesize, catalogName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + @Override @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDeployments(String resourceGroupName, String catalogName) { final String filter = null; final Integer top = null; final Integer skip = null; final Integer maxpagesize = null; - return new PagedIterable<>( - listDeploymentsAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize)); + return listDeployments(resourceGroupName, catalogName, filter, top, skip, maxpagesize, Context.NONE); } - /** - * Lists deployments for catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param filter Filter the result list using the given expression. - * @param top The number of result items to return. - * @param skip The number of result items to skip. - * @param maxpagesize The maximum number of result items per page. - * @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 of a Deployment list operation as paginated response with {@link PagedIterable}. - */ + @Override @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDeployments(String resourceGroupName, String catalogName, String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { return new PagedIterable<>( - listDeploymentsAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context)); + () -> listDeploymentsSinglePage(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context), + nextLink -> listDeploymentsNextSinglePage(nextLink, context)); } /** @@ -1501,89 +1120,16 @@ public PagedIterable listDeployments(String resourceGroupName, private Mono> listDeviceGroupsSinglePageAsync(String resourceGroupName, String catalogName, ListDeviceGroupsRequest listDeviceGroupsRequest, String filter, Integer top, Integer skip, Integer maxpagesize) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (listDeviceGroupsRequest == null) { - return Mono.error( - new IllegalArgumentException("Parameter listDeviceGroupsRequest is required and cannot be null.")); - } else { - listDeviceGroupsRequest.validate(); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listDeviceGroups(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, filter, top, skip, maxpagesize, catalogName, - listDeviceGroupsRequest, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, filter, top, skip, maxpagesize, catalogName, accept, + listDeviceGroupsRequest, 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())); } - /** - * List the device groups for the catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param listDeviceGroupsRequest List device groups for catalog. - * @param filter Filter the result list using the given expression. - * @param top The number of result items to return. - * @param skip The number of result items to skip. - * @param maxpagesize The maximum number of result items per page. - * @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 of a DeviceGroup list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeviceGroupsSinglePageAsync(String resourceGroupName, - String catalogName, ListDeviceGroupsRequest listDeviceGroupsRequest, String filter, Integer top, Integer skip, - Integer maxpagesize, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (listDeviceGroupsRequest == null) { - return Mono.error( - new IllegalArgumentException("Parameter listDeviceGroupsRequest is required and cannot be null.")); - } else { - listDeviceGroupsRequest.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listDeviceGroups(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, filter, top, skip, maxpagesize, catalogName, listDeviceGroupsRequest, accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - /** * List the device groups for the catalog. * @@ -1641,19 +1187,17 @@ private PagedFlux listDeviceGroupsAsync(String resourceGroupNa * @param top The number of result items to return. * @param skip The number of result items to skip. * @param maxpagesize The maximum number of result items per page. - * @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 of a DeviceGroup list operation as paginated response with {@link PagedFlux}. + * @return the response of a DeviceGroup list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listDeviceGroupsAsync(String resourceGroupName, String catalogName, - ListDeviceGroupsRequest listDeviceGroupsRequest, String filter, Integer top, Integer skip, Integer maxpagesize, - Context context) { - return new PagedFlux<>(() -> listDeviceGroupsSinglePageAsync(resourceGroupName, catalogName, - listDeviceGroupsRequest, filter, top, skip, maxpagesize, context), - nextLink -> listDeviceGroupsNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listDeviceGroupsSinglePage(String resourceGroupName, String catalogName, + ListDeviceGroupsRequest listDeviceGroupsRequest, String filter, Integer top, Integer skip, + Integer maxpagesize) { + return listDeviceGroupsSinglePage(resourceGroupName, catalogName, listDeviceGroupsRequest, filter, top, skip, + maxpagesize, Context.NONE); } /** @@ -1662,11 +1206,29 @@ private PagedFlux listDeviceGroupsAsync(String resourceGroupNa * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param listDeviceGroupsRequest List device groups for catalog. + * @param filter Filter the result list using the given expression. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @param maxpagesize The maximum number of result items per page. + * @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 of a DeviceGroup list operation as paginated response with {@link PagedIterable}. + * @return the response of a DeviceGroup list operation along with {@link PagedResponse}. */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listDeviceGroupsSinglePage(String resourceGroupName, String catalogName, + ListDeviceGroupsRequest listDeviceGroupsRequest, String filter, Integer top, Integer skip, Integer maxpagesize, + Context context) { + final String accept = "application/json"; + Response res = service.listDeviceGroupsSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, filter, top, skip, + maxpagesize, catalogName, accept, listDeviceGroupsRequest, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + @Override @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDeviceGroups(String resourceGroupName, String catalogName, ListDeviceGroupsRequest listDeviceGroupsRequest) { @@ -1674,32 +1236,18 @@ public PagedIterable listDeviceGroups(String resourceGroupName final Integer top = null; final Integer skip = null; final Integer maxpagesize = null; - return new PagedIterable<>(listDeviceGroupsAsync(resourceGroupName, catalogName, listDeviceGroupsRequest, - filter, top, skip, maxpagesize)); + return listDeviceGroups(resourceGroupName, catalogName, listDeviceGroupsRequest, filter, top, skip, maxpagesize, + Context.NONE); } - /** - * List the device groups for the catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param listDeviceGroupsRequest List device groups for catalog. - * @param filter Filter the result list using the given expression. - * @param top The number of result items to return. - * @param skip The number of result items to skip. - * @param maxpagesize The maximum number of result items per page. - * @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 of a DeviceGroup list operation as paginated response with {@link PagedIterable}. - */ + @Override @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDeviceGroups(String resourceGroupName, String catalogName, ListDeviceGroupsRequest listDeviceGroupsRequest, String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { - return new PagedIterable<>(listDeviceGroupsAsync(resourceGroupName, catalogName, listDeviceGroupsRequest, - filter, top, skip, maxpagesize, context)); + return new PagedIterable<>(() -> listDeviceGroupsSinglePage(resourceGroupName, catalogName, + listDeviceGroupsRequest, filter, top, skip, maxpagesize, context), + nextLink -> listDeviceGroupsNextSinglePage(nextLink, context)); } /** @@ -1720,72 +1268,14 @@ public PagedIterable listDeviceGroups(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeviceInsightsSinglePageAsync(String resourceGroupName, String catalogName, String filter, Integer top, Integer skip, Integer maxpagesize) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listDeviceInsights(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, filter, top, skip, maxpagesize, catalogName, 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())); - } - - /** - * Lists device insights for catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param filter Filter the result list using the given expression. - * @param top The number of result items to return. - * @param skip The number of result items to skip. - * @param maxpagesize The maximum number of result items per page. - * @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 paged collection of DeviceInsight items along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeviceInsightsSinglePageAsync(String resourceGroupName, - String catalogName, String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listDeviceInsights(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, filter, top, skip, maxpagesize, catalogName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + .>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())); } /** @@ -1840,17 +1330,16 @@ private PagedFlux listDeviceInsightsAsync(String resourceGro * @param top The number of result items to return. * @param skip The number of result items to skip. * @param maxpagesize The maximum number of result items per page. - * @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 paged collection of DeviceInsight items as paginated response with {@link PagedFlux}. + * @return paged collection of DeviceInsight items along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listDeviceInsightsAsync(String resourceGroupName, String catalogName, - String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { - return new PagedFlux<>(() -> listDeviceInsightsSinglePageAsync(resourceGroupName, catalogName, filter, top, - skip, maxpagesize, context), nextLink -> listDeviceInsightsNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listDeviceInsightsSinglePage(String resourceGroupName, String catalogName, + String filter, Integer top, Integer skip, Integer maxpagesize) { + return listDeviceInsightsSinglePage(resourceGroupName, catalogName, filter, top, skip, maxpagesize, + Context.NONE); } /** @@ -1858,41 +1347,44 @@ private PagedFlux listDeviceInsightsAsync(String resourceGro * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. + * @param filter Filter the result list using the given expression. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @param maxpagesize The maximum number of result items per page. + * @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 paged collection of DeviceInsight items as paginated response with {@link PagedIterable}. + * @return paged collection of DeviceInsight items along with {@link PagedResponse}. */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listDeviceInsightsSinglePage(String resourceGroupName, String catalogName, + String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { + final String accept = "application/json"; + Response res = service.listDeviceInsightsSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, filter, top, skip, + maxpagesize, catalogName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + @Override @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDeviceInsights(String resourceGroupName, String catalogName) { final String filter = null; final Integer top = null; final Integer skip = null; final Integer maxpagesize = null; - return new PagedIterable<>( - listDeviceInsightsAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize)); + return listDeviceInsights(resourceGroupName, catalogName, filter, top, skip, maxpagesize, Context.NONE); } - /** - * Lists device insights for catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param filter Filter the result list using the given expression. - * @param top The number of result items to return. - * @param skip The number of result items to skip. - * @param maxpagesize The maximum number of result items per page. - * @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 paged collection of DeviceInsight items as paginated response with {@link PagedIterable}. - */ + @Override @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDeviceInsights(String resourceGroupName, String catalogName, String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { return new PagedIterable<>( - listDeviceInsightsAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context)); + () -> listDeviceInsightsSinglePage(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context), + nextLink -> listDeviceInsightsNextSinglePage(nextLink, context)); } /** @@ -1913,21 +1405,6 @@ public PagedIterable listDeviceInsights(String resourceGroup @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDevicesSinglePageAsync(String resourceGroupName, String catalogName, String filter, Integer top, Integer skip, Integer maxpagesize) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listDevices(this.client.getEndpoint(), this.client.getApiVersion(), @@ -1938,49 +1415,6 @@ private Mono> listDevicesSinglePageAsync(String resou .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Lists devices for catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param filter Filter the result list using the given expression. - * @param top The number of result items to return. - * @param skip The number of result items to skip. - * @param maxpagesize The maximum number of result items per page. - * @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 of a Device list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDevicesSinglePageAsync(String resourceGroupName, String catalogName, - String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listDevices(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, filter, top, skip, maxpagesize, catalogName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - /** * Lists devices for catalog. * @@ -2033,18 +1467,15 @@ private PagedFlux listDevicesAsync(String resourceGroupName, String * @param top The number of result items to return. * @param skip The number of result items to skip. * @param maxpagesize The maximum number of result items per page. - * @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 of a Device list operation as paginated response with {@link PagedFlux}. + * @return the response of a Device list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listDevicesAsync(String resourceGroupName, String catalogName, String filter, - Integer top, Integer skip, Integer maxpagesize, Context context) { - return new PagedFlux<>( - () -> listDevicesSinglePageAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context), - nextLink -> listDevicesNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listDevicesSinglePage(String resourceGroupName, String catalogName, + String filter, Integer top, Integer skip, Integer maxpagesize) { + return listDevicesSinglePage(resourceGroupName, catalogName, filter, top, skip, maxpagesize, Context.NONE); } /** @@ -2052,40 +1483,44 @@ private PagedFlux listDevicesAsync(String resourceGroupName, String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. + * @param filter Filter the result list using the given expression. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @param maxpagesize The maximum number of result items per page. + * @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 of a Device list operation as paginated response with {@link PagedIterable}. + * @return the response of a Device list operation along with {@link PagedResponse}. */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listDevicesSinglePage(String resourceGroupName, String catalogName, + String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { + final String accept = "application/json"; + Response res = service.listDevicesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, top, skip, maxpagesize, catalogName, accept, + context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + @Override @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDevices(String resourceGroupName, String catalogName) { final String filter = null; final Integer top = null; final Integer skip = null; final Integer maxpagesize = null; - return new PagedIterable<>(listDevicesAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize)); + return listDevices(resourceGroupName, catalogName, filter, top, skip, maxpagesize, Context.NONE); } - /** - * Lists devices for catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param filter Filter the result list using the given expression. - * @param top The number of result items to return. - * @param skip The number of result items to skip. - * @param maxpagesize The maximum number of result items per page. - * @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 of a Device list operation as paginated response with {@link PagedIterable}. - */ + @Override @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDevices(String resourceGroupName, String catalogName, String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { return new PagedIterable<>( - listDevicesAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context)); + () -> listDevicesSinglePage(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context), + nextLink -> listDevicesNextSinglePage(nextLink, context)); } /** @@ -2102,31 +1537,11 @@ public PagedIterable listDevices(String resourceGroupName, String c @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> uploadImageWithResponseAsync(String resourceGroupName, String catalogName, ImageInner uploadImageRequest) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (uploadImageRequest == null) { - return Mono - .error(new IllegalArgumentException("Parameter uploadImageRequest is required and cannot be null.")); - } else { - uploadImageRequest.validate(); - } - final String accept = "application/json"; + final String contentType = "application/json"; return FluxUtil .withContext(context -> service.uploadImage(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, uploadImageRequest, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, catalogName, contentType, uploadImageRequest, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -2136,40 +1551,15 @@ private Mono>> uploadImageWithResponseAsync(String res * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param uploadImageRequest Image upload request body. - * @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 {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> uploadImageWithResponseAsync(String resourceGroupName, String catalogName, - ImageInner uploadImageRequest, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (uploadImageRequest == null) { - return Mono - .error(new IllegalArgumentException("Parameter uploadImageRequest is required and cannot be null.")); - } else { - uploadImageRequest.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.uploadImage(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, uploadImageRequest, accept, context); + private Response uploadImageWithResponse(String resourceGroupName, String catalogName, + ImageInner uploadImageRequest) { + return uploadImageWithResponse(resourceGroupName, catalogName, uploadImageRequest, Context.NONE); } /** @@ -2178,18 +1568,18 @@ private Mono>> uploadImageWithResponseAsync(String res * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param uploadImageRequest Image upload request body. + * @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 {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginUploadImageAsync(String resourceGroupName, String catalogName, - ImageInner uploadImageRequest) { - Mono>> mono - = uploadImageWithResponseAsync(resourceGroupName, catalogName, uploadImageRequest); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response uploadImageWithResponse(String resourceGroupName, String catalogName, + ImageInner uploadImageRequest, Context context) { + final String contentType = "application/json"; + return service.uploadImageSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, contentType, uploadImageRequest, context); } /** @@ -2198,7 +1588,6 @@ private PollerFlux, Void> beginUploadImageAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param uploadImageRequest Image upload request body. - * @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. @@ -2206,47 +1595,27 @@ private PollerFlux, Void> beginUploadImageAsync(String resource */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginUploadImageAsync(String resourceGroupName, String catalogName, - ImageInner uploadImageRequest, Context context) { - context = this.client.mergeContext(context); + ImageInner uploadImageRequest) { Mono>> mono - = uploadImageWithResponseAsync(resourceGroupName, catalogName, uploadImageRequest, context); + = uploadImageWithResponseAsync(resourceGroupName, catalogName, uploadImageRequest); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } - /** - * Creates an image. Use this action when the image ID is unknown. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param uploadImageRequest Image upload request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 {@link SyncPoller} for polling of long-running operation. - */ + @Override @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginUploadImage(String resourceGroupName, String catalogName, ImageInner uploadImageRequest) { - return this.beginUploadImageAsync(resourceGroupName, catalogName, uploadImageRequest).getSyncPoller(); + return beginUploadImage(resourceGroupName, catalogName, uploadImageRequest, Context.NONE); } - /** - * Creates an image. Use this action when the image ID is unknown. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param uploadImageRequest Image upload request body. - * @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 {@link SyncPoller} for polling of long-running operation. - */ + @Override @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginUploadImage(String resourceGroupName, String catalogName, ImageInner uploadImageRequest, Context context) { - return this.beginUploadImageAsync(resourceGroupName, catalogName, uploadImageRequest, context).getSyncPoller(); + Response response + = uploadImageWithResponse(resourceGroupName, catalogName, uploadImageRequest, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -2266,55 +1635,72 @@ private Mono uploadImageAsync(String resourceGroupName, String catalogName .flatMap(this.client::getLroFinalResultOrError); } + @Override + @ServiceMethod(returns = ReturnType.SINGLE) + public void uploadImage(String resourceGroupName, String catalogName, ImageInner uploadImageRequest) { + uploadImage(resourceGroupName, catalogName, uploadImageRequest, Context.NONE); + } + + @Override + @ServiceMethod(returns = ReturnType.SINGLE) + public void uploadImage(String resourceGroupName, String catalogName, ImageInner uploadImageRequest, + Context context) { + this.client + .getLroFinalResultOrError(beginUploadImage(resourceGroupName, catalogName, uploadImageRequest, context)); + } + /** - * Creates an image. Use this action when the image ID is unknown. + * Get the next page of items. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param uploadImageRequest Image upload request body. - * @param context The context to associate with this operation. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 {@link Mono} that completes when a successful response is received. + * @return the response of a Catalog list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono uploadImageAsync(String resourceGroupName, String catalogName, ImageInner uploadImageRequest, - Context context) { - return beginUploadImageAsync(resourceGroupName, catalogName, uploadImageRequest, context).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + 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())); } /** - * Creates an image. Use this action when the image ID is unknown. + * Get the next page of items. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param uploadImageRequest Image upload request body. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 of a Catalog list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void uploadImage(String resourceGroupName, String catalogName, ImageInner uploadImageRequest) { - uploadImageAsync(resourceGroupName, catalogName, uploadImageRequest).block(); + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + return listByResourceGroupNextSinglePage(nextLink, Context.NONE); } /** - * Creates an image. Use this action when the image ID is unknown. + * Get the next page of items. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param uploadImageRequest Image upload request body. + * @param nextLink The URL to get the next list of items. * @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 of a Catalog list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void uploadImage(String resourceGroupName, String catalogName, ImageInner uploadImageRequest, - Context context) { - uploadImageAsync(resourceGroupName, catalogName, uploadImageRequest, context).block(); + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -2329,13 +1715,6 @@ public void uploadImage(String resourceGroupName, String catalogName, ImageInner */ @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( @@ -2349,82 +1728,53 @@ private Mono> listBySubscriptionNextSinglePageAsync( * Get the next page of items. * * @param nextLink The URL to get the next list of items. - * @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 of a Catalog list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a Catalog list operation along with {@link PagedResponse}. */ @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)); + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + return listBySubscriptionNextSinglePage(nextLink, Context.NONE); } /** * Get the next page of items. * * @param nextLink The URL to get the next list of items. + * @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 of a Catalog list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a Catalog list operation along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { 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())); + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * Get the next page of items. * * @param nextLink The URL to get the next list of items. - * @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 of a Catalog list operation along with {@link PagedResponse} on successful completion of + * @return the response of a Deployment list operation along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @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.")); - } + private Mono> listDeploymentsNextSinglePageAsync(String nextLink) { 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)); + return FluxUtil + .withContext(context -> service.listDeploymentsNext(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())); } /** @@ -2434,24 +1784,11 @@ private Mono> listByResourceGroupNextSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 of a Deployment list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a Deployment list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeploymentsNextSinglePageAsync(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.listDeploymentsNext(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())); + private PagedResponse listDeploymentsNextSinglePage(String nextLink) { + return listDeploymentsNextSinglePage(nextLink, Context.NONE); } /** @@ -2462,23 +1799,15 @@ private Mono> listDeploymentsNextSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 of a Deployment list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a Deployment list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeploymentsNextSinglePageAsync(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.")); - } + private PagedResponse listDeploymentsNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listDeploymentsNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listDeploymentsNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -2493,13 +1822,6 @@ private Mono> listDeploymentsNextSinglePageAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeviceGroupsNextSinglePageAsync(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.listDeviceGroupsNext(nextLink, this.client.getEndpoint(), accept, context)) @@ -2508,6 +1830,20 @@ private Mono> listDeviceGroupsNextSinglePageAsyn .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 of a DeviceGroup list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listDeviceGroupsNextSinglePage(String nextLink) { + return listDeviceGroupsNextSinglePage(nextLink, Context.NONE); + } + /** * Get the next page of items. * @@ -2516,24 +1852,15 @@ private Mono> listDeviceGroupsNextSinglePageAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 of a DeviceGroup list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a DeviceGroup list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeviceGroupsNextSinglePageAsync(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.")); - } + private PagedResponse listDeviceGroupsNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listDeviceGroupsNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listDeviceGroupsNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -2548,13 +1875,6 @@ private Mono> listDeviceGroupsNextSinglePageAsyn */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeviceInsightsNextSinglePageAsync(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( @@ -2564,6 +1884,20 @@ private Mono> listDeviceInsightsNextSinglePage .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of DeviceInsight items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listDeviceInsightsNextSinglePage(String nextLink) { + return listDeviceInsightsNextSinglePage(nextLink, Context.NONE); + } + /** * Get the next page of items. * @@ -2572,24 +1906,15 @@ private Mono> listDeviceInsightsNextSinglePage * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged collection of DeviceInsight items along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return paged collection of DeviceInsight items along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeviceInsightsNextSinglePageAsync(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.")); - } + private PagedResponse listDeviceInsightsNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listDeviceInsightsNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listDeviceInsightsNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -2604,13 +1929,6 @@ private Mono> listDeviceInsightsNextSinglePage */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDevicesNextSinglePageAsync(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.listDevicesNext(nextLink, this.client.getEndpoint(), accept, context)) @@ -2619,6 +1937,20 @@ private Mono> listDevicesNextSinglePageAsync(String n .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 of a Device list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listDevicesNextSinglePage(String nextLink) { + return listDevicesNextSinglePage(nextLink, Context.NONE); + } + /** * Get the next page of items. * @@ -2627,22 +1959,14 @@ private Mono> listDevicesNextSinglePageAsync(String n * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 of a Device list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a Device list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDevicesNextSinglePageAsync(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.")); - } + private PagedResponse listDevicesNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listDevicesNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listDevicesNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CatalogsImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CatalogsImpl.java index ea73ef90c5ea8..60d9d7f973d98 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CatalogsImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CatalogsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.implementation; @@ -39,36 +39,12 @@ public CatalogsImpl(CatalogsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CatalogImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CatalogImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CatalogImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CatalogImpl(inner1, this.manager())); - } - public Response getByResourceGroupWithResponse(String resourceGroupName, String catalogName, Context context) { Response inner = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, catalogName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CatalogImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CatalogImpl(inner.getValue(), this.manager())); } public Catalog getByResourceGroup(String resourceGroupName, String catalogName) { @@ -81,23 +57,37 @@ public Catalog getByResourceGroup(String resourceGroupName, String catalogName) } public void deleteByResourceGroup(String resourceGroupName, String catalogName) { - this.serviceClient().delete(resourceGroupName, catalogName); + this.delete(resourceGroupName, catalogName, Context.NONE); } public void delete(String resourceGroupName, String catalogName, Context context) { this.serviceClient().delete(resourceGroupName, catalogName, context); } + public PagedIterable listByResourceGroup(String resourceGroupName) { + return this.listByResourceGroup(resourceGroupName, Context.NONE); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CatalogImpl(inner1, this.manager())); + } + + public PagedIterable list() { + return this.list(Context.NONE); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CatalogImpl(inner1, this.manager())); + } + public Response countDevicesWithResponse(String resourceGroupName, String catalogName, Context context) { Response inner = this.serviceClient().countDevicesWithResponse(resourceGroupName, catalogName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CountDevicesResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CountDevicesResponseImpl(inner.getValue(), this.manager())); } public CountDevicesResponse countDevices(String resourceGroupName, String catalogName) { @@ -163,7 +153,7 @@ public PagedIterable listDevices(String resourceGroupName, String catalo } public void uploadImage(String resourceGroupName, String catalogName, ImageInner uploadImageRequest) { - this.serviceClient().uploadImage(resourceGroupName, catalogName, uploadImageRequest); + this.uploadImage(resourceGroupName, catalogName, uploadImageRequest, Context.NONE); } public void uploadImage(String resourceGroupName, String catalogName, ImageInner uploadImageRequest, @@ -172,58 +162,30 @@ public void uploadImage(String resourceGroupName, String catalogName, ImageInner } public Catalog getById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); - if (catalogName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, catalogName, Context.NONE).getValue(); + return this.getByIdWithResponse(id, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); - if (catalogName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); - } + String resourceGroupName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}", + "resourceGroupName", "resourceGroups", LOGGER); + String catalogName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}", + "catalogName", "catalogs", LOGGER); return this.getByResourceGroupWithResponse(resourceGroupName, catalogName, context); } public void deleteById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); - if (catalogName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); - } - this.delete(resourceGroupName, catalogName, Context.NONE); + this.deleteByIdWithResponse(id, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); - if (catalogName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); - } + String resourceGroupName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}", + "resourceGroupName", "resourceGroups", LOGGER); + String catalogName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}", + "catalogName", "catalogs", LOGGER); this.delete(resourceGroupName, catalogName, context); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CertificateChainResponseImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CertificateChainResponseImpl.java index 42b6500cfaf00..385cb417ce98e 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CertificateChainResponseImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CertificateChainResponseImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.implementation; diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CertificateImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CertificateImpl.java index 91f8136a0edd8..2b89e6dadf3a5 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CertificateImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CertificateImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.implementation; diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CertificatesClientImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CertificatesClientImpl.java index 8685fddfedeb5..b57e7c8a3ef36 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CertificatesClientImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CertificatesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.implementation; @@ -31,7 +31,7 @@ import com.azure.resourcemanager.sphere.fluent.models.CertificateChainResponseInner; import com.azure.resourcemanager.sphere.fluent.models.CertificateInner; import com.azure.resourcemanager.sphere.fluent.models.ProofOfPossessionNonceResponseInner; -import com.azure.resourcemanager.sphere.models.CertificateListResult; +import com.azure.resourcemanager.sphere.implementation.models.CertificateListResult; import com.azure.resourcemanager.sphere.models.ProofOfPossessionNonceRequest; import reactor.core.publisher.Mono; @@ -47,31 +47,49 @@ public final class CertificatesClientImpl implements CertificatesClient { /** * The service client containing this operation class. */ - private final AzureSphereMgmtClientImpl client; + private final AzureSphereManagementClientImpl client; /** * Initializes an instance of CertificatesClientImpl. * * @param client the instance of the service client containing this operation class. */ - CertificatesClientImpl(AzureSphereMgmtClientImpl client) { + CertificatesClientImpl(AzureSphereManagementClientImpl client) { this.service = RestProxy.create(CertificatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureSphereMgmtClientCertificates to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for AzureSphereManagementClientCertificates to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "AzureSphereMgmtClien") + @Host("{endpoint}") + @ServiceInterface(name = "AzureSphereManagementClientCertificates") public interface CertificatesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates/{serialNumber}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("serialNumber") String serialNumber, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates/{serialNumber}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("serialNumber") String serialNumber, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByCatalog(@HostParam("$host") String endpoint, + Mono> listByCatalog(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @QueryParam("$skip") Integer skip, @@ -79,10 +97,21 @@ Mono> listByCatalog(@HostParam("$host") String e @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates/{serialNumber}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByCatalogSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, @QueryParam("$skip") Integer skip, + @QueryParam("$maxpagesize") Integer maxpagesize, @PathParam("catalogName") String catalogName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates/{serialNumber}/retrieveCertChain") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono> retrieveCertChain(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, @PathParam("serialNumber") String serialNumber, @HeaderParam("Accept") String accept, Context context); @@ -91,75 +120,105 @@ Mono> get(@HostParam("$host") String endpoint, @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates/{serialNumber}/retrieveCertChain") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> retrieveCertChain(@HostParam("$host") String endpoint, + Response retrieveCertChainSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, @PathParam("serialNumber") String serialNumber, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates/{serialNumber}/retrieveProofOfPossessionNonce") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> retrieveProofOfPossessionNonce( - @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, - @PathParam("serialNumber") String serialNumber, + @PathParam("serialNumber") String serialNumber, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ProofOfPossessionNonceRequest proofOfPossessionNonceRequest, - @HeaderParam("Accept") String accept, Context context); + Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates/{serialNumber}/retrieveProofOfPossessionNonce") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response retrieveProofOfPossessionNonceSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("serialNumber") String serialNumber, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ProofOfPossessionNonceRequest proofOfPossessionNonceRequest, + Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByCatalogNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByCatalogNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * List Certificate resources by Catalog. + * Get a Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param filter Filter the result list using the given expression. - * @param top The number of result items to return. - * @param skip The number of result items to skip. - * @param maxpagesize The maximum number of result items per page. + * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 of a Certificate list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return a Certificate along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCatalogSinglePageAsync(String resourceGroupName, - String catalogName, String filter, Integer top, Integer skip, Integer maxpagesize) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, String catalogName, + String serialNumber) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByCatalog(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, filter, top, skip, maxpagesize, catalogName, accept, - context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, serialNumber, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get a Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param catalogName Name of catalog. + * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Certificate on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String catalogName, String serialNumber) { + return getWithResponseAsync(resourceGroupName, catalogName, serialNumber) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + @Override + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String catalogName, String serialNumber, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, catalogName, serialNumber, accept, context); + } + + @Override + @ServiceMethod(returns = ReturnType.SINGLE) + public CertificateInner get(String resourceGroupName, String catalogName, String serialNumber) { + return getWithResponse(resourceGroupName, catalogName, serialNumber, Context.NONE).getValue(); + } + /** * List Certificate resources by Catalog. * @@ -169,7 +228,6 @@ private Mono> listByCatalogSinglePageAsync(Strin * @param top The number of result items to return. * @param skip The number of result items to skip. * @param maxpagesize The maximum number of result items per page. - * @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. @@ -178,29 +236,15 @@ private Mono> listByCatalogSinglePageAsync(Strin */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByCatalogSinglePageAsync(String resourceGroupName, - String catalogName, String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } + String catalogName, String filter, Integer top, Integer skip, Integer maxpagesize) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByCatalog(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, filter, top, skip, maxpagesize, catalogName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + return FluxUtil + .withContext(context -> service.listByCatalog(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, top, skip, maxpagesize, catalogName, 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())); } /** @@ -255,18 +299,15 @@ private PagedFlux listByCatalogAsync(String resourceGroupName, * @param top The number of result items to return. * @param skip The number of result items to skip. * @param maxpagesize The maximum number of result items per page. - * @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 of a Certificate list operation as paginated response with {@link PagedFlux}. + * @return the response of a Certificate list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByCatalogAsync(String resourceGroupName, String catalogName, String filter, - Integer top, Integer skip, Integer maxpagesize, Context context) { - return new PagedFlux<>( - () -> listByCatalogSinglePageAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context), - nextLink -> listByCatalogNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByCatalogSinglePage(String resourceGroupName, String catalogName, + String filter, Integer top, Integer skip, Integer maxpagesize) { + return listByCatalogSinglePage(resourceGroupName, catalogName, filter, top, skip, maxpagesize, Context.NONE); } /** @@ -274,169 +315,44 @@ private PagedFlux listByCatalogAsync(String resourceGroupName, * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. + * @param filter Filter the result list using the given expression. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @param maxpagesize The maximum number of result items per page. + * @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 of a Certificate list operation as paginated response with {@link PagedIterable}. + * @return the response of a Certificate list operation along with {@link PagedResponse}. */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByCatalogSinglePage(String resourceGroupName, String catalogName, + String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { + final String accept = "application/json"; + Response res = service.listByCatalogSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, filter, top, skip, + maxpagesize, catalogName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + @Override @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByCatalog(String resourceGroupName, String catalogName) { final String filter = null; final Integer top = null; final Integer skip = null; final Integer maxpagesize = null; - return new PagedIterable<>(listByCatalogAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize)); + return listByCatalog(resourceGroupName, catalogName, filter, top, skip, maxpagesize, Context.NONE); } - /** - * List Certificate resources by Catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param filter Filter the result list using the given expression. - * @param top The number of result items to return. - * @param skip The number of result items to skip. - * @param maxpagesize The maximum number of result items per page. - * @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 of a Certificate list operation as paginated response with {@link PagedIterable}. - */ + @Override @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByCatalog(String resourceGroupName, String catalogName, String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { return new PagedIterable<>( - listByCatalogAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context)); - } - - /** - * Get a Certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Certificate along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String catalogName, - String serialNumber) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (serialNumber == null) { - return Mono.error(new IllegalArgumentException("Parameter serialNumber is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, serialNumber, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a Certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. - * @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 Certificate along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String catalogName, - String serialNumber, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (serialNumber == null) { - return Mono.error(new IllegalArgumentException("Parameter serialNumber is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, catalogName, serialNumber, accept, context); - } - - /** - * Get a Certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Certificate on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String catalogName, String serialNumber) { - return getWithResponseAsync(resourceGroupName, catalogName, serialNumber) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a Certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. - * @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 Certificate along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String catalogName, String serialNumber, - Context context) { - return getWithResponseAsync(resourceGroupName, catalogName, serialNumber, context).block(); - } - - /** - * Get a Certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Certificate. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CertificateInner get(String resourceGroupName, String catalogName, String serialNumber) { - return getWithResponse(resourceGroupName, catalogName, serialNumber, Context.NONE).getValue(); + () -> listByCatalogSinglePage(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context), + nextLink -> listByCatalogNextSinglePage(nextLink, context)); } /** @@ -453,24 +369,6 @@ public CertificateInner get(String resourceGroupName, String catalogName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono> retrieveCertChainWithResponseAsync(String resourceGroupName, String catalogName, String serialNumber) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (serialNumber == null) { - return Mono.error(new IllegalArgumentException("Parameter serialNumber is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.retrieveCertChain(this.client.getEndpoint(), this.client.getApiVersion(), @@ -478,45 +376,6 @@ private Mono> retrieveCertChainWithRespo .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Retrieves cert chain. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. - * @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 certificate chain response along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> retrieveCertChainWithResponseAsync(String resourceGroupName, - String catalogName, String serialNumber, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (serialNumber == null) { - return Mono.error(new IllegalArgumentException("Parameter serialNumber is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.retrieveCertChain(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, serialNumber, accept, context); - } - /** * Retrieves cert chain. * @@ -535,35 +394,16 @@ private Mono retrieveCertChainAsync(String resour .flatMap(res -> Mono.justOrEmpty(res.getValue())); } - /** - * Retrieves cert chain. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. - * @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 certificate chain response along with {@link Response}. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public Response retrieveCertChainWithResponse(String resourceGroupName, String catalogName, String serialNumber, Context context) { - return retrieveCertChainWithResponseAsync(resourceGroupName, catalogName, serialNumber, context).block(); + final String accept = "application/json"; + return service.retrieveCertChainSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, serialNumber, accept, context); } - /** - * Retrieves cert chain. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 certificate chain response. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public CertificateChainResponseInner retrieveCertChain(String resourceGroupName, String catalogName, String serialNumber) { @@ -586,86 +426,15 @@ public CertificateChainResponseInner retrieveCertChain(String resourceGroupName, private Mono> retrieveProofOfPossessionNonceWithResponseAsync( String resourceGroupName, String catalogName, String serialNumber, ProofOfPossessionNonceRequest proofOfPossessionNonceRequest) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (serialNumber == null) { - return Mono.error(new IllegalArgumentException("Parameter serialNumber is required and cannot be null.")); - } - if (proofOfPossessionNonceRequest == null) { - return Mono.error(new IllegalArgumentException( - "Parameter proofOfPossessionNonceRequest is required and cannot be null.")); - } else { - proofOfPossessionNonceRequest.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.retrieveProofOfPossessionNonce(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, catalogName, - serialNumber, proofOfPossessionNonceRequest, accept, context)) + serialNumber, contentType, accept, proofOfPossessionNonceRequest, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets the proof of possession nonce. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. - * @param proofOfPossessionNonceRequest Proof of possession nonce request body. - * @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 proof of possession nonce along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> retrieveProofOfPossessionNonceWithResponseAsync( - String resourceGroupName, String catalogName, String serialNumber, - ProofOfPossessionNonceRequest proofOfPossessionNonceRequest, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (serialNumber == null) { - return Mono.error(new IllegalArgumentException("Parameter serialNumber is required and cannot be null.")); - } - if (proofOfPossessionNonceRequest == null) { - return Mono.error(new IllegalArgumentException( - "Parameter proofOfPossessionNonceRequest is required and cannot be null.")); - } else { - proofOfPossessionNonceRequest.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.retrieveProofOfPossessionNonce(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, serialNumber, - proofOfPossessionNonceRequest, accept, context); - } - /** * Gets the proof of possession nonce. * @@ -685,39 +454,19 @@ private Mono retrieveProofOfPossessionNonce proofOfPossessionNonceRequest).flatMap(res -> Mono.justOrEmpty(res.getValue())); } - /** - * Gets the proof of possession nonce. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. - * @param proofOfPossessionNonceRequest Proof of possession nonce request body. - * @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 proof of possession nonce along with {@link Response}. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public Response retrieveProofOfPossessionNonceWithResponse( String resourceGroupName, String catalogName, String serialNumber, ProofOfPossessionNonceRequest proofOfPossessionNonceRequest, Context context) { - return retrieveProofOfPossessionNonceWithResponseAsync(resourceGroupName, catalogName, serialNumber, - proofOfPossessionNonceRequest, context).block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.retrieveProofOfPossessionNonceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, serialNumber, contentType, accept, + proofOfPossessionNonceRequest, context); } - /** - * Gets the proof of possession nonce. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. - * @param proofOfPossessionNonceRequest Proof of possession nonce request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 proof of possession nonce. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public ProofOfPossessionNonceResponseInner retrieveProofOfPossessionNonce(String resourceGroupName, String catalogName, String serialNumber, ProofOfPossessionNonceRequest proofOfPossessionNonceRequest) { @@ -737,13 +486,6 @@ public ProofOfPossessionNonceResponseInner retrieveProofOfPossessionNonce(String */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByCatalogNextSinglePageAsync(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.listByCatalogNext(nextLink, this.client.getEndpoint(), accept, context)) @@ -752,6 +494,20 @@ private Mono> listByCatalogNextSinglePageAsync(S .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 of a Certificate list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByCatalogNextSinglePage(String nextLink) { + return listByCatalogNextSinglePage(nextLink, Context.NONE); + } + /** * Get the next page of items. * @@ -760,22 +516,14 @@ private Mono> listByCatalogNextSinglePageAsync(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 the response of a Certificate list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a Certificate list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCatalogNextSinglePageAsync(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.")); - } + private PagedResponse listByCatalogNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByCatalogNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByCatalogNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CertificatesImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CertificatesImpl.java index ecd388b512413..90924575f7f44 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CertificatesImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CertificatesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.implementation; @@ -32,28 +32,12 @@ public CertificatesImpl(CertificatesClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable listByCatalog(String resourceGroupName, String catalogName) { - PagedIterable inner = this.serviceClient().listByCatalog(resourceGroupName, catalogName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CertificateImpl(inner1, this.manager())); - } - - public PagedIterable listByCatalog(String resourceGroupName, String catalogName, String filter, - Integer top, Integer skip, Integer maxpagesize, Context context) { - PagedIterable inner = this.serviceClient() - .listByCatalog(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CertificateImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String catalogName, String serialNumber, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, catalogName, serialNumber, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CertificateImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CertificateImpl(inner.getValue(), this.manager())); } public Certificate get(String resourceGroupName, String catalogName, String serialNumber) { @@ -65,16 +49,24 @@ public Certificate get(String resourceGroupName, String catalogName, String seri } } + public PagedIterable listByCatalog(String resourceGroupName, String catalogName) { + PagedIterable inner = this.serviceClient().listByCatalog(resourceGroupName, catalogName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CertificateImpl(inner1, this.manager())); + } + + public PagedIterable listByCatalog(String resourceGroupName, String catalogName, String filter, + Integer top, Integer skip, Integer maxpagesize, Context context) { + PagedIterable inner = this.serviceClient() + .listByCatalog(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CertificateImpl(inner1, this.manager())); + } + public Response retrieveCertChainWithResponse(String resourceGroupName, String catalogName, String serialNumber, Context context) { Response inner = this.serviceClient().retrieveCertChainWithResponse(resourceGroupName, catalogName, serialNumber, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CertificateChainResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CertificateChainResponseImpl(inner.getValue(), this.manager())); } public CertificateChainResponse retrieveCertChain(String resourceGroupName, String catalogName, @@ -94,12 +86,8 @@ public Response retrieveProofOfPossessionNonceWi Response inner = this.serviceClient() .retrieveProofOfPossessionNonceWithResponse(resourceGroupName, catalogName, serialNumber, proofOfPossessionNonceRequest, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ProofOfPossessionNonceResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ProofOfPossessionNonceResponseImpl(inner.getValue(), this.manager())); } public ProofOfPossessionNonceResponse retrieveProofOfPossessionNonce(String resourceGroupName, String catalogName, diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CountDevicesResponseImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CountDevicesResponseImpl.java index b27e7d871641f..cc3e452809304 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CountDevicesResponseImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CountDevicesResponseImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.implementation; diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeploymentImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeploymentImpl.java index c2f35a8e28162..c2ff661233550 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeploymentImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeploymentImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.implementation; @@ -67,11 +67,7 @@ public DeploymentImpl withExistingDeviceGroup(String resourceGroupName, String c } public Deployment create() { - this.innerObject = serviceManager.serviceClient() - .getDeployments() - .createOrUpdate(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, - this.innerModel(), Context.NONE); - return this; + return this.create(Context.NONE); } public Deployment create(Context context) { @@ -93,11 +89,7 @@ public DeploymentImpl update() { } public Deployment apply() { - this.innerObject = serviceManager.serviceClient() - .getDeployments() - .createOrUpdate(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, - this.innerModel(), Context.NONE); - return this; + return this.apply(Context.NONE); } public Deployment apply(Context context) { @@ -111,19 +103,25 @@ public Deployment apply(Context context) { DeploymentImpl(DeploymentInner innerObject, com.azure.resourcemanager.sphere.AzureSphereManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.catalogName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "catalogs"); - this.productName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "products"); - this.deviceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "deviceGroups"); - this.deploymentName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "deployments"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}", + "resourceGroupName"); + this.catalogName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}", + "catalogName"); + this.productName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}", + "productName"); + this.deviceGroupName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}", + "deviceGroupName"); + this.deploymentName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}", + "deploymentName"); } public Deployment refresh() { - this.innerObject = serviceManager.serviceClient() - .getDeployments() - .getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, Context.NONE) - .getValue(); - return this; + return this.refresh(Context.NONE); } public Deployment refresh(Context context) { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeploymentsClientImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeploymentsClientImpl.java index d6f4cecb3b036..4859f8861b31f 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeploymentsClientImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeploymentsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.implementation; @@ -27,13 +27,14 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.sphere.fluent.DeploymentsClient; import com.azure.resourcemanager.sphere.fluent.models.DeploymentInner; -import com.azure.resourcemanager.sphere.models.DeploymentListResult; +import com.azure.resourcemanager.sphere.implementation.models.DeploymentListResult; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -50,312 +51,127 @@ public final class DeploymentsClientImpl implements DeploymentsClient { /** * The service client containing this operation class. */ - private final AzureSphereMgmtClientImpl client; + private final AzureSphereManagementClientImpl client; /** * Initializes an instance of DeploymentsClientImpl. * * @param client the instance of the service client containing this operation class. */ - DeploymentsClientImpl(AzureSphereMgmtClientImpl client) { + DeploymentsClientImpl(AzureSphereManagementClientImpl client) { this.service = RestProxy.create(DeploymentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureSphereMgmtClientDeployments to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for AzureSphereManagementClientDeployments to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "AzureSphereMgmtClien") + @Host("{endpoint}") + @ServiceInterface(name = "AzureSphereManagementClientDeployments") public interface DeploymentsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByDeviceGroup(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, - @QueryParam("$top") Integer top, @QueryParam("$skip") Integer skip, - @QueryParam("$maxpagesize") Integer maxpagesize, @PathParam("catalogName") String catalogName, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, - @HeaderParam("Accept") String accept, Context context); + @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, - @PathParam("deploymentName") String deploymentName, @BodyParam("application/json") DeploymentInner resource, - @HeaderParam("Accept") String accept, Context context); + @PathParam("deploymentName") String deploymentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DeploymentInner resource, + Context context); - @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DeploymentInner resource, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, + Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, - @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); + @PathParam("deploymentName") String deploymentName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, + @PathParam("deploymentName") String deploymentName, Context context); @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByDeviceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Mono> listByDeviceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, @QueryParam("$skip") Integer skip, + @QueryParam("$maxpagesize") Integer maxpagesize, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, @HeaderParam("Accept") String accept, Context context); - } - /** - * List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be - * used for product or device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param filter Filter the result list using the given expression. - * @param top The number of result items to return. - * @param skip The number of result items to skip. - * @param maxpagesize The maximum number of result items per page. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 of a Deployment list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDeviceGroupSinglePageAsync(String resourceGroupName, - String catalogName, String productName, String deviceGroupName, String filter, Integer top, Integer skip, - Integer maxpagesize) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (deviceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByDeviceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, filter, top, skip, maxpagesize, catalogName, - productName, deviceGroupName, 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())); - } - - /** - * List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be - * used for product or device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param filter Filter the result list using the given expression. - * @param top The number of result items to return. - * @param skip The number of result items to skip. - * @param maxpagesize The maximum number of result items per page. - * @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 of a Deployment list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDeviceGroupSinglePageAsync(String resourceGroupName, - String catalogName, String productName, String deviceGroupName, String filter, Integer top, Integer skip, - Integer maxpagesize, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (deviceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByDeviceGroup(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, filter, top, skip, maxpagesize, catalogName, productName, deviceGroupName, accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be - * used for product or device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param filter Filter the result list using the given expression. - * @param top The number of result items to return. - * @param skip The number of result items to skip. - * @param maxpagesize The maximum number of result items per page. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 of a Deployment list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDeviceGroupAsync(String resourceGroupName, String catalogName, - String productName, String deviceGroupName, String filter, Integer top, Integer skip, Integer maxpagesize) { - return new PagedFlux<>(() -> listByDeviceGroupSinglePageAsync(resourceGroupName, catalogName, productName, - deviceGroupName, filter, top, skip, maxpagesize), - nextLink -> listByDeviceGroupNextSinglePageAsync(nextLink)); - } - - /** - * List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be - * used for product or device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device 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 the response of a Deployment list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDeviceGroupAsync(String resourceGroupName, String catalogName, - String productName, String deviceGroupName) { - final String filter = null; - final Integer top = null; - final Integer skip = null; - final Integer maxpagesize = null; - return new PagedFlux<>(() -> listByDeviceGroupSinglePageAsync(resourceGroupName, catalogName, productName, - deviceGroupName, filter, top, skip, maxpagesize), - nextLink -> listByDeviceGroupNextSinglePageAsync(nextLink)); - } - - /** - * List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be - * used for product or device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param filter Filter the result list using the given expression. - * @param top The number of result items to return. - * @param skip The number of result items to skip. - * @param maxpagesize The maximum number of result items per page. - * @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 of a Deployment list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDeviceGroupAsync(String resourceGroupName, String catalogName, - String productName, String deviceGroupName, String filter, Integer top, Integer skip, Integer maxpagesize, - Context context) { - return new PagedFlux<>(() -> listByDeviceGroupSinglePageAsync(resourceGroupName, catalogName, productName, - deviceGroupName, filter, top, skip, maxpagesize, context), - nextLink -> listByDeviceGroupNextSinglePageAsync(nextLink, context)); - } + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByDeviceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, @QueryParam("$skip") Integer skip, + @QueryParam("$maxpagesize") Integer maxpagesize, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, + @HeaderParam("Accept") String accept, Context context); - /** - * List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be - * used for product or device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device 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 the response of a Deployment list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, - String productName, String deviceGroupName) { - final String filter = null; - final Integer top = null; - final Integer skip = null; - final Integer maxpagesize = null; - return new PagedIterable<>(listByDeviceGroupAsync(resourceGroupName, catalogName, productName, deviceGroupName, - filter, top, skip, maxpagesize)); - } + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDeviceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); - /** - * List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be - * used for product or device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param filter Filter the result list using the given expression. - * @param top The number of result items to return. - * @param skip The number of result items to skip. - * @param maxpagesize The maximum number of result items per page. - * @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 of a Deployment list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, - String productName, String deviceGroupName, String filter, Integer top, Integer skip, Integer maxpagesize, - Context context) { - return new PagedIterable<>(listByDeviceGroupAsync(resourceGroupName, catalogName, productName, deviceGroupName, - filter, top, skip, maxpagesize, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByDeviceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -376,31 +192,6 @@ public PagedIterable listByDeviceGroup(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (deviceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), @@ -409,56 +200,6 @@ private Mono> getWithResponseAsync(String resourceGrou .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device - * group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device 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 a Deployment along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String catalogName, - String productName, String deviceGroupName, String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (deviceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, accept, context); - } - /** * Get a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device * group name. @@ -481,247 +222,21 @@ private Mono getAsync(String resourceGroupName, String catalogN .flatMap(res -> Mono.justOrEmpty(res.getValue())); } - /** - * Get a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device - * group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device 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 a Deployment along with {@link Response}. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deploymentName, Context context) { - return getWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, - context).block(); - } - - /** - * Get a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device - * group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device 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 a Deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentInner get(String resourceGroupName, String catalogName, String productName, String deviceGroupName, - String deploymentName) { - return getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, - Context.NONE).getValue(); - } - - /** - * Create a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or - * device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an deployment resource belonging to a device group resource along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String catalogName, String productName, String deviceGroupName, String deploymentName, - DeploymentInner 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 (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (deviceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName 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.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, - deploymentName, resource, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or - * device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an deployment resource belonging to a device group resource along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String catalogName, String productName, String deviceGroupName, String deploymentName, DeploymentInner 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 (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (deviceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName 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.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, - deploymentName, resource, accept, context); - } - - /** - * Create a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or - * device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an deployment resource belonging to a device group resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DeploymentInner> beginCreateOrUpdateAsync(String resourceGroupName, - String catalogName, String productName, String deviceGroupName, String deploymentName, - DeploymentInner resource) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, catalogName, - productName, deviceGroupName, deploymentName, resource); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - DeploymentInner.class, DeploymentInner.class, this.client.getContext()); - } - - /** - * Create a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or - * device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an deployment resource belonging to a device group resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DeploymentInner> beginCreateOrUpdateAsync(String resourceGroupName, - String catalogName, String productName, String deviceGroupName, String deploymentName, DeploymentInner resource, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, catalogName, - productName, deviceGroupName, deploymentName, resource, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - DeploymentInner.class, DeploymentInner.class, context); - } - - /** - * Create a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or - * device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an deployment resource belonging to a device group resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeploymentInner> beginCreateOrUpdate(String resourceGroupName, - String catalogName, String productName, String deviceGroupName, String deploymentName, - DeploymentInner resource) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, - resource) - .getSyncPoller(); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, accept, context); + } + + @Override + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentInner get(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + String deploymentName) { + return getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, + Context.NONE).getValue(); } /** @@ -735,20 +250,23 @@ public SyncPoller, DeploymentInner> beginCreateOrUpd * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for * the associated device group. * @param resource Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an deployment resource belonging to a device group resource. + * @return a deployment resource belonging to a device group resource along with {@link Response} on successful + * completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeploymentInner> beginCreateOrUpdate(String resourceGroupName, - String catalogName, String productName, String deviceGroupName, String deploymentName, DeploymentInner resource, - Context context) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, - resource, context) - .getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, String deploymentName, + DeploymentInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, + deploymentName, contentType, accept, resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -765,13 +283,13 @@ public SyncPoller, DeploymentInner> beginCreateOrUpd * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an deployment resource belonging to a device group resource on successful completion of {@link Mono}. + * @return a deployment resource belonging to a device group resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String catalogName, String productName, - String deviceGroupName, String deploymentName, DeploymentInner resource) { - return beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, - resource).last().flatMap(this.client::getLroFinalResultOrError); + private Response createOrUpdateWithResponse(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deploymentName, DeploymentInner resource) { + return createOrUpdateWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, + resource, Context.NONE); } /** @@ -789,13 +307,16 @@ private Mono createOrUpdateAsync(String resourceGroupName, Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an deployment resource belonging to a device group resource on successful completion of {@link Mono}. + * @return a deployment resource belonging to a device group resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String catalogName, String productName, - String deviceGroupName, String deploymentName, DeploymentInner resource, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, - resource, context).last().flatMap(this.client::getLroFinalResultOrError); + private Response createOrUpdateWithResponse(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deploymentName, DeploymentInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, + deploymentName, contentType, accept, resource, context); } /** @@ -812,13 +333,36 @@ private Mono createOrUpdateAsync(String resourceGroupName, Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an deployment resource belonging to a device group resource. + * @return the {@link PollerFlux} for polling of a deployment resource belonging to a device group resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentInner createOrUpdate(String resourceGroupName, String catalogName, String productName, - String deviceGroupName, String deploymentName, DeploymentInner resource) { - return createOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, - resource).block(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DeploymentInner> beginCreateOrUpdateAsync(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, String deploymentName, + DeploymentInner resource) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, catalogName, + productName, deviceGroupName, deploymentName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DeploymentInner.class, DeploymentInner.class, this.client.getContext()); + } + + @Override + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentInner> beginCreateOrUpdate(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, String deploymentName, + DeploymentInner resource) { + return beginCreateOrUpdate(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, + resource, Context.NONE); + } + + @Override + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentInner> beginCreateOrUpdate(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, String deploymentName, DeploymentInner resource, + Context context) { + Response response = createOrUpdateWithResponse(resourceGroupName, catalogName, productName, + deviceGroupName, deploymentName, resource, context); + return this.client.getLroResult(response, DeploymentInner.class, + DeploymentInner.class, context); } /** @@ -832,17 +376,32 @@ public DeploymentInner createOrUpdate(String resourceGroupName, String catalogNa * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for * the associated device group. * @param resource Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an deployment resource belonging to a device group resource. + * @return a deployment resource belonging to a device group resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deploymentName, DeploymentInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, + resource).last().flatMap(this.client::getLroFinalResultOrError); + } + + @Override + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentInner createOrUpdate(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deploymentName, DeploymentInner resource) { + return createOrUpdate(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, resource, + Context.NONE); + } + + @Override + @ServiceMethod(returns = ReturnType.SINGLE) public DeploymentInner createOrUpdate(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deploymentName, DeploymentInner resource, Context context) { - return createOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, - resource, context).block(); + return this.client.getLroFinalResultOrError(beginCreateOrUpdate(resourceGroupName, catalogName, productName, + deviceGroupName, deploymentName, resource, context)); } /** @@ -863,36 +422,10 @@ public DeploymentInner createOrUpdate(String resourceGroupName, String catalogNa @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (deviceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, - deploymentName, accept, context)) + deploymentName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -906,44 +439,16 @@ private Mono>> deleteWithResponseAsync(String resource * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for * the associated device 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 the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String catalogName, - String productName, String deviceGroupName, String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (deviceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, accept, context); + private Response deleteWithResponse(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deploymentName) { + return deleteWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, + Context.NONE); } /** @@ -956,18 +461,18 @@ private Mono>> deleteWithResponseAsync(String resource * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for * the associated device 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 the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String catalogName, - String productName, String deviceGroupName, String deploymentName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deploymentName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, + deploymentName, context); } /** @@ -980,7 +485,6 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for * the associated device 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. @@ -988,12 +492,27 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String catalogName, - String productName, String deviceGroupName, String deploymentName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, catalogName, productName, - deviceGroupName, deploymentName, context); + String productName, String deviceGroupName, String deploymentName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); + } + + @Override + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deploymentName) { + return beginDelete(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, Context.NONE); + } + + @Override + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deploymentName, Context context) { + Response response + = deleteWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -1009,124 +528,186 @@ private PollerFlux, Void> beginDeleteAsync(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 the {@link SyncPoller} for polling of long-running operation. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, - String productName, String deviceGroupName, String deploymentName) { - return this.beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName) - .getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deploymentName) { + return beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + @Override + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + String deploymentName) { + delete(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, Context.NONE); + } + + @Override + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + String deploymentName, Context context) { + this.client.getLroFinalResultOrError( + beginDelete(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, context)); } /** - * Delete a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or - * device group name. + * List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be + * used for product or device group name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. - * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. - * @param context The context to associate with this operation. + * @param filter Filter the result list using the given expression. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @param maxpagesize The maximum number of result items per page. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 {@link SyncPoller} for polling of long-running operation. + * @return the response of a Deployment list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, - String productName, String deviceGroupName, String deploymentName, Context context) { - return this - .beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, context) - .getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDeviceGroupSinglePageAsync(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, String filter, Integer top, Integer skip, + Integer maxpagesize) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByDeviceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, top, skip, maxpagesize, catalogName, + productName, deviceGroupName, 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())); } /** - * Delete a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or - * device group name. + * List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be + * used for product or device group name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. - * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * @param filter Filter the result list using the given expression. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @param maxpagesize The maximum number of result items per page. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 {@link Mono} that completes when a successful response is received. + * @return the response of a Deployment list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String catalogName, String productName, - String deviceGroupName, String deploymentName) { - return beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName).last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDeviceGroupAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String filter, Integer top, Integer skip, Integer maxpagesize) { + return new PagedFlux<>(() -> listByDeviceGroupSinglePageAsync(resourceGroupName, catalogName, productName, + deviceGroupName, filter, top, skip, maxpagesize), + nextLink -> listByDeviceGroupNextSinglePageAsync(nextLink)); } /** - * Delete a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or - * device group name. + * List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be + * used for product or device group name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. - * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device 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 A {@link Mono} that completes when a successful response is received. + * @return the response of a Deployment list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String catalogName, String productName, - String deviceGroupName, String deploymentName, Context context) { - return beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDeviceGroupAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final Integer maxpagesize = null; + return new PagedFlux<>(() -> listByDeviceGroupSinglePageAsync(resourceGroupName, catalogName, productName, + deviceGroupName, filter, top, skip, maxpagesize), + nextLink -> listByDeviceGroupNextSinglePageAsync(nextLink)); } /** - * Delete a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or - * device group name. + * List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be + * used for product or device group name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. - * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * @param filter Filter the result list using the given expression. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @param maxpagesize The maximum number of result items per page. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 of a Deployment list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, - String deploymentName) { - deleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName).block(); + private PagedResponse listByDeviceGroupSinglePage(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String filter, Integer top, Integer skip, Integer maxpagesize) { + return listByDeviceGroupSinglePage(resourceGroupName, catalogName, productName, deviceGroupName, filter, top, + skip, maxpagesize, Context.NONE); } /** - * Delete a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or - * device group name. + * List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be + * used for product or device group name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. - * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * @param filter Filter the result list using the given expression. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @param maxpagesize The maximum number of result items per page. * @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 of a Deployment list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, - String deploymentName, Context context) { - deleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, context).block(); + private PagedResponse listByDeviceGroupSinglePage(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String filter, Integer top, Integer skip, Integer maxpagesize, + Context context) { + final String accept = "application/json"; + Response res = service.listByDeviceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, filter, top, skip, + maxpagesize, catalogName, productName, deviceGroupName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + @Override + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, + String productName, String deviceGroupName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final Integer maxpagesize = null; + return listByDeviceGroup(resourceGroupName, catalogName, productName, deviceGroupName, filter, top, skip, + maxpagesize, Context.NONE); + } + + @Override + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String filter, Integer top, Integer skip, Integer maxpagesize, + Context context) { + return new PagedIterable<>(() -> listByDeviceGroupSinglePage(resourceGroupName, catalogName, productName, + deviceGroupName, filter, top, skip, maxpagesize, context), + nextLink -> listByDeviceGroupNextSinglePage(nextLink, context)); } /** @@ -1141,13 +722,6 @@ public void delete(String resourceGroupName, String catalogName, String productN */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByDeviceGroupNextSinglePageAsync(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.listByDeviceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) @@ -1156,6 +730,20 @@ private Mono> listByDeviceGroupNextSinglePageAsyn .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 of a Deployment list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByDeviceGroupNextSinglePage(String nextLink) { + return listByDeviceGroupNextSinglePage(nextLink, Context.NONE); + } + /** * Get the next page of items. * @@ -1164,23 +752,14 @@ private Mono> listByDeviceGroupNextSinglePageAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 of a Deployment list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a Deployment list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDeviceGroupNextSinglePageAsync(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.")); - } + private PagedResponse listByDeviceGroupNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByDeviceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByDeviceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeploymentsImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeploymentsImpl.java index e730890de1dc6..121ba4ea159c6 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeploymentsImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeploymentsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.implementation; @@ -27,31 +27,12 @@ public DeploymentsImpl(DeploymentsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, - String deviceGroupName) { - PagedIterable inner - = this.serviceClient().listByDeviceGroup(resourceGroupName, catalogName, productName, deviceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DeploymentImpl(inner1, this.manager())); - } - - public PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, - String deviceGroupName, String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { - PagedIterable inner = this.serviceClient() - .listByDeviceGroup(resourceGroupName, catalogName, productName, deviceGroupName, filter, top, skip, - maxpagesize, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DeploymentImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deploymentName, Context context) { Response inner = this.serviceClient() .getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DeploymentImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DeploymentImpl(inner.getValue(), this.manager())); } public Deployment get(String resourceGroupName, String catalogName, String productName, String deviceGroupName, @@ -67,7 +48,7 @@ public Deployment get(String resourceGroupName, String catalogName, String produ public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deploymentName) { - this.serviceClient().delete(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName); + this.delete(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, Context.NONE); } public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, @@ -76,122 +57,65 @@ public void delete(String resourceGroupName, String catalogName, String productN .delete(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, context); } + public PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, + String deviceGroupName) { + PagedIterable inner + = this.serviceClient().listByDeviceGroup(resourceGroupName, catalogName, productName, deviceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeploymentImpl(inner1, this.manager())); + } + + public PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { + PagedIterable inner = this.serviceClient() + .listByDeviceGroup(resourceGroupName, catalogName, productName, deviceGroupName, filter, top, skip, + maxpagesize, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeploymentImpl(inner1, this.manager())); + } + public Deployment getById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); - if (catalogName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); - } - String productName = ResourceManagerUtils.getValueFromIdByName(id, "products"); - if (productName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); - } - String deviceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "deviceGroups"); - if (deviceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); - } - String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "deployments"); - if (deploymentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); - } - return this - .getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, Context.NONE) - .getValue(); + return this.getByIdWithResponse(id, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); - if (catalogName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); - } - String productName = ResourceManagerUtils.getValueFromIdByName(id, "products"); - if (productName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); - } - String deviceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "deviceGroups"); - if (deviceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); - } - String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "deployments"); - if (deploymentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); - } + String resourceGroupName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}", + "resourceGroupName", "resourceGroups", LOGGER); + String catalogName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}", + "catalogName", "catalogs", LOGGER); + String productName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}", + "productName", "products", LOGGER); + String deviceGroupName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}", + "deviceGroupName", "deviceGroups", LOGGER); + String deploymentName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}", + "deploymentName", "deployments", LOGGER); return this.getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, context); } public void deleteById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); - if (catalogName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); - } - String productName = ResourceManagerUtils.getValueFromIdByName(id, "products"); - if (productName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); - } - String deviceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "deviceGroups"); - if (deviceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); - } - String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "deployments"); - if (deploymentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); - } - this.delete(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, Context.NONE); + this.deleteByIdWithResponse(id, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); - if (catalogName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); - } - String productName = ResourceManagerUtils.getValueFromIdByName(id, "products"); - if (productName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); - } - String deviceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "deviceGroups"); - if (deviceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); - } - String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "deployments"); - if (deploymentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); - } + String resourceGroupName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}", + "resourceGroupName", "resourceGroups", LOGGER); + String catalogName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}", + "catalogName", "catalogs", LOGGER); + String productName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}", + "productName", "products", LOGGER); + String deviceGroupName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}", + "deviceGroupName", "deviceGroups", LOGGER); + String deploymentName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}", + "deploymentName", "deployments", LOGGER); this.delete(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, context); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceGroupImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceGroupImpl.java index 742c3affdd60f..34972dfa013c2 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceGroupImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceGroupImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.implementation; @@ -70,11 +70,7 @@ public DeviceGroupImpl withExistingProduct(String resourceGroupName, String cata } public DeviceGroup create() { - this.innerObject = serviceManager.serviceClient() - .getDeviceGroups() - .createOrUpdate(resourceGroupName, catalogName, productName, deviceGroupName, this.innerModel(), - Context.NONE); - return this; + return this.create(Context.NONE); } public DeviceGroup create(Context context) { @@ -96,10 +92,7 @@ public DeviceGroupImpl update() { } public DeviceGroup apply() { - this.innerObject = serviceManager.serviceClient() - .getDeviceGroups() - .update(resourceGroupName, catalogName, productName, deviceGroupName, updateProperties, Context.NONE); - return this; + return this.apply(Context.NONE); } public DeviceGroup apply(Context context) { @@ -112,18 +105,22 @@ public DeviceGroup apply(Context context) { DeviceGroupImpl(DeviceGroupInner innerObject, com.azure.resourcemanager.sphere.AzureSphereManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.catalogName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "catalogs"); - this.productName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "products"); - this.deviceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "deviceGroups"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}", + "resourceGroupName"); + this.catalogName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}", + "catalogName"); + this.productName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}", + "productName"); + this.deviceGroupName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}", + "deviceGroupName"); } public DeviceGroup refresh() { - this.innerObject = serviceManager.serviceClient() - .getDeviceGroups() - .getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, Context.NONE) - .getValue(); - return this; + return this.refresh(Context.NONE); } public DeviceGroup refresh(Context context) { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceGroupsClientImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceGroupsClientImpl.java index c1d966d5bebdb..ce07fc68bdb51 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceGroupsClientImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceGroupsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.implementation; @@ -29,6 +29,7 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; @@ -36,8 +37,8 @@ import com.azure.resourcemanager.sphere.fluent.DeviceGroupsClient; import com.azure.resourcemanager.sphere.fluent.models.CountDevicesResponseInner; import com.azure.resourcemanager.sphere.fluent.models.DeviceGroupInner; +import com.azure.resourcemanager.sphere.implementation.models.DeviceGroupListResult; import com.azure.resourcemanager.sphere.models.ClaimDevicesRequest; -import com.azure.resourcemanager.sphere.models.DeviceGroupListResult; import com.azure.resourcemanager.sphere.models.DeviceGroupUpdate; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -55,95 +56,165 @@ public final class DeviceGroupsClientImpl implements DeviceGroupsClient { /** * The service client containing this operation class. */ - private final AzureSphereMgmtClientImpl client; + private final AzureSphereManagementClientImpl client; /** * Initializes an instance of DeviceGroupsClientImpl. * * @param client the instance of the service client containing this operation class. */ - DeviceGroupsClientImpl(AzureSphereMgmtClientImpl client) { + DeviceGroupsClientImpl(AzureSphereManagementClientImpl client) { this.service = RestProxy.create(DeviceGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureSphereMgmtClientDeviceGroups to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for AzureSphereManagementClientDeviceGroups to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "AzureSphereMgmtClien") + @Host("{endpoint}") + @ServiceInterface(name = "AzureSphereManagementClientDeviceGroups") public interface DeviceGroupsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByProduct(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, - @QueryParam("$top") Integer top, @QueryParam("$skip") Integer skip, - @QueryParam("$maxpagesize") Integer maxpagesize, @PathParam("catalogName") String catalogName, - @PathParam("productName") String productName, @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, - @BodyParam("application/json") DeviceGroupInner resource, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DeviceGroupInner resource, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DeviceGroupInner resource, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DeviceGroupUpdate properties, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DeviceGroupUpdate properties, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, - @BodyParam("application/json") DeviceGroupUpdate properties, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, - @HeaderParam("Accept") String accept, Context context); + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProduct(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, @QueryParam("$skip") Integer skip, + @QueryParam("$maxpagesize") Integer maxpagesize, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByProductSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, @QueryParam("$skip") Integer skip, + @QueryParam("$maxpagesize") Integer maxpagesize, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/claimDevices") @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> claimDevices(@HostParam("$host") String endpoint, + Mono>> claimDevices(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") ClaimDevicesRequest claimDevicesRequest, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/claimDevices") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response claimDevicesSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") ClaimDevicesRequest claimDevicesRequest, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/countDevices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> countDevices(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, - @BodyParam("application/json") ClaimDevicesRequest claimDevicesRequest, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/countDevices") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> countDevices(@HostParam("$host") String endpoint, + Response countDevicesSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, @@ -154,222 +225,16 @@ Mono> countDevices(@HostParam("$host") Strin @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByProductNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - /** - * List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used - * for product name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param filter Filter the result list using the given expression. - * @param top The number of result items to return. - * @param skip The number of result items to skip. - * @param maxpagesize The maximum number of result items per page. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 of a DeviceGroup list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByProductSinglePageAsync(String resourceGroupName, - String catalogName, String productName, String filter, Integer top, Integer skip, Integer maxpagesize) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByProduct(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, filter, top, skip, maxpagesize, catalogName, - productName, 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())); - } - - /** - * List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used - * for product name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param filter Filter the result list using the given expression. - * @param top The number of result items to return. - * @param skip The number of result items to skip. - * @param maxpagesize The maximum number of result items per page. - * @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 of a DeviceGroup list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByProductSinglePageAsync(String resourceGroupName, - String catalogName, String productName, String filter, Integer top, Integer skip, Integer maxpagesize, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByProduct(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, filter, top, skip, maxpagesize, catalogName, productName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used - * for product name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param filter Filter the result list using the given expression. - * @param top The number of result items to return. - * @param skip The number of result items to skip. - * @param maxpagesize The maximum number of result items per page. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 of a DeviceGroup list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByProductAsync(String resourceGroupName, String catalogName, - String productName, String filter, Integer top, Integer skip, Integer maxpagesize) { - return new PagedFlux<>(() -> listByProductSinglePageAsync(resourceGroupName, catalogName, productName, filter, - top, skip, maxpagesize), nextLink -> listByProductNextSinglePageAsync(nextLink)); - } - - /** - * List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used - * for product name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DeviceGroup list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByProductAsync(String resourceGroupName, String catalogName, - String productName) { - final String filter = null; - final Integer top = null; - final Integer skip = null; - final Integer maxpagesize = null; - return new PagedFlux<>(() -> listByProductSinglePageAsync(resourceGroupName, catalogName, productName, filter, - top, skip, maxpagesize), nextLink -> listByProductNextSinglePageAsync(nextLink)); - } - - /** - * List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used - * for product name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param filter Filter the result list using the given expression. - * @param top The number of result items to return. - * @param skip The number of result items to skip. - * @param maxpagesize The maximum number of result items per page. - * @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 of a DeviceGroup list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByProductAsync(String resourceGroupName, String catalogName, - String productName, String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { - return new PagedFlux<>(() -> listByProductSinglePageAsync(resourceGroupName, catalogName, productName, filter, - top, skip, maxpagesize, context), nextLink -> listByProductNextSinglePageAsync(nextLink, context)); - } - - /** - * List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used - * for product name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DeviceGroup list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByProduct(String resourceGroupName, String catalogName, - String productName) { - final String filter = null; - final Integer top = null; - final Integer skip = null; - final Integer maxpagesize = null; - return new PagedIterable<>( - listByProductAsync(resourceGroupName, catalogName, productName, filter, top, skip, maxpagesize)); - } - - /** - * List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used - * for product name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param filter Filter the result list using the given expression. - * @param top The number of result items to return. - * @param skip The number of result items to skip. - * @param maxpagesize The maximum number of result items per page. - * @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 of a DeviceGroup list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByProduct(String resourceGroupName, String catalogName, - String productName, String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { - return new PagedIterable<>( - listByProductAsync(resourceGroupName, catalogName, productName, filter, top, skip, maxpagesize, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByProductNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -388,28 +253,6 @@ public PagedIterable listByProduct(String resourceGroupName, S @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String catalogName, String productName, String deviceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (deviceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceGroupName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), @@ -418,51 +261,6 @@ private Mono> getWithResponseAsync(String resourceGro .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or - * device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device 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 a DeviceGroup along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String catalogName, - String productName, String deviceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (deviceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, catalogName, productName, deviceGroupName, accept, context); - } - /** * Get a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. @@ -483,39 +281,16 @@ private Mono getAsync(String resourceGroupName, String catalog .flatMap(res -> Mono.justOrEmpty(res.getValue())); } - /** - * Get a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or - * device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device 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 a DeviceGroup along with {@link Response}. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String catalogName, String productName, String deviceGroupName, Context context) { - return getWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, catalogName, productName, deviceGroupName, accept, context); } - /** - * Get a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or - * device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device 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 a DeviceGroup. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public DeviceGroupInner get(String resourceGroupName, String catalogName, String productName, String deviceGroupName) { @@ -534,98 +309,19 @@ public DeviceGroupInner get(String resourceGroupName, String catalogName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an device group resource belonging to a product resource along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String catalogName, String productName, String deviceGroupName, DeviceGroupInner 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 (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (deviceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceGroupName 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.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, resource, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or - * device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an device group resource belonging to a product resource along with {@link Response} on successful + * @return a device group resource belonging to a product resource along with {@link Response} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String catalogName, String productName, String deviceGroupName, DeviceGroupInner 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 (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (deviceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceGroupName 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(); - } + String catalogName, String productName, String deviceGroupName, DeviceGroupInner resource) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, resource, - accept, context); + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, + contentType, accept, resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -640,16 +336,13 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 {@link PollerFlux} for polling of an device group resource belonging to a product resource. + * @return a device group resource belonging to a product resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DeviceGroupInner> beginCreateOrUpdateAsync( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, - DeviceGroupInner resource) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName, resource); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - DeviceGroupInner.class, DeviceGroupInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, DeviceGroupInner resource) { + return createOrUpdateWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, resource, + Context.NONE); } /** @@ -665,17 +358,16 @@ private PollerFlux, DeviceGroupInner> beginCreateOr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 {@link PollerFlux} for polling of an device group resource belonging to a product resource. + * @return a device group resource belonging to a product resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DeviceGroupInner> beginCreateOrUpdateAsync( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, - DeviceGroupInner resource, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, catalogName, - productName, deviceGroupName, resource, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - DeviceGroupInner.class, DeviceGroupInner.class, context); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, DeviceGroupInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, contentType, + accept, resource, context); } /** @@ -690,36 +382,34 @@ private PollerFlux, DeviceGroupInner> beginCreateOr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 {@link SyncPoller} for polling of an device group resource belonging to a product resource. + * @return the {@link PollerFlux} for polling of a device group resource belonging to a product resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DeviceGroupInner> beginCreateOrUpdateAsync( + String resourceGroupName, String catalogName, String productName, String deviceGroupName, + DeviceGroupInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DeviceGroupInner.class, DeviceGroupInner.class, this.client.getContext()); + } + + @Override + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DeviceGroupInner> beginCreateOrUpdate(String resourceGroupName, String catalogName, String productName, String deviceGroupName, DeviceGroupInner resource) { - return this.beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, resource) - .getSyncPoller(); + return beginCreateOrUpdate(resourceGroupName, catalogName, productName, deviceGroupName, resource, + Context.NONE); } - /** - * Create a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or - * device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an device group resource belonging to a product resource. - */ + @Override @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DeviceGroupInner> beginCreateOrUpdate(String resourceGroupName, String catalogName, String productName, String deviceGroupName, DeviceGroupInner resource, Context context) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, resource, context) - .getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, catalogName, productName, + deviceGroupName, resource, context); + return this.client.getLroResult(response, DeviceGroupInner.class, + DeviceGroupInner.class, context); } /** @@ -734,7 +424,7 @@ public SyncPoller, DeviceGroupInner> beginCreateOrU * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an device group resource belonging to a product resource on successful completion of {@link Mono}. + * @return a device group resource belonging to a product resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String catalogName, String productName, @@ -743,69 +433,19 @@ private Mono createOrUpdateAsync(String resourceGroupName, Str .flatMap(this.client::getLroFinalResultOrError); } - /** - * Create a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or - * device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an device group resource belonging to a product resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String catalogName, String productName, - String deviceGroupName, DeviceGroupInner resource, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, resource, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or - * device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an device group resource belonging to a product resource. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public DeviceGroupInner createOrUpdate(String resourceGroupName, String catalogName, String productName, String deviceGroupName, DeviceGroupInner resource) { - return createOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, resource).block(); + return createOrUpdate(resourceGroupName, catalogName, productName, deviceGroupName, resource, Context.NONE); } - /** - * Create a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or - * device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an device group resource belonging to a product resource. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public DeviceGroupInner createOrUpdate(String resourceGroupName, String catalogName, String productName, String deviceGroupName, DeviceGroupInner resource, Context context) { - return createOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, resource, context) - .block(); + return this.client.getLroFinalResultOrError( + beginCreateOrUpdate(resourceGroupName, catalogName, productName, deviceGroupName, resource, context)); } /** @@ -820,44 +460,18 @@ public DeviceGroupInner createOrUpdate(String resourceGroupName, String catalogN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an device group resource belonging to a product resource along with {@link Response} on successful + * @return a device group resource belonging to a product resource along with {@link Response} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String catalogName, String productName, String deviceGroupName, DeviceGroupUpdate properties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (deviceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceGroupName is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, - properties, accept, context)) + contentType, accept, properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -870,47 +484,16 @@ private Mono>> updateWithResponseAsync(String resource * @param productName Name of product. * @param deviceGroupName Name of device group. * @param properties The resource properties to be updated. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an device group resource belonging to a product resource along with {@link Response} on successful - * completion of {@link Mono}. + * @return a device group resource belonging to a product resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String catalogName, - String productName, String deviceGroupName, DeviceGroupUpdate properties, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (deviceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceGroupName is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, catalogName, productName, deviceGroupName, properties, accept, context); + private Response updateWithResponse(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, DeviceGroupUpdate properties) { + return updateWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, properties, + Context.NONE); } /** @@ -922,18 +505,20 @@ private Mono>> updateWithResponseAsync(String resource * @param productName Name of product. * @param deviceGroupName Name of device group. * @param properties The resource properties to be updated. + * @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 {@link PollerFlux} for polling of an device group resource belonging to a product resource. + * @return a device group resource belonging to a product resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DeviceGroupInner> beginUpdateAsync(String resourceGroupName, - String catalogName, String productName, String deviceGroupName, DeviceGroupUpdate properties) { - Mono>> mono - = updateWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName, properties); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - DeviceGroupInner.class, DeviceGroupInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, DeviceGroupUpdate properties, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, contentType, + accept, properties, context); } /** @@ -945,63 +530,35 @@ private PollerFlux, DeviceGroupInner> beginUpdateAs * @param productName Name of product. * @param deviceGroupName Name of device group. * @param properties The resource properties to be updated. - * @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 {@link PollerFlux} for polling of an device group resource belonging to a product resource. + * @return the {@link PollerFlux} for polling of a device group resource belonging to a product resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DeviceGroupInner> beginUpdateAsync(String resourceGroupName, - String catalogName, String productName, String deviceGroupName, DeviceGroupUpdate properties, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = updateWithResponseAsync(resourceGroupName, catalogName, productName, - deviceGroupName, properties, context); + String catalogName, String productName, String deviceGroupName, DeviceGroupUpdate properties) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName, properties); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - DeviceGroupInner.class, DeviceGroupInner.class, context); + DeviceGroupInner.class, DeviceGroupInner.class, this.client.getContext()); } - /** - * Update a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or - * device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param properties The resource properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 {@link SyncPoller} for polling of an device group resource belonging to a product resource. - */ + @Override @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DeviceGroupInner> beginUpdate(String resourceGroupName, String catalogName, String productName, String deviceGroupName, DeviceGroupUpdate properties) { - return this.beginUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, properties) - .getSyncPoller(); + return beginUpdate(resourceGroupName, catalogName, productName, deviceGroupName, properties, Context.NONE); } - /** - * Update a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or - * device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param properties The resource properties to be updated. - * @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 {@link SyncPoller} for polling of an device group resource belonging to a product resource. - */ + @Override @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DeviceGroupInner> beginUpdate(String resourceGroupName, String catalogName, String productName, String deviceGroupName, DeviceGroupUpdate properties, Context context) { - return this.beginUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, properties, context) - .getSyncPoller(); + Response response + = updateWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, properties, context); + return this.client.getLroResult(response, DeviceGroupInner.class, + DeviceGroupInner.class, context); } /** @@ -1016,7 +573,7 @@ public SyncPoller, DeviceGroupInner> beginUpdate(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 an device group resource belonging to a product resource on successful completion of {@link Mono}. + * @return a device group resource belonging to a product resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String catalogName, String productName, @@ -1025,68 +582,19 @@ private Mono updateAsync(String resourceGroupName, String cata .flatMap(this.client::getLroFinalResultOrError); } - /** - * Update a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or - * device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param properties The resource properties to be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an device group resource belonging to a product resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String catalogName, String productName, - String deviceGroupName, DeviceGroupUpdate properties, Context context) { - return beginUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, properties, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or - * device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param properties The resource properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an device group resource belonging to a product resource. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public DeviceGroupInner update(String resourceGroupName, String catalogName, String productName, String deviceGroupName, DeviceGroupUpdate properties) { - return updateAsync(resourceGroupName, catalogName, productName, deviceGroupName, properties).block(); + return update(resourceGroupName, catalogName, productName, deviceGroupName, properties, Context.NONE); } - /** - * Update a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or - * device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param properties The resource properties to be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an device group resource belonging to a product resource. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public DeviceGroupInner update(String resourceGroupName, String catalogName, String productName, String deviceGroupName, DeviceGroupUpdate properties, Context context) { - return updateAsync(resourceGroupName, catalogName, productName, deviceGroupName, properties, context).block(); + return this.client.getLroFinalResultOrError( + beginUpdate(resourceGroupName, catalogName, productName, deviceGroupName, properties, context)); } /** @@ -1105,33 +613,9 @@ public DeviceGroupInner update(String resourceGroupName, String catalogName, Str @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String catalogName, String productName, String deviceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (deviceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, accept, - context)) + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1143,41 +627,15 @@ private Mono>> deleteWithResponseAsync(String resource * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device 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 the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String catalogName, - String productName, String deviceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (deviceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, catalogName, productName, deviceGroupName, accept, context); + private Response deleteWithResponse(String resourceGroupName, String catalogName, String productName, + String deviceGroupName) { + return deleteWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, Context.NONE); } /** @@ -1188,18 +646,17 @@ private Mono>> deleteWithResponseAsync(String resource * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device 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 the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String catalogName, - String productName, String deviceGroupName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, context); } /** @@ -1210,7 +667,6 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device 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. @@ -1218,12 +674,27 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String catalogName, - String productName, String deviceGroupName, Context context) { - context = this.client.mergeContext(context); + String productName, String deviceGroupName) { Mono>> mono - = deleteWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName, context); + = deleteWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); + } + + @Override + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, + String productName, String deviceGroupName) { + return beginDelete(resourceGroupName, catalogName, productName, deviceGroupName, Context.NONE); + } + + @Override + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, Context context) { + Response response + = deleteWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -1237,110 +708,173 @@ private PollerFlux, Void> beginDeleteAsync(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 the {@link SyncPoller} for polling of long-running operation. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, - String productName, String deviceGroupName) { - return this.beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String catalogName, String productName, + String deviceGroupName) { + return beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + @Override + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName) { + delete(resourceGroupName, catalogName, productName, deviceGroupName, Context.NONE); + } + + @Override + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + Context context) { + this.client.getLroFinalResultOrError( + beginDelete(resourceGroupName, catalogName, productName, deviceGroupName, context)); } /** - * Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or - * device group name. + * List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used + * for product name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param context The context to associate with this operation. + * @param filter Filter the result list using the given expression. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @param maxpagesize The maximum number of result items per page. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 {@link SyncPoller} for polling of long-running operation. + * @return the response of a DeviceGroup list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, - String productName, String deviceGroupName, Context context) { - return this.beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, context) - .getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProductSinglePageAsync(String resourceGroupName, + String catalogName, String productName, String filter, Integer top, Integer skip, Integer maxpagesize) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByProduct(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, top, skip, maxpagesize, catalogName, + productName, 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())); } /** - * Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or - * device group name. + * List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used + * for product name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. - * @param deviceGroupName Name of device group. + * @param filter Filter the result list using the given expression. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @param maxpagesize The maximum number of result items per page. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 {@link Mono} that completes when a successful response is received. + * @return the response of a DeviceGroup list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String catalogName, String productName, - String deviceGroupName) { - return beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName).last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProductAsync(String resourceGroupName, String catalogName, + String productName, String filter, Integer top, Integer skip, Integer maxpagesize) { + return new PagedFlux<>(() -> listByProductSinglePageAsync(resourceGroupName, catalogName, productName, filter, + top, skip, maxpagesize), nextLink -> listByProductNextSinglePageAsync(nextLink)); } /** - * Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or - * device group name. + * List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used + * for product name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. - * @param deviceGroupName Name of device 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 A {@link Mono} that completes when a successful response is received. + * @return the response of a DeviceGroup list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String catalogName, String productName, - String deviceGroupName, Context context) { - return beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProductAsync(String resourceGroupName, String catalogName, + String productName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final Integer maxpagesize = null; + return new PagedFlux<>(() -> listByProductSinglePageAsync(resourceGroupName, catalogName, productName, filter, + top, skip, maxpagesize), nextLink -> listByProductNextSinglePageAsync(nextLink)); } /** - * Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or - * device group name. + * List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used + * for product name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. - * @param deviceGroupName Name of device group. + * @param filter Filter the result list using the given expression. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @param maxpagesize The maximum number of result items per page. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 of a DeviceGroup list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName) { - deleteAsync(resourceGroupName, catalogName, productName, deviceGroupName).block(); + private PagedResponse listByProductSinglePage(String resourceGroupName, String catalogName, + String productName, String filter, Integer top, Integer skip, Integer maxpagesize) { + return listByProductSinglePage(resourceGroupName, catalogName, productName, filter, top, skip, maxpagesize, + Context.NONE); } /** - * Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or - * device group name. + * List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used + * for product name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. - * @param deviceGroupName Name of device group. + * @param filter Filter the result list using the given expression. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @param maxpagesize The maximum number of result items per page. * @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 of a DeviceGroup list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, - Context context) { - deleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, context).block(); + private PagedResponse listByProductSinglePage(String resourceGroupName, String catalogName, + String productName, String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { + final String accept = "application/json"; + Response res = service.listByProductSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, filter, top, skip, + maxpagesize, catalogName, productName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + @Override + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProduct(String resourceGroupName, String catalogName, + String productName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final Integer maxpagesize = null; + return listByProduct(resourceGroupName, catalogName, productName, filter, top, skip, maxpagesize, Context.NONE); + } + + @Override + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProduct(String resourceGroupName, String catalogName, + String productName, String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { + return new PagedIterable<>(() -> listByProductSinglePage(resourceGroupName, catalogName, productName, filter, + top, skip, maxpagesize, context), nextLink -> listByProductNextSinglePage(nextLink, context)); } /** @@ -1360,39 +894,11 @@ public void delete(String resourceGroupName, String catalogName, String productN @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> claimDevicesWithResponseAsync(String resourceGroupName, String catalogName, String productName, String deviceGroupName, ClaimDevicesRequest claimDevicesRequest) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (deviceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceGroupName is required and cannot be null.")); - } - if (claimDevicesRequest == null) { - return Mono - .error(new IllegalArgumentException("Parameter claimDevicesRequest is required and cannot be null.")); - } else { - claimDevicesRequest.validate(); - } - final String accept = "application/json"; + final String contentType = "application/json"; return FluxUtil .withContext(context -> service.claimDevices(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, - claimDevicesRequest, accept, context)) + contentType, claimDevicesRequest, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1405,48 +911,16 @@ private Mono>> claimDevicesWithResponseAsync(String re * @param productName Name of product. * @param deviceGroupName Name of device group. * @param claimDevicesRequest Bulk claim devices request body. - * @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 {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> claimDevicesWithResponseAsync(String resourceGroupName, String catalogName, - String productName, String deviceGroupName, ClaimDevicesRequest claimDevicesRequest, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (deviceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceGroupName is required and cannot be null.")); - } - if (claimDevicesRequest == null) { - return Mono - .error(new IllegalArgumentException("Parameter claimDevicesRequest is required and cannot be null.")); - } else { - claimDevicesRequest.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.claimDevices(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, - claimDevicesRequest, accept, context); + private Response claimDevicesWithResponse(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, ClaimDevicesRequest claimDevicesRequest) { + return claimDevicesWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, + claimDevicesRequest, Context.NONE); } /** @@ -1458,18 +932,19 @@ private Mono>> claimDevicesWithResponseAsync(String re * @param productName Name of product. * @param deviceGroupName Name of device group. * @param claimDevicesRequest Bulk claim devices request body. + * @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 {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginClaimDevicesAsync(String resourceGroupName, String catalogName, - String productName, String deviceGroupName, ClaimDevicesRequest claimDevicesRequest) { - Mono>> mono = claimDevicesWithResponseAsync(resourceGroupName, catalogName, - productName, deviceGroupName, claimDevicesRequest); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response claimDevicesWithResponse(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, ClaimDevicesRequest claimDevicesRequest, Context context) { + final String contentType = "application/json"; + return service.claimDevicesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, contentType, + claimDevicesRequest, context); } /** @@ -1481,7 +956,6 @@ private PollerFlux, Void> beginClaimDevicesAsync(String resourc * @param productName Name of product. * @param deviceGroupName Name of device group. * @param claimDevicesRequest Bulk claim devices request body. - * @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. @@ -1489,58 +963,28 @@ private PollerFlux, Void> beginClaimDevicesAsync(String resourc */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginClaimDevicesAsync(String resourceGroupName, String catalogName, - String productName, String deviceGroupName, ClaimDevicesRequest claimDevicesRequest, Context context) { - context = this.client.mergeContext(context); + String productName, String deviceGroupName, ClaimDevicesRequest claimDevicesRequest) { Mono>> mono = claimDevicesWithResponseAsync(resourceGroupName, catalogName, - productName, deviceGroupName, claimDevicesRequest, context); + productName, deviceGroupName, claimDevicesRequest); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } - /** - * Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk - * claiming devices to a catalog only. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param claimDevicesRequest Bulk claim devices request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 {@link SyncPoller} for polling of long-running operation. - */ + @Override @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginClaimDevices(String resourceGroupName, String catalogName, String productName, String deviceGroupName, ClaimDevicesRequest claimDevicesRequest) { - return this - .beginClaimDevicesAsync(resourceGroupName, catalogName, productName, deviceGroupName, claimDevicesRequest) - .getSyncPoller(); + return beginClaimDevices(resourceGroupName, catalogName, productName, deviceGroupName, claimDevicesRequest, + Context.NONE); } - /** - * Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk - * claiming devices to a catalog only. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param claimDevicesRequest Bulk claim devices request body. - * @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 {@link SyncPoller} for polling of long-running operation. - */ + @Override @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginClaimDevices(String resourceGroupName, String catalogName, String productName, String deviceGroupName, ClaimDevicesRequest claimDevicesRequest, Context context) { - return this - .beginClaimDevicesAsync(resourceGroupName, catalogName, productName, deviceGroupName, claimDevicesRequest, - context) - .getSyncPoller(); + Response response = claimDevicesWithResponse(resourceGroupName, catalogName, productName, + deviceGroupName, claimDevicesRequest, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -1565,66 +1009,19 @@ private Mono claimDevicesAsync(String resourceGroupName, String catalogNam .flatMap(this.client::getLroFinalResultOrError); } - /** - * Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk - * claiming devices to a catalog only. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param claimDevicesRequest Bulk claim devices request body. - * @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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono claimDevicesAsync(String resourceGroupName, String catalogName, String productName, - String deviceGroupName, ClaimDevicesRequest claimDevicesRequest, Context context) { - return beginClaimDevicesAsync(resourceGroupName, catalogName, productName, deviceGroupName, claimDevicesRequest, - context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk - * claiming devices to a catalog only. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param claimDevicesRequest Bulk claim devices request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public void claimDevices(String resourceGroupName, String catalogName, String productName, String deviceGroupName, ClaimDevicesRequest claimDevicesRequest) { - claimDevicesAsync(resourceGroupName, catalogName, productName, deviceGroupName, claimDevicesRequest).block(); + claimDevices(resourceGroupName, catalogName, productName, deviceGroupName, claimDevicesRequest, Context.NONE); } - /** - * Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk - * claiming devices to a catalog only. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param claimDevicesRequest Bulk claim devices request body. - * @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. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public void claimDevices(String resourceGroupName, String catalogName, String productName, String deviceGroupName, ClaimDevicesRequest claimDevicesRequest, Context context) { - claimDevicesAsync(resourceGroupName, catalogName, productName, deviceGroupName, claimDevicesRequest, context) - .block(); + this.client.getLroFinalResultOrError(beginClaimDevices(resourceGroupName, catalogName, productName, + deviceGroupName, claimDevicesRequest, context)); } /** @@ -1644,28 +1041,6 @@ public void claimDevices(String resourceGroupName, String catalogName, String pr @ServiceMethod(returns = ReturnType.SINGLE) private Mono> countDevicesWithResponseAsync(String resourceGroupName, String catalogName, String productName, String deviceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (deviceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceGroupName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.countDevices(this.client.getEndpoint(), this.client.getApiVersion(), @@ -1674,53 +1049,6 @@ private Mono> countDevicesWithResponseAsync( .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Counts devices in device group. '.default' and '.unassigned' are system defined values and cannot be used for - * product or device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device 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 response to the action call for count devices in a catalog along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> countDevicesWithResponseAsync(String resourceGroupName, - String catalogName, String productName, String deviceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (deviceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.countDevices(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, accept, - context); - } - /** * Counts devices in device group. '.default' and '.unassigned' are system defined values and cannot be used for * product or device group name. @@ -1741,40 +1069,17 @@ private Mono countDevicesAsync(String resourceGroupNa .flatMap(res -> Mono.justOrEmpty(res.getValue())); } - /** - * Counts devices in device group. '.default' and '.unassigned' are system defined values and cannot be used for - * product or device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device 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 response to the action call for count devices in a catalog along with {@link Response}. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public Response countDevicesWithResponse(String resourceGroupName, String catalogName, String productName, String deviceGroupName, Context context) { - return countDevicesWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName, context) - .block(); + final String accept = "application/json"; + return service.countDevicesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, accept, + context); } - /** - * Counts devices in device group. '.default' and '.unassigned' are system defined values and cannot be used for - * product or device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device 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 response to the action call for count devices in a catalog. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public CountDevicesResponseInner countDevices(String resourceGroupName, String catalogName, String productName, String deviceGroupName) { @@ -1794,13 +1099,6 @@ public CountDevicesResponseInner countDevices(String resourceGroupName, String c */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByProductNextSinglePageAsync(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.listByProductNext(nextLink, this.client.getEndpoint(), accept, context)) @@ -1809,6 +1107,20 @@ private Mono> listByProductNextSinglePageAsync(S .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 of a DeviceGroup list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByProductNextSinglePage(String nextLink) { + return listByProductNextSinglePage(nextLink, Context.NONE); + } + /** * Get the next page of items. * @@ -1817,22 +1129,14 @@ private Mono> listByProductNextSinglePageAsync(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 the response of a DeviceGroup list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a DeviceGroup list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByProductNextSinglePageAsync(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.")); - } + private PagedResponse listByProductNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByProductNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByProductNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceGroupsImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceGroupsImpl.java index 8adfd5a5fa21f..7b5e0ff99657e 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceGroupsImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceGroupsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.implementation; @@ -30,29 +30,12 @@ public DeviceGroupsImpl(DeviceGroupsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable listByProduct(String resourceGroupName, String catalogName, String productName) { - PagedIterable inner - = this.serviceClient().listByProduct(resourceGroupName, catalogName, productName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DeviceGroupImpl(inner1, this.manager())); - } - - public PagedIterable listByProduct(String resourceGroupName, String catalogName, String productName, - String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { - PagedIterable inner = this.serviceClient() - .listByProduct(resourceGroupName, catalogName, productName, filter, top, skip, maxpagesize, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DeviceGroupImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String catalogName, String productName, String deviceGroupName, Context context) { Response inner = this.serviceClient() .getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DeviceGroupImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DeviceGroupImpl(inner.getValue(), this.manager())); } public DeviceGroup get(String resourceGroupName, String catalogName, String productName, String deviceGroupName) { @@ -65,7 +48,7 @@ public DeviceGroup get(String resourceGroupName, String catalogName, String prod } public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName) { - this.serviceClient().delete(resourceGroupName, catalogName, productName, deviceGroupName); + this.delete(resourceGroupName, catalogName, productName, deviceGroupName, Context.NONE); } public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, @@ -73,10 +56,23 @@ public void delete(String resourceGroupName, String catalogName, String productN this.serviceClient().delete(resourceGroupName, catalogName, productName, deviceGroupName, context); } + public PagedIterable listByProduct(String resourceGroupName, String catalogName, String productName) { + PagedIterable inner + = this.serviceClient().listByProduct(resourceGroupName, catalogName, productName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeviceGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByProduct(String resourceGroupName, String catalogName, String productName, + String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { + PagedIterable inner = this.serviceClient() + .listByProduct(resourceGroupName, catalogName, productName, filter, top, skip, maxpagesize, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeviceGroupImpl(inner1, this.manager())); + } + public void claimDevices(String resourceGroupName, String catalogName, String productName, String deviceGroupName, ClaimDevicesRequest claimDevicesRequest) { - this.serviceClient() - .claimDevices(resourceGroupName, catalogName, productName, deviceGroupName, claimDevicesRequest); + this.claimDevices(resourceGroupName, catalogName, productName, deviceGroupName, claimDevicesRequest, + Context.NONE); } public void claimDevices(String resourceGroupName, String catalogName, String productName, String deviceGroupName, @@ -89,12 +85,8 @@ public Response countDevicesWithResponse(String resourceGr String productName, String deviceGroupName, Context context) { Response inner = this.serviceClient() .countDevicesWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CountDevicesResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CountDevicesResponseImpl(inner.getValue(), this.manager())); } public CountDevicesResponse countDevices(String resourceGroupName, String catalogName, String productName, @@ -109,99 +101,42 @@ public CountDevicesResponse countDevices(String resourceGroupName, String catalo } public DeviceGroup getById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); - if (catalogName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); - } - String productName = ResourceManagerUtils.getValueFromIdByName(id, "products"); - if (productName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); - } - String deviceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "deviceGroups"); - if (deviceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); - } - return this.getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, Context.NONE) - .getValue(); + return this.getByIdWithResponse(id, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); - if (catalogName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); - } - String productName = ResourceManagerUtils.getValueFromIdByName(id, "products"); - if (productName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); - } - String deviceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "deviceGroups"); - if (deviceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); - } + String resourceGroupName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}", + "resourceGroupName", "resourceGroups", LOGGER); + String catalogName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}", + "catalogName", "catalogs", LOGGER); + String productName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}", + "productName", "products", LOGGER); + String deviceGroupName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}", + "deviceGroupName", "deviceGroups", LOGGER); return this.getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, context); } public void deleteById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); - if (catalogName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); - } - String productName = ResourceManagerUtils.getValueFromIdByName(id, "products"); - if (productName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); - } - String deviceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "deviceGroups"); - if (deviceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); - } - this.delete(resourceGroupName, catalogName, productName, deviceGroupName, Context.NONE); + this.deleteByIdWithResponse(id, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); - if (catalogName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); - } - String productName = ResourceManagerUtils.getValueFromIdByName(id, "products"); - if (productName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); - } - String deviceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "deviceGroups"); - if (deviceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); - } + String resourceGroupName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}", + "resourceGroupName", "resourceGroups", LOGGER); + String catalogName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}", + "catalogName", "catalogs", LOGGER); + String productName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}", + "productName", "products", LOGGER); + String deviceGroupName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}", + "deviceGroupName", "deviceGroups", LOGGER); this.delete(resourceGroupName, catalogName, productName, deviceGroupName, context); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceImpl.java index 6ef68f62a7a8c..01a87c9bb9d58 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.implementation; @@ -73,11 +73,7 @@ public DeviceImpl withExistingDeviceGroup(String resourceGroupName, String catal } public Device create() { - this.innerObject = serviceManager.serviceClient() - .getDevices() - .createOrUpdate(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, this.innerModel(), - Context.NONE); - return this; + return this.create(Context.NONE); } public Device create(Context context) { @@ -100,11 +96,7 @@ public DeviceImpl update() { } public Device apply() { - this.innerObject = serviceManager.serviceClient() - .getDevices() - .update(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, updateProperties, - Context.NONE); - return this; + return this.apply(Context.NONE); } public Device apply(Context context) { @@ -118,19 +110,25 @@ public Device apply(Context context) { DeviceImpl(DeviceInner innerObject, com.azure.resourcemanager.sphere.AzureSphereManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.catalogName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "catalogs"); - this.productName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "products"); - this.deviceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "deviceGroups"); - this.deviceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "devices"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}", + "resourceGroupName"); + this.catalogName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}", + "catalogName"); + this.productName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}", + "productName"); + this.deviceGroupName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}", + "deviceGroupName"); + this.deviceName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}", + "deviceName"); } public Device refresh() { - this.innerObject = serviceManager.serviceClient() - .getDevices() - .getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, Context.NONE) - .getValue(); - return this; + return this.refresh(Context.NONE); } public Device refresh(Context context) { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceInsightImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceInsightImpl.java index 1671950314c7f..c751ce5012841 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceInsightImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceInsightImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.implementation; diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DevicesClientImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DevicesClientImpl.java index 7e559e5c1b0e9..b76a71e200caa 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DevicesClientImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DevicesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.implementation; @@ -29,6 +29,7 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; @@ -36,7 +37,7 @@ import com.azure.resourcemanager.sphere.fluent.DevicesClient; import com.azure.resourcemanager.sphere.fluent.models.DeviceInner; import com.azure.resourcemanager.sphere.fluent.models.SignedCapabilityImageResponseInner; -import com.azure.resourcemanager.sphere.models.DeviceListResult; +import com.azure.resourcemanager.sphere.implementation.models.DeviceListResult; import com.azure.resourcemanager.sphere.models.DeviceUpdate; import com.azure.resourcemanager.sphere.models.GenerateCapabilityImageRequest; import java.nio.ByteBuffer; @@ -55,277 +56,166 @@ public final class DevicesClientImpl implements DevicesClient { /** * The service client containing this operation class. */ - private final AzureSphereMgmtClientImpl client; + private final AzureSphereManagementClientImpl client; /** * Initializes an instance of DevicesClientImpl. * * @param client the instance of the service client containing this operation class. */ - DevicesClientImpl(AzureSphereMgmtClientImpl client) { + DevicesClientImpl(AzureSphereManagementClientImpl client) { this.service = RestProxy.create(DevicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureSphereMgmtClientDevices to be used by the proxy service to + * The interface defining all the services for AzureSphereManagementClientDevices to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "AzureSphereMgmtClien") + @Host("{endpoint}") + @ServiceInterface(name = "AzureSphereManagementClientDevices") public interface DevicesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByDeviceGroup(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, - @HeaderParam("Accept") String accept, Context context); + @PathParam("deviceName") String deviceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, @PathParam("deviceName") String deviceName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, - @PathParam("deviceName") String deviceName, @BodyParam("application/json") DeviceInner resource, - @HeaderParam("Accept") String accept, Context context); + @PathParam("deviceName") String deviceName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DeviceInner resource, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, + @PathParam("deviceName") String deviceName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DeviceInner resource, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, + Mono>> update(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, - @PathParam("deviceName") String deviceName, @BodyParam("application/json") DeviceUpdate properties, - @HeaderParam("Accept") String accept, Context context); + @PathParam("deviceName") String deviceName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DeviceUpdate properties, + Context context); - @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, + @PathParam("deviceName") String deviceName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DeviceUpdate properties, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, + Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, - @PathParam("deviceName") String deviceName, @HeaderParam("Accept") String accept, Context context); + @PathParam("deviceName") String deviceName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, + @PathParam("deviceName") String deviceName, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDeviceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByDeviceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, + @HeaderParam("Accept") String accept, Context context); + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}/generateCapabilityImage") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> generateCapabilityImage(@HostParam("$host") String endpoint, + Mono>> generateCapabilityImage(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, - @PathParam("deviceName") String deviceName, + @PathParam("deviceName") String deviceName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") GenerateCapabilityImageRequest generateDeviceCapabilityRequest, - @HeaderParam("Accept") String accept, Context context); + Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}/generateCapabilityImage") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response generateCapabilityImageSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, + @PathParam("deviceName") String deviceName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") GenerateCapabilityImageRequest generateDeviceCapabilityRequest, + Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByDeviceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used - * for product or device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device 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 the response of a Device list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDeviceGroupSinglePageAsync(String resourceGroupName, - String catalogName, String productName, String deviceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (deviceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByDeviceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, 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())); - } - /** - * List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used - * for product or device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device 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 the response of a Device list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDeviceGroupSinglePageAsync(String resourceGroupName, - String catalogName, String productName, String deviceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (deviceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByDeviceGroup(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, catalogName, productName, deviceGroupName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used - * for product or device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device 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 the response of a Device list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDeviceGroupAsync(String resourceGroupName, String catalogName, - String productName, String deviceGroupName) { - return new PagedFlux<>( - () -> listByDeviceGroupSinglePageAsync(resourceGroupName, catalogName, productName, deviceGroupName), - nextLink -> listByDeviceGroupNextSinglePageAsync(nextLink)); - } - - /** - * List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used - * for product or device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device 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 the response of a Device list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDeviceGroupAsync(String resourceGroupName, String catalogName, - String productName, String deviceGroupName, Context context) { - return new PagedFlux<>(() -> listByDeviceGroupSinglePageAsync(resourceGroupName, catalogName, productName, - deviceGroupName, context), nextLink -> listByDeviceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used - * for product or device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device 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 the response of a Device list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, - String productName, String deviceGroupName) { - return new PagedIterable<>( - listByDeviceGroupAsync(resourceGroupName, catalogName, productName, deviceGroupName)); - } - - /** - * List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used - * for product or device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device 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 the response of a Device list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, - String productName, String deviceGroupName, Context context) { - return new PagedIterable<>( - listByDeviceGroupAsync(resourceGroupName, catalogName, productName, deviceGroupName, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByDeviceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -345,31 +235,6 @@ public PagedIterable listByDeviceGroup(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (deviceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceGroupName is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), @@ -378,55 +243,6 @@ private Mono> getWithResponseAsync(String resourceGroupNam .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not - * belong to a device group and product. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param deviceName Device name. - * @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 Device along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String catalogName, - String productName, String deviceGroupName, String deviceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (deviceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceGroupName is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, catalogName, productName, deviceGroupName, deviceName, accept, context); - } - /** * Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not * belong to a device group and product. @@ -448,42 +264,16 @@ private Mono getAsync(String resourceGroupName, String catalogName, .flatMap(res -> Mono.justOrEmpty(res.getValue())); } - /** - * Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not - * belong to a device group and product. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param deviceName Device name. - * @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 Device along with {@link Response}. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName, Context context) { - return getWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, context) - .block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, catalogName, productName, deviceGroupName, deviceName, accept, context); } - /** - * Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not - * belong to a device group and product. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param deviceName Device name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Device. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public DeviceInner get(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName) { @@ -504,47 +294,18 @@ public DeviceInner get(String resourceGroupName, String catalogName, String prod * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an device resource belonging to a device group resource along with {@link Response} on successful + * @return a device resource belonging to a device group resource along with {@link Response} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName, DeviceInner 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 (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (deviceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceGroupName is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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 contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, - deviceName, resource, accept, context)) + deviceName, contentType, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -558,52 +319,16 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param deviceGroupName Name of device group. * @param deviceName Device name. * @param resource Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an device resource belonging to a device group resource along with {@link Response} on successful - * completion of {@link Mono}. + * @return a device resource belonging to a device group resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String catalogName, String productName, String deviceGroupName, String deviceName, DeviceInner 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 (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (deviceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceGroupName is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, deviceName, - resource, accept, context); + private Response createOrUpdateWithResponse(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deviceName, DeviceInner resource) { + return createOrUpdateWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, + resource, Context.NONE); } /** @@ -616,18 +341,20 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param deviceGroupName Name of device group. * @param deviceName Device name. * @param resource Resource create parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an device resource belonging to a device group resource. + * @return a device resource belonging to a device group resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DeviceInner> beginCreateOrUpdateAsync(String resourceGroupName, - String catalogName, String productName, String deviceGroupName, String deviceName, DeviceInner resource) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, catalogName, - productName, deviceGroupName, deviceName, resource); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - DeviceInner.class, DeviceInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deviceName, DeviceInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, deviceName, + contentType, accept, resource, context); } /** @@ -640,71 +367,37 @@ private PollerFlux, DeviceInner> beginCreateOrUpdateAsyn * @param deviceGroupName Name of device group. * @param deviceName Device name. * @param resource Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an device resource belonging to a device group resource. + * @return the {@link PollerFlux} for polling of a device resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DeviceInner> beginCreateOrUpdateAsync(String resourceGroupName, - String catalogName, String productName, String deviceGroupName, String deviceName, DeviceInner resource, - Context context) { - context = this.client.mergeContext(context); + String catalogName, String productName, String deviceGroupName, String deviceName, DeviceInner resource) { Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, catalogName, - productName, deviceGroupName, deviceName, resource, context); + productName, deviceGroupName, deviceName, resource); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - DeviceInner.class, DeviceInner.class, context); + DeviceInner.class, DeviceInner.class, this.client.getContext()); } - /** - * Create a Device. Use '.unassigned' or '.default' for the device group and product names to claim a device to the - * catalog only. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param deviceName Device name. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an device resource belonging to a device group resource. - */ + @Override @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DeviceInner> beginCreateOrUpdate(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName, DeviceInner resource) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, - resource) - .getSyncPoller(); + return beginCreateOrUpdate(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, resource, + Context.NONE); } - /** - * Create a Device. Use '.unassigned' or '.default' for the device group and product names to claim a device to the - * catalog only. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param deviceName Device name. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an device resource belonging to a device group resource. - */ + @Override @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DeviceInner> beginCreateOrUpdate(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName, DeviceInner resource, Context context) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, - resource, context) - .getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, catalogName, productName, + deviceGroupName, deviceName, resource, context); + return this.client.getLroResult(response, DeviceInner.class, DeviceInner.class, + context); } /** @@ -720,7 +413,7 @@ public SyncPoller, DeviceInner> beginCreateOrUpdate(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an device resource belonging to a device group resource on successful completion of {@link Mono}. + * @return a device resource belonging to a device group resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String catalogName, String productName, @@ -729,72 +422,20 @@ private Mono createOrUpdateAsync(String resourceGroupName, String c resource).last().flatMap(this.client::getLroFinalResultOrError); } - /** - * Create a Device. Use '.unassigned' or '.default' for the device group and product names to claim a device to the - * catalog only. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param deviceName Device name. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an device resource belonging to a device group resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String catalogName, String productName, - String deviceGroupName, String deviceName, DeviceInner resource, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, - resource, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create a Device. Use '.unassigned' or '.default' for the device group and product names to claim a device to the - * catalog only. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param deviceName Device name. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an device resource belonging to a device group resource. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public DeviceInner createOrUpdate(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName, DeviceInner resource) { - return createOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, resource) - .block(); + return createOrUpdate(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, resource, + Context.NONE); } - /** - * Create a Device. Use '.unassigned' or '.default' for the device group and product names to claim a device to the - * catalog only. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param deviceName Device name. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an device resource belonging to a device group resource. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public DeviceInner createOrUpdate(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName, DeviceInner resource, Context context) { - return createOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, resource, - context).block(); + return this.client.getLroFinalResultOrError(beginCreateOrUpdate(resourceGroupName, catalogName, productName, + deviceGroupName, deviceName, resource, context)); } /** @@ -810,47 +451,18 @@ public DeviceInner createOrUpdate(String resourceGroupName, String catalogName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an device resource belonging to a device group resource along with {@link Response} on successful + * @return a device resource belonging to a device group resource along with {@link Response} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName, DeviceUpdate properties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (deviceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceGroupName is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, - deviceName, properties, accept, context)) + deviceName, contentType, accept, properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -864,50 +476,16 @@ private Mono>> updateWithResponseAsync(String resource * @param deviceGroupName Name of device group. * @param deviceName Device name. * @param properties The resource properties to be updated. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an device resource belonging to a device group resource along with {@link Response} on successful - * completion of {@link Mono}. + * @return a device resource belonging to a device group resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String catalogName, - String productName, String deviceGroupName, String deviceName, DeviceUpdate properties, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (deviceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceGroupName is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, catalogName, productName, deviceGroupName, deviceName, properties, accept, context); + private Response updateWithResponse(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deviceName, DeviceUpdate properties) { + return updateWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, properties, + Context.NONE); } /** @@ -920,18 +498,20 @@ private Mono>> updateWithResponseAsync(String resource * @param deviceGroupName Name of device group. * @param deviceName Device name. * @param properties The resource properties to be updated. + * @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 {@link PollerFlux} for polling of an device resource belonging to a device group resource. + * @return a device resource belonging to a device group resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DeviceInner> beginUpdateAsync(String resourceGroupName, - String catalogName, String productName, String deviceGroupName, String deviceName, DeviceUpdate properties) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, catalogName, productName, - deviceGroupName, deviceName, properties); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - DeviceInner.class, DeviceInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deviceName, DeviceUpdate properties, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, deviceName, + contentType, accept, properties, context); } /** @@ -944,69 +524,36 @@ private PollerFlux, DeviceInner> beginUpdateAsync(String * @param deviceGroupName Name of device group. * @param deviceName Device name. * @param properties The resource properties to be updated. - * @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 {@link PollerFlux} for polling of an device resource belonging to a device group resource. + * @return the {@link PollerFlux} for polling of a device resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DeviceInner> beginUpdateAsync(String resourceGroupName, - String catalogName, String productName, String deviceGroupName, String deviceName, DeviceUpdate properties, - Context context) { - context = this.client.mergeContext(context); + String catalogName, String productName, String deviceGroupName, String deviceName, DeviceUpdate properties) { Mono>> mono = updateWithResponseAsync(resourceGroupName, catalogName, productName, - deviceGroupName, deviceName, properties, context); + deviceGroupName, deviceName, properties); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - DeviceInner.class, DeviceInner.class, context); + DeviceInner.class, DeviceInner.class, this.client.getContext()); } - /** - * Update a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the - * catalog level. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param deviceName Device name. - * @param properties The resource properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 {@link SyncPoller} for polling of an device resource belonging to a device group resource. - */ + @Override @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DeviceInner> beginUpdate(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName, DeviceUpdate properties) { - return this - .beginUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, properties) - .getSyncPoller(); + return beginUpdate(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, properties, + Context.NONE); } - /** - * Update a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the - * catalog level. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param deviceName Device name. - * @param properties The resource properties to be updated. - * @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 {@link SyncPoller} for polling of an device resource belonging to a device group resource. - */ + @Override @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DeviceInner> beginUpdate(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName, DeviceUpdate properties, Context context) { - return this - .beginUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, properties, - context) - .getSyncPoller(); + Response response = updateWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, + deviceName, properties, context); + return this.client.getLroResult(response, DeviceInner.class, DeviceInner.class, + context); } /** @@ -1022,7 +569,7 @@ public SyncPoller, DeviceInner> beginUpdate(String resou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an device resource belonging to a device group resource on successful completion of {@link Mono}. + * @return a device resource belonging to a device group resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String catalogName, String productName, @@ -1032,121 +579,20 @@ private Mono updateAsync(String resourceGroupName, String catalogNa .flatMap(this.client::getLroFinalResultOrError); } - /** - * Update a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the - * catalog level. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param deviceName Device name. - * @param properties The resource properties to be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an device resource belonging to a device group resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String catalogName, String productName, - String deviceGroupName, String deviceName, DeviceUpdate properties, Context context) { - return beginUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, properties, - context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the - * catalog level. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param deviceName Device name. - * @param properties The resource properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an device resource belonging to a device group resource. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public DeviceInner update(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName, DeviceUpdate properties) { - return updateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, properties) - .block(); - } - - /** - * Update a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the - * catalog level. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param deviceName Device name. - * @param properties The resource properties to be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an device resource belonging to a device group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeviceInner update(String resourceGroupName, String catalogName, String productName, String deviceGroupName, - String deviceName, DeviceUpdate properties, Context context) { - return updateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, properties, - context).block(); + return update(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, properties, + Context.NONE); } - /** - * Delete a Device. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param deviceName Device name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String catalogName, - String productName, String deviceGroupName, String deviceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (deviceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceGroupName is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, - deviceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @Override + @ServiceMethod(returns = ReturnType.SINGLE) + public DeviceInner update(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + String deviceName, DeviceUpdate properties, Context context) { + return this.client.getLroFinalResultOrError( + beginUpdate(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, properties, context)); } /** @@ -1157,7 +603,6 @@ private Mono>> deleteWithResponseAsync(String resource * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deviceName Device name. - * @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. @@ -1165,36 +610,12 @@ private Mono>> deleteWithResponseAsync(String resource */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String catalogName, - String productName, String deviceGroupName, String deviceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (deviceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceGroupName is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, catalogName, productName, deviceGroupName, deviceName, accept, context); + String productName, String deviceGroupName, String deviceName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, + deviceName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1208,15 +629,13 @@ private Mono>> deleteWithResponseAsync(String 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 {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String catalogName, - String productName, String deviceGroupName, String deviceName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deviceName) { + return deleteWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, + Context.NONE); } /** @@ -1231,15 +650,13 @@ private PollerFlux, Void> beginDeleteAsync(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 the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String catalogName, - String productName, String deviceGroupName, String deviceName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, catalogName, productName, - deviceGroupName, deviceName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deviceName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, deviceName, context); } @@ -1254,13 +671,31 @@ private PollerFlux, Void> beginDeleteAsync(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 the {@link SyncPoller} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deviceName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + @Override + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName) { - return this.beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName) - .getSyncPoller(); + return beginDelete(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, Context.NONE); + } + + @Override + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deviceName, Context context) { + Response response + = deleteWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -1271,96 +706,139 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deviceName Device name. - * @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 {@link SyncPoller} for polling of long-running operation. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, - String productName, String deviceGroupName, String deviceName, Context context) { - return this.beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, context) - .getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deviceName) { + return beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + @Override + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + String deviceName) { + delete(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, Context.NONE); + } + + @Override + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + String deviceName, Context context) { + this.client.getLroFinalResultOrError( + beginDelete(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, context)); } /** - * Delete a Device. + * List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used + * for product or device group name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. - * @param deviceName Device name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 {@link Mono} that completes when a successful response is received. + * @return the response of a Device list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String catalogName, String productName, - String deviceGroupName, String deviceName) { - return beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono> listByDeviceGroupSinglePageAsync(String resourceGroupName, + String catalogName, String productName, String deviceGroupName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByDeviceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, 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())); } /** - * Delete a Device. + * List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used + * for product or device group name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. - * @param deviceName Device name. - * @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 {@link Mono} that completes when a successful response is received. + * @return the response of a Device list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String catalogName, String productName, - String deviceGroupName, String deviceName, Context context) { - return beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDeviceGroupAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName) { + return new PagedFlux<>( + () -> listByDeviceGroupSinglePageAsync(resourceGroupName, catalogName, productName, deviceGroupName), + nextLink -> listByDeviceGroupNextSinglePageAsync(nextLink)); } /** - * Delete a Device. + * List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used + * for product or device group name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. - * @param deviceName Device name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 of a Device list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, - String deviceName) { - deleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName).block(); + private PagedResponse listByDeviceGroupSinglePage(String resourceGroupName, String catalogName, + String productName, String deviceGroupName) { + return listByDeviceGroupSinglePage(resourceGroupName, catalogName, productName, deviceGroupName, Context.NONE); } /** - * Delete a Device. + * List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used + * for product or device group name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. - * @param deviceName Device name. * @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 of a Device list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, - String deviceName, Context context) { - deleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, context).block(); + private PagedResponse listByDeviceGroupSinglePage(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, Context context) { + final String accept = "application/json"; + Response res = service.listByDeviceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, + deviceGroupName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + @Override + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, + String productName, String deviceGroupName) { + return listByDeviceGroup(resourceGroupName, catalogName, productName, deviceGroupName, Context.NONE); + } + + @Override + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, Context context) { + return new PagedIterable<>( + () -> listByDeviceGroupSinglePage(resourceGroupName, catalogName, productName, deviceGroupName, context), + nextLink -> listByDeviceGroupNextSinglePage(nextLink, context)); } /** @@ -1383,42 +861,13 @@ public void delete(String resourceGroupName, String catalogName, String productN private Mono>> generateCapabilityImageWithResponseAsync(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName, GenerateCapabilityImageRequest generateDeviceCapabilityRequest) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (deviceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceGroupName is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (generateDeviceCapabilityRequest == null) { - return Mono.error(new IllegalArgumentException( - "Parameter generateDeviceCapabilityRequest is required and cannot be null.")); - } else { - generateDeviceCapabilityRequest.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.generateCapabilityImage(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, catalogName, - productName, deviceGroupName, deviceName, generateDeviceCapabilityRequest, accept, context)) + .withContext( + context -> service.generateCapabilityImage(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, + deviceName, contentType, accept, generateDeviceCapabilityRequest, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1432,53 +881,17 @@ private Mono>> generateCapabilityImageWithResponseAsyn * @param deviceGroupName Name of device group. * @param deviceName Device name. * @param generateDeviceCapabilityRequest Generate capability image request body. - * @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 signed device capability image response along with {@link Response} on successful completion of - * {@link Mono}. + * @return signed device capability image response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> generateCapabilityImageWithResponseAsync(String resourceGroupName, - String catalogName, String productName, String deviceGroupName, String deviceName, - GenerateCapabilityImageRequest generateDeviceCapabilityRequest, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (deviceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceGroupName is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (generateDeviceCapabilityRequest == null) { - return Mono.error(new IllegalArgumentException( - "Parameter generateDeviceCapabilityRequest is required and cannot be null.")); - } else { - generateDeviceCapabilityRequest.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.generateCapabilityImage(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, deviceName, - generateDeviceCapabilityRequest, accept, context); + private Response generateCapabilityImageWithResponse(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deviceName, + GenerateCapabilityImageRequest generateDeviceCapabilityRequest) { + return generateCapabilityImageWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, + deviceName, generateDeviceCapabilityRequest, Context.NONE); } /** @@ -1491,20 +904,21 @@ private Mono>> generateCapabilityImageWithResponseAsyn * @param deviceGroupName Name of device group. * @param deviceName Device name. * @param generateDeviceCapabilityRequest Generate capability image request body. + * @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 {@link PollerFlux} for polling of signed device capability image response. + * @return signed device capability image response along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, SignedCapabilityImageResponseInner> - beginGenerateCapabilityImageAsync(String resourceGroupName, String catalogName, String productName, - String deviceGroupName, String deviceName, GenerateCapabilityImageRequest generateDeviceCapabilityRequest) { - Mono>> mono = generateCapabilityImageWithResponseAsync(resourceGroupName, catalogName, - productName, deviceGroupName, deviceName, generateDeviceCapabilityRequest); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), SignedCapabilityImageResponseInner.class, - SignedCapabilityImageResponseInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response generateCapabilityImageWithResponse(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deviceName, + GenerateCapabilityImageRequest generateDeviceCapabilityRequest, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.generateCapabilityImageSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, deviceName, + contentType, accept, generateDeviceCapabilityRequest, context); } /** @@ -1517,7 +931,6 @@ private Mono>> generateCapabilityImageWithResponseAsyn * @param deviceGroupName Name of device group. * @param deviceName Device name. * @param generateDeviceCapabilityRequest Generate capability image request body. - * @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. @@ -1526,66 +939,33 @@ private Mono>> generateCapabilityImageWithResponseAsyn @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, SignedCapabilityImageResponseInner> beginGenerateCapabilityImageAsync(String resourceGroupName, String catalogName, String productName, - String deviceGroupName, String deviceName, GenerateCapabilityImageRequest generateDeviceCapabilityRequest, - Context context) { - context = this.client.mergeContext(context); + String deviceGroupName, String deviceName, GenerateCapabilityImageRequest generateDeviceCapabilityRequest) { Mono>> mono = generateCapabilityImageWithResponseAsync(resourceGroupName, catalogName, - productName, deviceGroupName, deviceName, generateDeviceCapabilityRequest, context); + productName, deviceGroupName, deviceName, generateDeviceCapabilityRequest); return this.client.getLroResult(mono, this.client.getHttpPipeline(), SignedCapabilityImageResponseInner.class, - SignedCapabilityImageResponseInner.class, context); + SignedCapabilityImageResponseInner.class, this.client.getContext()); } - /** - * Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product - * names to generate the image for a device that does not belong to a specific device group and product. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param deviceName Device name. - * @param generateDeviceCapabilityRequest Generate capability image request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 {@link SyncPoller} for polling of signed device capability image response. - */ + @Override @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, SignedCapabilityImageResponseInner> beginGenerateCapabilityImage(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName, GenerateCapabilityImageRequest generateDeviceCapabilityRequest) { - return this - .beginGenerateCapabilityImageAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, - generateDeviceCapabilityRequest) - .getSyncPoller(); + return beginGenerateCapabilityImage(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, + generateDeviceCapabilityRequest, Context.NONE); } - /** - * Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product - * names to generate the image for a device that does not belong to a specific device group and product. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param deviceName Device name. - * @param generateDeviceCapabilityRequest Generate capability image request body. - * @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 {@link SyncPoller} for polling of signed device capability image response. - */ + @Override @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, SignedCapabilityImageResponseInner> beginGenerateCapabilityImage(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName, GenerateCapabilityImageRequest generateDeviceCapabilityRequest, Context context) { - return this - .beginGenerateCapabilityImageAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, - generateDeviceCapabilityRequest, context) - .getSyncPoller(); + Response response = generateCapabilityImageWithResponse(resourceGroupName, catalogName, productName, + deviceGroupName, deviceName, generateDeviceCapabilityRequest, context); + return this.client.getLroResult( + response, SignedCapabilityImageResponseInner.class, SignedCapabilityImageResponseInner.class, context); } /** @@ -1611,75 +991,22 @@ private Mono generateCapabilityImageAsync(St deviceName, generateDeviceCapabilityRequest).last().flatMap(this.client::getLroFinalResultOrError); } - /** - * Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product - * names to generate the image for a device that does not belong to a specific device group and product. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param deviceName Device name. - * @param generateDeviceCapabilityRequest Generate capability image request body. - * @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 signed device capability image response on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono generateCapabilityImageAsync(String resourceGroupName, - String catalogName, String productName, String deviceGroupName, String deviceName, - GenerateCapabilityImageRequest generateDeviceCapabilityRequest, Context context) { - return beginGenerateCapabilityImageAsync(resourceGroupName, catalogName, productName, deviceGroupName, - deviceName, generateDeviceCapabilityRequest, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product - * names to generate the image for a device that does not belong to a specific device group and product. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param deviceName Device name. - * @param generateDeviceCapabilityRequest Generate capability image request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return signed device capability image response. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public SignedCapabilityImageResponseInner generateCapabilityImage(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName, GenerateCapabilityImageRequest generateDeviceCapabilityRequest) { - return generateCapabilityImageAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, - generateDeviceCapabilityRequest).block(); + return generateCapabilityImage(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, + generateDeviceCapabilityRequest, Context.NONE); } - /** - * Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product - * names to generate the image for a device that does not belong to a specific device group and product. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param deviceName Device name. - * @param generateDeviceCapabilityRequest Generate capability image request body. - * @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 signed device capability image response. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public SignedCapabilityImageResponseInner generateCapabilityImage(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName, GenerateCapabilityImageRequest generateDeviceCapabilityRequest, Context context) { - return generateCapabilityImageAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, - generateDeviceCapabilityRequest, context).block(); + return this.client.getLroFinalResultOrError(beginGenerateCapabilityImage(resourceGroupName, catalogName, + productName, deviceGroupName, deviceName, generateDeviceCapabilityRequest, context)); } /** @@ -1694,13 +1021,6 @@ public SignedCapabilityImageResponseInner generateCapabilityImage(String resourc */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByDeviceGroupNextSinglePageAsync(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.listByDeviceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) @@ -1709,6 +1029,20 @@ private Mono> listByDeviceGroupNextSinglePageAsync(St .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 of a Device list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByDeviceGroupNextSinglePage(String nextLink) { + return listByDeviceGroupNextSinglePage(nextLink, Context.NONE); + } + /** * Get the next page of items. * @@ -1717,22 +1051,14 @@ private Mono> listByDeviceGroupNextSinglePageAsync(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 the response of a Device list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a Device list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDeviceGroupNextSinglePageAsync(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.")); - } + private PagedResponse listByDeviceGroupNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByDeviceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByDeviceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DevicesImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DevicesImpl.java index e2740cd293e4b..26243e1a119db 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DevicesImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DevicesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.implementation; @@ -29,30 +29,12 @@ public DevicesImpl(DevicesClient innerClient, com.azure.resourcemanager.sphere.A this.serviceManager = serviceManager; } - public PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, - String deviceGroupName) { - PagedIterable inner - = this.serviceClient().listByDeviceGroup(resourceGroupName, catalogName, productName, deviceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DeviceImpl(inner1, this.manager())); - } - - public PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, - String deviceGroupName, Context context) { - PagedIterable inner = this.serviceClient() - .listByDeviceGroup(resourceGroupName, catalogName, productName, deviceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DeviceImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName, Context context) { Response inner = this.serviceClient() .getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DeviceImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DeviceImpl(inner.getValue(), this.manager())); } public Device get(String resourceGroupName, String catalogName, String productName, String deviceGroupName, @@ -68,7 +50,7 @@ public Device get(String resourceGroupName, String catalogName, String productNa public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName) { - this.serviceClient().delete(resourceGroupName, catalogName, productName, deviceGroupName, deviceName); + this.delete(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, Context.NONE); } public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, @@ -76,17 +58,23 @@ public void delete(String resourceGroupName, String catalogName, String productN this.serviceClient().delete(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, context); } + public PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, + String deviceGroupName) { + return this.listByDeviceGroup(resourceGroupName, catalogName, productName, deviceGroupName, Context.NONE); + } + + public PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, Context context) { + PagedIterable inner = this.serviceClient() + .listByDeviceGroup(resourceGroupName, catalogName, productName, deviceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeviceImpl(inner1, this.manager())); + } + public SignedCapabilityImageResponse generateCapabilityImage(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName, GenerateCapabilityImageRequest generateDeviceCapabilityRequest) { - SignedCapabilityImageResponseInner inner = this.serviceClient() - .generateCapabilityImage(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, - generateDeviceCapabilityRequest); - if (inner != null) { - return new SignedCapabilityImageResponseImpl(inner, this.manager()); - } else { - return null; - } + return this.generateCapabilityImage(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, + generateDeviceCapabilityRequest, Context.NONE); } public SignedCapabilityImageResponse generateCapabilityImage(String resourceGroupName, String catalogName, @@ -103,120 +91,48 @@ public SignedCapabilityImageResponse generateCapabilityImage(String resourceGrou } public Device getById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); - if (catalogName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); - } - String productName = ResourceManagerUtils.getValueFromIdByName(id, "products"); - if (productName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); - } - String deviceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "deviceGroups"); - if (deviceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); - } - String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "devices"); - if (deviceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'devices'.", id))); - } - return this - .getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, Context.NONE) - .getValue(); + return this.getByIdWithResponse(id, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); - if (catalogName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); - } - String productName = ResourceManagerUtils.getValueFromIdByName(id, "products"); - if (productName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); - } - String deviceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "deviceGroups"); - if (deviceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); - } - String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "devices"); - if (deviceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'devices'.", id))); - } + String resourceGroupName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}", + "resourceGroupName", "resourceGroups", LOGGER); + String catalogName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}", + "catalogName", "catalogs", LOGGER); + String productName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}", + "productName", "products", LOGGER); + String deviceGroupName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}", + "deviceGroupName", "deviceGroups", LOGGER); + String deviceName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}", + "deviceName", "devices", LOGGER); return this.getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, context); } public void deleteById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); - if (catalogName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); - } - String productName = ResourceManagerUtils.getValueFromIdByName(id, "products"); - if (productName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); - } - String deviceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "deviceGroups"); - if (deviceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); - } - String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "devices"); - if (deviceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'devices'.", id))); - } - this.delete(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, Context.NONE); + this.deleteByIdWithResponse(id, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); - if (catalogName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); - } - String productName = ResourceManagerUtils.getValueFromIdByName(id, "products"); - if (productName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); - } - String deviceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "deviceGroups"); - if (deviceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); - } - String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "devices"); - if (deviceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'devices'.", id))); - } + String resourceGroupName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}", + "resourceGroupName", "resourceGroups", LOGGER); + String catalogName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}", + "catalogName", "catalogs", LOGGER); + String productName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}", + "productName", "products", LOGGER); + String deviceGroupName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}", + "deviceGroupName", "deviceGroups", LOGGER); + String deviceName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}", + "deviceName", "devices", LOGGER); this.delete(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, context); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ImageImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ImageImpl.java index 53b96a7899775..fa07e9aa97e68 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ImageImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ImageImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.implementation; @@ -60,10 +60,7 @@ public ImageImpl withExistingCatalog(String resourceGroupName, String catalogNam } public Image create() { - this.innerObject = serviceManager.serviceClient() - .getImages() - .createOrUpdate(resourceGroupName, catalogName, imageName, this.innerModel(), Context.NONE); - return this; + return this.create(Context.NONE); } public Image create(Context context) { @@ -84,10 +81,7 @@ public ImageImpl update() { } public Image apply() { - this.innerObject = serviceManager.serviceClient() - .getImages() - .createOrUpdate(resourceGroupName, catalogName, imageName, this.innerModel(), Context.NONE); - return this; + return this.apply(Context.NONE); } public Image apply(Context context) { @@ -100,17 +94,19 @@ public Image apply(Context context) { ImageImpl(ImageInner innerObject, com.azure.resourcemanager.sphere.AzureSphereManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.catalogName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "catalogs"); - this.imageName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "images"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}", + "resourceGroupName"); + this.catalogName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}", + "catalogName"); + this.imageName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}", + "imageName"); } public Image refresh() { - this.innerObject = serviceManager.serviceClient() - .getImages() - .getWithResponse(resourceGroupName, catalogName, imageName, Context.NONE) - .getValue(); - return this; + return this.refresh(Context.NONE); } public Image refresh(Context context) { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ImagesClientImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ImagesClientImpl.java index 8861c167c788d..47fad96abe198 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ImagesClientImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ImagesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.implementation; @@ -27,13 +27,14 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.sphere.fluent.ImagesClient; import com.azure.resourcemanager.sphere.fluent.models.ImageInner; -import com.azure.resourcemanager.sphere.models.ImageListResult; +import com.azure.resourcemanager.sphere.implementation.models.ImageListResult; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -50,264 +51,115 @@ public final class ImagesClientImpl implements ImagesClient { /** * The service client containing this operation class. */ - private final AzureSphereMgmtClientImpl client; + private final AzureSphereManagementClientImpl client; /** * Initializes an instance of ImagesClientImpl. * * @param client the instance of the service client containing this operation class. */ - ImagesClientImpl(AzureSphereMgmtClientImpl client) { + ImagesClientImpl(AzureSphereManagementClientImpl client) { this.service = RestProxy.create(ImagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureSphereMgmtClientImages to be used by the proxy service to + * The interface defining all the services for AzureSphereManagementClientImages to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "AzureSphereMgmtClien") + @Host("{endpoint}") + @ServiceInterface(name = "AzureSphereManagementClientImages") public interface ImagesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByCatalog(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, - @QueryParam("$top") Integer top, @QueryParam("$skip") Integer skip, - @QueryParam("$maxpagesize") Integer maxpagesize, @PathParam("catalogName") String catalogName, - @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("imageName") String imageName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, @PathParam("imageName") String imageName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, - @PathParam("imageName") String imageName, @BodyParam("application/json") ImageInner resource, - @HeaderParam("Accept") String accept, Context context); + @PathParam("imageName") String imageName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ImageInner resource, Context context); - @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("imageName") String imageName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ImageInner resource, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, + Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, - @PathParam("imageName") String imageName, @HeaderParam("Accept") String accept, Context context); + @PathParam("imageName") String imageName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("imageName") String imageName, Context context); @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByCatalogNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Mono> listByCatalog(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, @QueryParam("$skip") Integer skip, + @QueryParam("$maxpagesize") Integer maxpagesize, @PathParam("catalogName") String catalogName, @HeaderParam("Accept") String accept, Context context); - } - - /** - * List Image resources by Catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param filter Filter the result list using the given expression. - * @param top The number of result items to return. - * @param skip The number of result items to skip. - * @param maxpagesize The maximum number of result items per page. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 of a Image list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCatalogSinglePageAsync(String resourceGroupName, String catalogName, - String filter, Integer top, Integer skip, Integer maxpagesize) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByCatalog(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, filter, top, skip, maxpagesize, catalogName, 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())); - } - - /** - * List Image resources by Catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param filter Filter the result list using the given expression. - * @param top The number of result items to return. - * @param skip The number of result items to skip. - * @param maxpagesize The maximum number of result items per page. - * @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 of a Image list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCatalogSinglePageAsync(String resourceGroupName, String catalogName, - String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByCatalog(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, filter, top, skip, maxpagesize, catalogName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - /** - * List Image resources by Catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param filter Filter the result list using the given expression. - * @param top The number of result items to return. - * @param skip The number of result items to skip. - * @param maxpagesize The maximum number of result items per page. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 of a Image list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByCatalogAsync(String resourceGroupName, String catalogName, String filter, - Integer top, Integer skip, Integer maxpagesize) { - return new PagedFlux<>( - () -> listByCatalogSinglePageAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize), - nextLink -> listByCatalogNextSinglePageAsync(nextLink)); - } - - /** - * List Image resources by Catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 of a Image list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByCatalogAsync(String resourceGroupName, String catalogName) { - final String filter = null; - final Integer top = null; - final Integer skip = null; - final Integer maxpagesize = null; - return new PagedFlux<>( - () -> listByCatalogSinglePageAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize), - nextLink -> listByCatalogNextSinglePageAsync(nextLink)); - } - - /** - * List Image resources by Catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param filter Filter the result list using the given expression. - * @param top The number of result items to return. - * @param skip The number of result items to skip. - * @param maxpagesize The maximum number of result items per page. - * @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 of a Image list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByCatalogAsync(String resourceGroupName, String catalogName, String filter, - Integer top, Integer skip, Integer maxpagesize, Context context) { - return new PagedFlux<>( - () -> listByCatalogSinglePageAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context), - nextLink -> listByCatalogNextSinglePageAsync(nextLink, context)); - } + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByCatalogSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, @QueryParam("$skip") Integer skip, + @QueryParam("$maxpagesize") Integer maxpagesize, @PathParam("catalogName") String catalogName, + @HeaderParam("Accept") String accept, Context context); - /** - * List Image resources by Catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 of a Image list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByCatalog(String resourceGroupName, String catalogName) { - final String filter = null; - final Integer top = null; - final Integer skip = null; - final Integer maxpagesize = null; - return new PagedIterable<>(listByCatalogAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize)); - } + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByCatalogNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); - /** - * List Image resources by Catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param filter Filter the result list using the given expression. - * @param top The number of result items to return. - * @param skip The number of result items to skip. - * @param maxpagesize The maximum number of result items per page. - * @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 of a Image list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByCatalog(String resourceGroupName, String catalogName, String filter, - Integer top, Integer skip, Integer maxpagesize, Context context) { - return new PagedIterable<>( - listByCatalogAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByCatalogNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -324,24 +176,6 @@ public PagedIterable listByCatalog(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String catalogName, String imageName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (imageName == null) { - return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), @@ -349,45 +183,6 @@ private Mono> getWithResponseAsync(String resourceGroupName .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get a Image. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param imageName Image name. Use an image GUID for GA versions of the API. - * @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 Image along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String catalogName, - String imageName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (imageName == null) { - return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, catalogName, imageName, accept, context); - } - /** * Get a Image. * @@ -405,35 +200,16 @@ private Mono getAsync(String resourceGroupName, String catalogName, .flatMap(res -> Mono.justOrEmpty(res.getValue())); } - /** - * Get a Image. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param imageName Image name. Use an image GUID for GA versions of the API. - * @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 Image along with {@link Response}. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String catalogName, String imageName, Context context) { - return getWithResponseAsync(resourceGroupName, catalogName, imageName, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, catalogName, imageName, accept, context); } - /** - * Get a Image. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param imageName Image name. Use an image GUID for GA versions of the API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Image. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public ImageInner get(String resourceGroupName, String catalogName, String imageName) { return getWithResponse(resourceGroupName, catalogName, imageName, Context.NONE).getValue(); @@ -455,33 +231,12 @@ public ImageInner get(String resourceGroupName, String catalogName, String image @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String catalogName, String imageName, ImageInner 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 (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (imageName == null) { - return Mono.error(new IllegalArgumentException("Parameter imageName 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 contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, imageName, resource, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, catalogName, imageName, contentType, accept, + resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -492,43 +247,15 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param catalogName Name of catalog. * @param imageName Image name. Use an image GUID for GA versions of the API. * @param resource Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an image resource belonging to a catalog resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return an image resource belonging to a catalog resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String catalogName, String imageName, ImageInner 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 (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (imageName == null) { - return Mono.error(new IllegalArgumentException("Parameter imageName 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.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, imageName, resource, accept, context); + private Response createOrUpdateWithResponse(String resourceGroupName, String catalogName, + String imageName, ImageInner resource) { + return createOrUpdateWithResponse(resourceGroupName, catalogName, imageName, resource, Context.NONE); } /** @@ -538,18 +265,20 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param catalogName Name of catalog. * @param imageName Image name. Use an image GUID for GA versions of the API. * @param resource Resource create parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an image resource belonging to a catalog resource. + * @return an image resource belonging to a catalog resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ImageInner> beginCreateOrUpdateAsync(String resourceGroupName, - String catalogName, String imageName, ImageInner resource) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, catalogName, imageName, resource); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), ImageInner.class, - ImageInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String catalogName, + String imageName, ImageInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, imageName, contentType, accept, resource, + context); } /** @@ -559,7 +288,6 @@ private PollerFlux, ImageInner> beginCreateOrUpdateAsync( * @param catalogName Name of catalog. * @param imageName Image name. Use an image GUID for GA versions of the API. * @param resource Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -567,50 +295,27 @@ private PollerFlux, ImageInner> beginCreateOrUpdateAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ImageInner> beginCreateOrUpdateAsync(String resourceGroupName, - String catalogName, String imageName, ImageInner resource, Context context) { - context = this.client.mergeContext(context); + String catalogName, String imageName, ImageInner resource) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, catalogName, imageName, resource, context); + = createOrUpdateWithResponseAsync(resourceGroupName, catalogName, imageName, resource); return this.client.getLroResult(mono, this.client.getHttpPipeline(), ImageInner.class, - ImageInner.class, context); + ImageInner.class, this.client.getContext()); } - /** - * Create a Image. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param imageName Image name. Use an image GUID for GA versions of the API. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an image resource belonging to a catalog resource. - */ + @Override @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ImageInner> beginCreateOrUpdate(String resourceGroupName, String catalogName, String imageName, ImageInner resource) { - return this.beginCreateOrUpdateAsync(resourceGroupName, catalogName, imageName, resource).getSyncPoller(); + return beginCreateOrUpdate(resourceGroupName, catalogName, imageName, resource, Context.NONE); } - /** - * Create a Image. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param imageName Image name. Use an image GUID for GA versions of the API. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an image resource belonging to a catalog resource. - */ + @Override @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ImageInner> beginCreateOrUpdate(String resourceGroupName, String catalogName, String imageName, ImageInner resource, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, catalogName, imageName, resource, context) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, catalogName, imageName, resource, context); + return this.client.getLroResult(response, ImageInner.class, ImageInner.class, context); } /** @@ -632,61 +337,19 @@ private Mono createOrUpdateAsync(String resourceGroupName, String ca .flatMap(this.client::getLroFinalResultOrError); } - /** - * Create a Image. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param imageName Image name. Use an image GUID for GA versions of the API. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an image resource belonging to a catalog resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String catalogName, String imageName, - ImageInner resource, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, catalogName, imageName, resource, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create a Image. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param imageName Image name. Use an image GUID for GA versions of the API. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an image resource belonging to a catalog resource. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public ImageInner createOrUpdate(String resourceGroupName, String catalogName, String imageName, ImageInner resource) { - return createOrUpdateAsync(resourceGroupName, catalogName, imageName, resource).block(); + return createOrUpdate(resourceGroupName, catalogName, imageName, resource, Context.NONE); } - /** - * Create a Image. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param imageName Image name. Use an image GUID for GA versions of the API. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an image resource belonging to a catalog resource. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public ImageInner createOrUpdate(String resourceGroupName, String catalogName, String imageName, ImageInner resource, Context context) { - return createOrUpdateAsync(resourceGroupName, catalogName, imageName, resource, context).block(); + return this.client.getLroFinalResultOrError( + beginCreateOrUpdate(resourceGroupName, catalogName, imageName, resource, context)); } /** @@ -703,28 +366,9 @@ public ImageInner createOrUpdate(String resourceGroupName, String catalogName, S @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String catalogName, String imageName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (imageName == null) { - return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, imageName, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, catalogName, imageName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -734,37 +378,14 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param imageName Image name. Use an image GUID for GA versions of the API. - * @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 {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String catalogName, - String imageName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (imageName == null) { - return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, catalogName, imageName, accept, context); + private Response deleteWithResponse(String resourceGroupName, String catalogName, String imageName) { + return deleteWithResponse(resourceGroupName, catalogName, imageName, Context.NONE); } /** @@ -773,17 +394,17 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param imageName Image name. Use an image GUID for GA versions of the API. + * @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 {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String catalogName, - String imageName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, catalogName, imageName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String catalogName, String imageName, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, imageName, context); } /** @@ -792,7 +413,6 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param imageName Image name. Use an image GUID for GA versions of the API. - * @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. @@ -800,12 +420,25 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String catalogName, - String imageName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, catalogName, imageName, context); + String imageName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, catalogName, imageName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); + } + + @Override + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, + String imageName) { + return beginDelete(resourceGroupName, catalogName, imageName, Context.NONE); + } + + @Override + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, + String imageName, Context context) { + Response response = deleteWithResponse(resourceGroupName, catalogName, imageName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -817,96 +450,160 @@ private PollerFlux, Void> beginDeleteAsync(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 the {@link SyncPoller} for polling of long-running operation. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, - String imageName) { - return this.beginDeleteAsync(resourceGroupName, catalogName, imageName).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String catalogName, String imageName) { + return beginDeleteAsync(resourceGroupName, catalogName, imageName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + @Override + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String catalogName, String imageName) { + delete(resourceGroupName, catalogName, imageName, Context.NONE); + } + + @Override + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String catalogName, String imageName, Context context) { + this.client.getLroFinalResultOrError(beginDelete(resourceGroupName, catalogName, imageName, context)); } /** - * Delete a Image. + * List Image resources by Catalog. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use an image GUID for GA versions of the API. - * @param context The context to associate with this operation. + * @param filter Filter the result list using the given expression. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @param maxpagesize The maximum number of result items per page. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 {@link SyncPoller} for polling of long-running operation. + * @return the response of a Image list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, - String imageName, Context context) { - return this.beginDeleteAsync(resourceGroupName, catalogName, imageName, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByCatalogSinglePageAsync(String resourceGroupName, String catalogName, + String filter, Integer top, Integer skip, Integer maxpagesize) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByCatalog(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, top, skip, maxpagesize, catalogName, 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())); } /** - * Delete a Image. + * List Image resources by Catalog. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use an image GUID for GA versions of the API. + * @param filter Filter the result list using the given expression. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @param maxpagesize The maximum number of result items per page. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 {@link Mono} that completes when a successful response is received. + * @return the response of a Image list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String catalogName, String imageName) { - return beginDeleteAsync(resourceGroupName, catalogName, imageName).last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByCatalogAsync(String resourceGroupName, String catalogName, String filter, + Integer top, Integer skip, Integer maxpagesize) { + return new PagedFlux<>( + () -> listByCatalogSinglePageAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize), + nextLink -> listByCatalogNextSinglePageAsync(nextLink)); } /** - * Delete a Image. + * List Image resources by Catalog. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use an image GUID for GA versions of the API. - * @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 {@link Mono} that completes when a successful response is received. + * @return the response of a Image list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String catalogName, String imageName, Context context) { - return beginDeleteAsync(resourceGroupName, catalogName, imageName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByCatalogAsync(String resourceGroupName, String catalogName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final Integer maxpagesize = null; + return new PagedFlux<>( + () -> listByCatalogSinglePageAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize), + nextLink -> listByCatalogNextSinglePageAsync(nextLink)); } /** - * Delete a Image. + * List Image resources by Catalog. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use an image GUID for GA versions of the API. + * @param filter Filter the result list using the given expression. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @param maxpagesize The maximum number of result items per page. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 of a Image list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String catalogName, String imageName) { - deleteAsync(resourceGroupName, catalogName, imageName).block(); + private PagedResponse listByCatalogSinglePage(String resourceGroupName, String catalogName, + String filter, Integer top, Integer skip, Integer maxpagesize) { + return listByCatalogSinglePage(resourceGroupName, catalogName, filter, top, skip, maxpagesize, Context.NONE); } /** - * Delete a Image. + * List Image resources by Catalog. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use an image GUID for GA versions of the API. + * @param filter Filter the result list using the given expression. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @param maxpagesize The maximum number of result items per page. * @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 of a Image list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String catalogName, String imageName, Context context) { - deleteAsync(resourceGroupName, catalogName, imageName, context).block(); + private PagedResponse listByCatalogSinglePage(String resourceGroupName, String catalogName, + String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { + final String accept = "application/json"; + Response res = service.listByCatalogSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, filter, top, skip, + maxpagesize, catalogName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + @Override + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCatalog(String resourceGroupName, String catalogName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final Integer maxpagesize = null; + return listByCatalog(resourceGroupName, catalogName, filter, top, skip, maxpagesize, Context.NONE); + } + + @Override + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCatalog(String resourceGroupName, String catalogName, String filter, + Integer top, Integer skip, Integer maxpagesize, Context context) { + return new PagedIterable<>( + () -> listByCatalogSinglePage(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context), + nextLink -> listByCatalogNextSinglePage(nextLink, context)); } /** @@ -921,13 +618,6 @@ public void delete(String resourceGroupName, String catalogName, String imageNam */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByCatalogNextSinglePageAsync(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.listByCatalogNext(nextLink, this.client.getEndpoint(), accept, context)) @@ -936,6 +626,20 @@ private Mono> listByCatalogNextSinglePageAsync(String .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 of a Image list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByCatalogNextSinglePage(String nextLink) { + return listByCatalogNextSinglePage(nextLink, Context.NONE); + } + /** * Get the next page of items. * @@ -944,22 +648,14 @@ private Mono> listByCatalogNextSinglePageAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 of a Image list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a Image list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCatalogNextSinglePageAsync(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.")); - } + private PagedResponse listByCatalogNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByCatalogNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByCatalogNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ImagesImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ImagesImpl.java index 450f24897a16c..eb91d47995259 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ImagesImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ImagesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.implementation; @@ -26,28 +26,12 @@ public ImagesImpl(ImagesClient innerClient, com.azure.resourcemanager.sphere.Azu this.serviceManager = serviceManager; } - public PagedIterable listByCatalog(String resourceGroupName, String catalogName) { - PagedIterable inner = this.serviceClient().listByCatalog(resourceGroupName, catalogName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ImageImpl(inner1, this.manager())); - } - - public PagedIterable listByCatalog(String resourceGroupName, String catalogName, String filter, Integer top, - Integer skip, Integer maxpagesize, Context context) { - PagedIterable inner = this.serviceClient() - .listByCatalog(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ImageImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String catalogName, String imageName, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, catalogName, imageName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ImageImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ImageImpl(inner.getValue(), this.manager())); } public Image get(String resourceGroupName, String catalogName, String imageName) { @@ -60,86 +44,56 @@ public Image get(String resourceGroupName, String catalogName, String imageName) } public void delete(String resourceGroupName, String catalogName, String imageName) { - this.serviceClient().delete(resourceGroupName, catalogName, imageName); + this.delete(resourceGroupName, catalogName, imageName, Context.NONE); } public void delete(String resourceGroupName, String catalogName, String imageName, Context context) { this.serviceClient().delete(resourceGroupName, catalogName, imageName, context); } + public PagedIterable listByCatalog(String resourceGroupName, String catalogName) { + PagedIterable inner = this.serviceClient().listByCatalog(resourceGroupName, catalogName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ImageImpl(inner1, this.manager())); + } + + public PagedIterable listByCatalog(String resourceGroupName, String catalogName, String filter, Integer top, + Integer skip, Integer maxpagesize, Context context) { + PagedIterable inner = this.serviceClient() + .listByCatalog(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ImageImpl(inner1, this.manager())); + } + public Image getById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); - if (catalogName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); - } - String imageName = ResourceManagerUtils.getValueFromIdByName(id, "images"); - if (imageName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'images'.", id))); - } - return this.getWithResponse(resourceGroupName, catalogName, imageName, Context.NONE).getValue(); + return this.getByIdWithResponse(id, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); - if (catalogName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); - } - String imageName = ResourceManagerUtils.getValueFromIdByName(id, "images"); - if (imageName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'images'.", id))); - } + String resourceGroupName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}", + "resourceGroupName", "resourceGroups", LOGGER); + String catalogName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}", + "catalogName", "catalogs", LOGGER); + String imageName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}", + "imageName", "images", LOGGER); return this.getWithResponse(resourceGroupName, catalogName, imageName, context); } public void deleteById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); - if (catalogName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); - } - String imageName = ResourceManagerUtils.getValueFromIdByName(id, "images"); - if (imageName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'images'.", id))); - } - this.delete(resourceGroupName, catalogName, imageName, Context.NONE); + this.deleteByIdWithResponse(id, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); - if (catalogName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); - } - String imageName = ResourceManagerUtils.getValueFromIdByName(id, "images"); - if (imageName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'images'.", id))); - } + String resourceGroupName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}", + "resourceGroupName", "resourceGroups", LOGGER); + String catalogName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}", + "catalogName", "catalogs", LOGGER); + String imageName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}", + "imageName", "images", LOGGER); this.delete(resourceGroupName, catalogName, imageName, context); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/OperationImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/OperationImpl.java index eb1c440b1b195..c95d910554749 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/OperationImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/OperationImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.implementation; diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/OperationsClientImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/OperationsClientImpl.java index eae41a5cbab2a..6ab1959aead78 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/OperationsClientImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/OperationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.sphere.fluent.OperationsClient; import com.azure.resourcemanager.sphere.fluent.models.OperationInner; -import com.azure.resourcemanager.sphere.models.OperationListResult; +import com.azure.resourcemanager.sphere.implementation.models.OperationListResult; import reactor.core.publisher.Mono; /** @@ -42,31 +42,38 @@ public final class OperationsClientImpl implements OperationsClient { /** * The service client containing this operation class. */ - private final AzureSphereMgmtClientImpl client; + private final AzureSphereManagementClientImpl client; /** * Initializes an instance of OperationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - OperationsClientImpl(AzureSphereMgmtClientImpl client) { + OperationsClientImpl(AzureSphereManagementClientImpl client) { this.service = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureSphereMgmtClientOperations to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for AzureSphereManagementClientOperations to be used by the proxy service + * to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "AzureSphereMgmtClien") + @Host("{endpoint}") + @ServiceInterface(name = "AzureSphereManagementClientOperations") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.AzureSphere/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.AzureSphere/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -74,7 +81,14 @@ Mono> list(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -87,10 +101,6 @@ Mono> listNext(@PathParam(value = "nextLink", enco */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -100,29 +110,6 @@ private Mono> listSinglePageAsync() { .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * List the operations for the provider. - * - * @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 list of REST API operations supported by an Azure Resource Provider 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - /** * List the operations for the provider. * @@ -139,45 +126,43 @@ private PagedFlux listAsync() { /** * List the operations for the provider. * - * @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 list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + return listSinglePage(Context.NONE); } /** * List the operations for the provider. * + * @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 list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + @Override @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return list(Context.NONE); } - /** - * List the operations for the provider. - * - * @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 list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedIterable}. - */ + @Override @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -192,13 +177,6 @@ public PagedIterable list(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), @@ -206,6 +184,20 @@ private Mono> listNextSinglePageAsync(String nextL .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + return listNextSinglePage(nextLink, Context.NONE); + } + /** * Get the next page of items. * @@ -214,22 +206,13 @@ 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 a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/OperationsImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/OperationsImpl.java index c9356b30c78ae..9e768ec9e5c30 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/OperationsImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/OperationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.implementation; @@ -26,8 +26,7 @@ public OperationsImpl(OperationsClient innerClient, } public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + return this.list(Context.NONE); } public PagedIterable list(Context context) { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ProductImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ProductImpl.java index aefce312d2e8c..84e9e37c2f2b6 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ProductImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ProductImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.implementation; @@ -68,10 +68,7 @@ public ProductImpl withExistingCatalog(String resourceGroupName, String catalogN } public Product create() { - this.innerObject = serviceManager.serviceClient() - .getProducts() - .createOrUpdate(resourceGroupName, catalogName, productName, this.innerModel(), Context.NONE); - return this; + return this.create(Context.NONE); } public Product create(Context context) { @@ -93,10 +90,7 @@ public ProductImpl update() { } public Product apply() { - this.innerObject = serviceManager.serviceClient() - .getProducts() - .update(resourceGroupName, catalogName, productName, updateProperties, Context.NONE); - return this; + return this.apply(Context.NONE); } public Product apply(Context context) { @@ -109,17 +103,19 @@ public Product apply(Context context) { ProductImpl(ProductInner innerObject, com.azure.resourcemanager.sphere.AzureSphereManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.catalogName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "catalogs"); - this.productName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "products"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}", + "resourceGroupName"); + this.catalogName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}", + "catalogName"); + this.productName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}", + "productName"); } public Product refresh() { - this.innerObject = serviceManager.serviceClient() - .getProducts() - .getWithResponse(resourceGroupName, catalogName, productName, Context.NONE) - .getValue(); - return this; + return this.refresh(Context.NONE); } public Product refresh(Context context) { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ProductsClientImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ProductsClientImpl.java index 05dd6d79d4f5f..b49cb36262b9c 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ProductsClientImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ProductsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.implementation; @@ -29,6 +29,7 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; @@ -37,8 +38,8 @@ import com.azure.resourcemanager.sphere.fluent.models.CountDevicesResponseInner; import com.azure.resourcemanager.sphere.fluent.models.DeviceGroupInner; import com.azure.resourcemanager.sphere.fluent.models.ProductInner; -import com.azure.resourcemanager.sphere.models.DeviceGroupListResult; -import com.azure.resourcemanager.sphere.models.ProductListResult; +import com.azure.resourcemanager.sphere.implementation.models.DeviceGroupListResult; +import com.azure.resourcemanager.sphere.implementation.models.ProductListResult; import com.azure.resourcemanager.sphere.models.ProductUpdate; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -56,68 +57,124 @@ public final class ProductsClientImpl implements ProductsClient { /** * The service client containing this operation class. */ - private final AzureSphereMgmtClientImpl client; + private final AzureSphereManagementClientImpl client; /** * Initializes an instance of ProductsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ProductsClientImpl(AzureSphereMgmtClientImpl client) { + ProductsClientImpl(AzureSphereManagementClientImpl client) { this.service = RestProxy.create(ProductsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureSphereMgmtClientProducts to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for AzureSphereManagementClientProducts to be used by the proxy service + * to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "AzureSphereMgmtClien") + @Host("{endpoint}") + @ServiceInterface(name = "AzureSphereManagementClientProducts") public interface ProductsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByCatalog(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, - @HeaderParam("Accept") String accept, Context context); + @PathParam("productName") String productName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, @PathParam("productName") String productName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, - @PathParam("productName") String productName, @BodyParam("application/json") ProductInner resource, - @HeaderParam("Accept") String accept, Context context); + @PathParam("productName") String productName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ProductInner resource, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ProductInner resource, + Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, + Mono>> update(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, - @PathParam("productName") String productName, @BodyParam("application/json") ProductUpdate properties, - @HeaderParam("Accept") String accept, Context context); + @PathParam("productName") String productName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ProductUpdate properties, + Context context); - @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ProductUpdate properties, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByCatalog(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByCatalogSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/countDevices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> countDevices(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, @PathParam("productName") String productName, @HeaderParam("Accept") String accept, Context context); @@ -126,7 +183,16 @@ Mono>> delete(@HostParam("$host") String endpoint, @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/countDevices") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> countDevices(@HostParam("$host") String endpoint, + Response countDevicesSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/generateDefaultDeviceGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> generateDefaultDeviceGroups(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, @PathParam("productName") String productName, @HeaderParam("Accept") String accept, Context context); @@ -135,7 +201,7 @@ Mono> countDevices(@HostParam("$host") Strin @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/generateDefaultDeviceGroups") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> generateDefaultDeviceGroups(@HostParam("$host") String endpoint, + Response generateDefaultDeviceGroupsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, @PathParam("productName") String productName, @HeaderParam("Accept") String accept, Context context); @@ -145,157 +211,32 @@ Mono> generateDefaultDeviceGroups(@HostParam("$h @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByCatalogNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> generateDefaultDeviceGroupsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Response listByCatalogNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * List Product resources by Catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 of a Product list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCatalogSinglePageAsync(String resourceGroupName, - String catalogName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByCatalog(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, 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())); - } - /** - * List Product resources by Catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @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 of a Product list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCatalogSinglePageAsync(String resourceGroupName, String catalogName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByCatalog(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, catalogName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List Product resources by Catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 of a Product list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByCatalogAsync(String resourceGroupName, String catalogName) { - return new PagedFlux<>(() -> listByCatalogSinglePageAsync(resourceGroupName, catalogName), - nextLink -> listByCatalogNextSinglePageAsync(nextLink)); - } - - /** - * List Product resources by Catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @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 of a Product list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByCatalogAsync(String resourceGroupName, String catalogName, Context context) { - return new PagedFlux<>(() -> listByCatalogSinglePageAsync(resourceGroupName, catalogName, context), - nextLink -> listByCatalogNextSinglePageAsync(nextLink, context)); - } - - /** - * List Product resources by Catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 of a Product list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByCatalog(String resourceGroupName, String catalogName) { - return new PagedIterable<>(listByCatalogAsync(resourceGroupName, catalogName)); - } + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> generateDefaultDeviceGroupsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); - /** - * List Product resources by Catalog. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @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 of a Product list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByCatalog(String resourceGroupName, String catalogName, Context context) { - return new PagedIterable<>(listByCatalogAsync(resourceGroupName, catalogName, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response generateDefaultDeviceGroupsNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -312,24 +253,6 @@ public PagedIterable listByCatalog(String resourceGroupName, Strin @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String catalogName, String productName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), @@ -337,45 +260,6 @@ private Mono> getWithResponseAsync(String resourceGroupNa .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Product along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String catalogName, - String productName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, catalogName, productName, accept, context); - } - /** * Get a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. * @@ -393,35 +277,16 @@ private Mono getAsync(String resourceGroupName, String catalogName .flatMap(res -> Mono.justOrEmpty(res.getValue())); } - /** - * Get a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Product along with {@link Response}. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String catalogName, String productName, Context context) { - return getWithResponseAsync(resourceGroupName, catalogName, productName, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, catalogName, productName, accept, context); } - /** - * Get a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of 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 a Product. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public ProductInner get(String resourceGroupName, String catalogName, String productName) { return getWithResponse(resourceGroupName, catalogName, productName, Context.NONE).getValue(); @@ -437,40 +302,18 @@ public ProductInner get(String resourceGroupName, String catalogName, String pro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an product resource belonging to a catalog resource along with {@link Response} on successful completion + * @return a product resource belonging to a catalog resource along with {@link Response} on successful completion * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String catalogName, String productName, ProductInner 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 (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName 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 contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, resource, accept, - context)) + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, contentType, accept, + resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -481,43 +324,15 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param catalogName Name of catalog. * @param productName Name of product. * @param resource Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an product resource belonging to a catalog resource along with {@link Response} on successful completion - * of {@link Mono}. + * @return a product resource belonging to a catalog resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String catalogName, String productName, ProductInner 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 (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName 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.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, resource, accept, context); + private Response createOrUpdateWithResponse(String resourceGroupName, String catalogName, + String productName, ProductInner resource) { + return createOrUpdateWithResponse(resourceGroupName, catalogName, productName, resource, Context.NONE); } /** @@ -527,18 +342,20 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param catalogName Name of catalog. * @param productName Name of product. * @param resource Resource create parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an product resource belonging to a catalog resource. + * @return a product resource belonging to a catalog resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ProductInner> beginCreateOrUpdateAsync(String resourceGroupName, - String catalogName, String productName, ProductInner resource) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, catalogName, productName, resource); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ProductInner.class, ProductInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String catalogName, + String productName, ProductInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, contentType, accept, resource, + context); } /** @@ -548,58 +365,35 @@ private PollerFlux, ProductInner> beginCreateOrUpdateAs * @param catalogName Name of catalog. * @param productName Name of product. * @param resource Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an product resource belonging to a catalog resource. + * @return the {@link PollerFlux} for polling of a product resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ProductInner> beginCreateOrUpdateAsync(String resourceGroupName, - String catalogName, String productName, ProductInner resource, Context context) { - context = this.client.mergeContext(context); + String catalogName, String productName, ProductInner resource) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, catalogName, productName, resource, context); + = createOrUpdateWithResponseAsync(resourceGroupName, catalogName, productName, resource); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ProductInner.class, ProductInner.class, context); + ProductInner.class, ProductInner.class, this.client.getContext()); } - /** - * Create a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an product resource belonging to a catalog resource. - */ + @Override @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ProductInner> beginCreateOrUpdate(String resourceGroupName, String catalogName, String productName, ProductInner resource) { - return this.beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, resource).getSyncPoller(); + return beginCreateOrUpdate(resourceGroupName, catalogName, productName, resource, Context.NONE); } - /** - * Create a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an product resource belonging to a catalog resource. - */ + @Override @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ProductInner> beginCreateOrUpdate(String resourceGroupName, String catalogName, String productName, ProductInner resource, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, resource, context) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, catalogName, productName, resource, context); + return this.client.getLroResult(response, ProductInner.class, ProductInner.class, + context); } /** @@ -612,7 +406,7 @@ public SyncPoller, ProductInner> beginCreateOrUpdate(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 an product resource belonging to a catalog resource on successful completion of {@link Mono}. + * @return a product resource belonging to a catalog resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String catalogName, String productName, @@ -621,106 +415,19 @@ private Mono createOrUpdateAsync(String resourceGroupName, String .flatMap(this.client::getLroFinalResultOrError); } - /** - * Create a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an product resource belonging to a catalog resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String catalogName, String productName, - ProductInner resource, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, resource, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an product resource belonging to a catalog resource. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public ProductInner createOrUpdate(String resourceGroupName, String catalogName, String productName, ProductInner resource) { - return createOrUpdateAsync(resourceGroupName, catalogName, productName, resource).block(); + return createOrUpdate(resourceGroupName, catalogName, productName, resource, Context.NONE); } - /** - * Create a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an product resource belonging to a catalog resource. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public ProductInner createOrUpdate(String resourceGroupName, String catalogName, String productName, ProductInner resource, Context context) { - return createOrUpdateAsync(resourceGroupName, catalogName, productName, resource, context).block(); - } - - /** - * Update a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param properties The resource properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an product resource belonging to a catalog resource along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String catalogName, - String productName, ProductUpdate properties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, properties, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + return this.client.getLroFinalResultOrError( + beginCreateOrUpdate(resourceGroupName, catalogName, productName, resource, context)); } /** @@ -730,124 +437,22 @@ private Mono>> updateWithResponseAsync(String resource * @param catalogName Name of catalog. * @param productName Name of product. * @param properties The resource properties to be updated. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an product resource belonging to a catalog resource along with {@link Response} on successful completion + * @return a product resource belonging to a catalog resource along with {@link Response} on successful completion * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String catalogName, - String productName, ProductUpdate properties, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, catalogName, productName, properties, accept, context); - } - - /** - * Update a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param properties The resource properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 {@link PollerFlux} for polling of an product resource belonging to a catalog resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ProductInner> beginUpdateAsync(String resourceGroupName, - String catalogName, String productName, ProductUpdate properties) { - Mono>> mono - = updateWithResponseAsync(resourceGroupName, catalogName, productName, properties); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ProductInner.class, ProductInner.class, this.client.getContext()); - } - - /** - * Update a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param properties The resource properties to be updated. - * @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 {@link PollerFlux} for polling of an product resource belonging to a catalog resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ProductInner> beginUpdateAsync(String resourceGroupName, - String catalogName, String productName, ProductUpdate properties, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = updateWithResponseAsync(resourceGroupName, catalogName, productName, properties, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ProductInner.class, ProductInner.class, context); - } - - /** - * Update a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param properties The resource properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 {@link SyncPoller} for polling of an product resource belonging to a catalog resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ProductInner> beginUpdate(String resourceGroupName, String catalogName, String productName, ProductUpdate properties) { - return this.beginUpdateAsync(resourceGroupName, catalogName, productName, properties).getSyncPoller(); - } - - /** - * Update a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param properties The resource properties to be updated. - * @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 {@link SyncPoller} for polling of an product resource belonging to a catalog resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ProductInner> beginUpdate(String resourceGroupName, String catalogName, - String productName, ProductUpdate properties, Context context) { - return this.beginUpdateAsync(resourceGroupName, catalogName, productName, properties, context).getSyncPoller(); + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, contentType, accept, + properties, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -860,13 +465,12 @@ public SyncPoller, ProductInner> beginUpdate(String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an product resource belonging to a catalog resource on successful completion of {@link Mono}. + * @return a product resource belonging to a catalog resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String catalogName, String productName, + private Response updateWithResponse(String resourceGroupName, String catalogName, String productName, ProductUpdate properties) { - return beginUpdateAsync(resourceGroupName, catalogName, productName, properties).last() - .flatMap(this.client::getLroFinalResultOrError); + return updateWithResponse(resourceGroupName, catalogName, productName, properties, Context.NONE); } /** @@ -880,13 +484,16 @@ private Mono updateAsync(String resourceGroupName, String catalogN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an product resource belonging to a catalog resource on successful completion of {@link Mono}. + * @return a product resource belonging to a catalog resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String catalogName, String productName, + private Response updateWithResponse(String resourceGroupName, String catalogName, String productName, ProductUpdate properties, Context context) { - return beginUpdateAsync(resourceGroupName, catalogName, productName, properties, context).last() - .flatMap(this.client::getLroFinalResultOrError); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, contentType, accept, + properties, context); } /** @@ -899,12 +506,32 @@ private Mono updateAsync(String resourceGroupName, String catalogN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an product resource belonging to a catalog resource. + * @return the {@link PollerFlux} for polling of a product resource belonging to a catalog resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProductInner update(String resourceGroupName, String catalogName, String productName, - ProductUpdate properties) { - return updateAsync(resourceGroupName, catalogName, productName, properties).block(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProductInner> beginUpdateAsync(String resourceGroupName, + String catalogName, String productName, ProductUpdate properties) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, catalogName, productName, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ProductInner.class, ProductInner.class, this.client.getContext()); + } + + @Override + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProductInner> beginUpdate(String resourceGroupName, String catalogName, + String productName, ProductUpdate properties) { + return beginUpdate(resourceGroupName, catalogName, productName, properties, Context.NONE); + } + + @Override + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProductInner> beginUpdate(String resourceGroupName, String catalogName, + String productName, ProductUpdate properties, Context context) { + Response response + = updateWithResponse(resourceGroupName, catalogName, productName, properties, context); + return this.client.getLroResult(response, ProductInner.class, ProductInner.class, + context); } /** @@ -914,16 +541,31 @@ public ProductInner update(String resourceGroupName, String catalogName, String * @param catalogName Name of catalog. * @param productName Name of product. * @param properties The resource properties to be updated. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an product resource belonging to a catalog resource. + * @return a product resource belonging to a catalog resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String catalogName, String productName, + ProductUpdate properties) { + return beginUpdateAsync(resourceGroupName, catalogName, productName, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + @Override + @ServiceMethod(returns = ReturnType.SINGLE) + public ProductInner update(String resourceGroupName, String catalogName, String productName, + ProductUpdate properties) { + return update(resourceGroupName, catalogName, productName, properties, Context.NONE); + } + + @Override + @ServiceMethod(returns = ReturnType.SINGLE) public ProductInner update(String resourceGroupName, String catalogName, String productName, ProductUpdate properties, Context context) { - return updateAsync(resourceGroupName, catalogName, productName, properties, context).block(); + return this.client + .getLroFinalResultOrError(beginUpdate(resourceGroupName, catalogName, productName, properties, context)); } /** @@ -940,28 +582,9 @@ public ProductInner update(String resourceGroupName, String catalogName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String catalogName, String productName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -971,37 +594,14 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String catalogName, - String productName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, catalogName, productName, accept, context); + private Response deleteWithResponse(String resourceGroupName, String catalogName, String productName) { + return deleteWithResponse(resourceGroupName, catalogName, productName, Context.NONE); } /** @@ -1010,17 +610,17 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String catalogName, - String productName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, catalogName, productName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String catalogName, String productName, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, context); } /** @@ -1029,7 +629,6 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1037,47 +636,25 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String catalogName, - String productName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, catalogName, productName, context); + String productName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, catalogName, productName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } - /** - * Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name'. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ + @Override @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, String productName) { - return this.beginDeleteAsync(resourceGroupName, catalogName, productName).getSyncPoller(); + return beginDelete(resourceGroupName, catalogName, productName, Context.NONE); } - /** - * Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name'. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ + @Override @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, String productName, Context context) { - return this.beginDeleteAsync(resourceGroupName, catalogName, productName, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, catalogName, productName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -1097,94 +674,105 @@ private Mono deleteAsync(String resourceGroupName, String catalogName, Str .flatMap(this.client::getLroFinalResultOrError); } + @Override + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String catalogName, String productName) { + delete(resourceGroupName, catalogName, productName, Context.NONE); + } + + @Override + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String catalogName, String productName, Context context) { + this.client.getLroFinalResultOrError(beginDelete(resourceGroupName, catalogName, productName, context)); + } + /** - * Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name'. + * List Product resources by Catalog. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param productName Name of product. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the response of a Product list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String catalogName, String productName, Context context) { - return beginDeleteAsync(resourceGroupName, catalogName, productName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono> listByCatalogSinglePageAsync(String resourceGroupName, + String catalogName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByCatalog(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, 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())); } /** - * Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name'. + * List Product resources by Catalog. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param productName Name of product. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Product list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String catalogName, String productName) { - deleteAsync(resourceGroupName, catalogName, productName).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByCatalogAsync(String resourceGroupName, String catalogName) { + return new PagedFlux<>(() -> listByCatalogSinglePageAsync(resourceGroupName, catalogName), + nextLink -> listByCatalogNextSinglePageAsync(nextLink)); } /** - * Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name'. + * List Product resources by Catalog. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param productName Name of product. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Product list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String catalogName, String productName, Context context) { - deleteAsync(resourceGroupName, catalogName, productName, context).block(); + private PagedResponse listByCatalogSinglePage(String resourceGroupName, String catalogName) { + return listByCatalogSinglePage(resourceGroupName, catalogName, Context.NONE); } /** - * Counts devices in product. '.default' and '.unassigned' are system defined values and cannot be used for product - * name. + * List Product resources by Catalog. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param productName Name of product. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response to the action call for count devices in a catalog along with {@link Response} on successful - * completion of {@link Mono}. + * @return the response of a Product list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> countDevicesWithResponseAsync(String resourceGroupName, - String catalogName, String productName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } + private PagedResponse listByCatalogSinglePage(String resourceGroupName, String catalogName, + Context context) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.countDevices(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response res + = service.listByCatalogSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + @Override + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCatalog(String resourceGroupName, String catalogName) { + return listByCatalog(resourceGroupName, catalogName, Context.NONE); + } + + @Override + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCatalog(String resourceGroupName, String catalogName, Context context) { + return new PagedIterable<>(() -> listByCatalogSinglePage(resourceGroupName, catalogName, context), + nextLink -> listByCatalogNextSinglePage(nextLink, context)); } /** @@ -1194,7 +782,6 @@ private Mono> countDevicesWithResponseAsync( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1203,29 +790,12 @@ private Mono> countDevicesWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> countDevicesWithResponseAsync(String resourceGroupName, - String catalogName, String productName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } + String catalogName, String productName) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.countDevices(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, accept, context); + return FluxUtil + .withContext(context -> service.countDevices(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1247,37 +817,16 @@ private Mono countDevicesAsync(String resourceGroupNa .flatMap(res -> Mono.justOrEmpty(res.getValue())); } - /** - * Counts devices in product. '.default' and '.unassigned' are system defined values and cannot be used for product - * name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response to the action call for count devices in a catalog along with {@link Response}. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public Response countDevicesWithResponse(String resourceGroupName, String catalogName, String productName, Context context) { - return countDevicesWithResponseAsync(resourceGroupName, catalogName, productName, context).block(); + final String accept = "application/json"; + return service.countDevicesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, accept, context); } - /** - * Counts devices in product. '.default' and '.unassigned' are system defined values and cannot be used for product - * name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of 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 response to the action call for count devices in a catalog. - */ + @Override @ServiceMethod(returns = ReturnType.SINGLE) public CountDevicesResponseInner countDevices(String resourceGroupName, String catalogName, String productName) { return countDevicesWithResponse(resourceGroupName, catalogName, productName, Context.NONE).getValue(); @@ -1299,24 +848,6 @@ public CountDevicesResponseInner countDevices(String resourceGroupName, String c @ServiceMethod(returns = ReturnType.SINGLE) private Mono> generateDefaultDeviceGroupsSinglePageAsync(String resourceGroupName, String catalogName, String productName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -1327,50 +858,6 @@ private Mono> generateDefaultDeviceGroupsSingleP .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Generates default device groups for the product. '.default' and '.unassigned' are system defined values and - * cannot be used for product name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DeviceGroup list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> generateDefaultDeviceGroupsSinglePageAsync(String resourceGroupName, - String catalogName, String productName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (catalogName == null) { - return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .generateDefaultDeviceGroups(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - /** * Generates default device groups for the product. '.default' and '.unassigned' are system defined values and * cannot be used for product name. @@ -1398,18 +885,15 @@ private PagedFlux generateDefaultDeviceGroupsAsync(String reso * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DeviceGroup list operation as paginated response with {@link PagedFlux}. + * @return the response of a DeviceGroup list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux generateDefaultDeviceGroupsAsync(String resourceGroupName, String catalogName, - String productName, Context context) { - return new PagedFlux<>( - () -> generateDefaultDeviceGroupsSinglePageAsync(resourceGroupName, catalogName, productName, context), - nextLink -> generateDefaultDeviceGroupsNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse generateDefaultDeviceGroupsSinglePage(String resourceGroupName, + String catalogName, String productName) { + return generateDefaultDeviceGroupsSinglePage(resourceGroupName, catalogName, productName, Context.NONE); } /** @@ -1419,35 +903,37 @@ private PagedFlux generateDefaultDeviceGroupsAsync(String reso * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DeviceGroup list operation as paginated response with {@link PagedIterable}. + * @return the response of a DeviceGroup list operation along with {@link PagedResponse}. */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse generateDefaultDeviceGroupsSinglePage(String resourceGroupName, + String catalogName, String productName, Context context) { + final String accept = "application/json"; + Response res + = service.generateDefaultDeviceGroupsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + @Override @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable generateDefaultDeviceGroups(String resourceGroupName, String catalogName, String productName) { - return new PagedIterable<>(generateDefaultDeviceGroupsAsync(resourceGroupName, catalogName, productName)); + return generateDefaultDeviceGroups(resourceGroupName, catalogName, productName, Context.NONE); } - /** - * Generates default device groups for the product. '.default' and '.unassigned' are system defined values and - * cannot be used for product name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DeviceGroup list operation as paginated response with {@link PagedIterable}. - */ + @Override @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable generateDefaultDeviceGroups(String resourceGroupName, String catalogName, String productName, Context context) { return new PagedIterable<>( - generateDefaultDeviceGroupsAsync(resourceGroupName, catalogName, productName, context)); + () -> generateDefaultDeviceGroupsSinglePage(resourceGroupName, catalogName, productName, context), + nextLink -> generateDefaultDeviceGroupsNextSinglePage(nextLink, context)); } /** @@ -1462,13 +948,6 @@ public PagedIterable generateDefaultDeviceGroups(String resour */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByCatalogNextSinglePageAsync(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.listByCatalogNext(nextLink, this.client.getEndpoint(), accept, context)) @@ -1477,6 +956,20 @@ private Mono> listByCatalogNextSinglePageAsync(Strin .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 of a Product list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByCatalogNextSinglePage(String nextLink) { + return listByCatalogNextSinglePage(nextLink, Context.NONE); + } + /** * Get the next page of items. * @@ -1485,23 +978,15 @@ private Mono> listByCatalogNextSinglePageAsync(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 response of a Product list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a Product list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCatalogNextSinglePageAsync(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.")); - } + private PagedResponse listByCatalogNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByCatalogNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByCatalogNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1516,13 +1001,6 @@ private Mono> listByCatalogNextSinglePageAsync(Strin */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> generateDefaultDeviceGroupsNextSinglePageAsync(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.generateDefaultDeviceGroupsNext(nextLink, this.client.getEndpoint(), accept, context)) @@ -1531,6 +1009,20 @@ private Mono> generateDefaultDeviceGroupsNextSin .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 of a DeviceGroup list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse generateDefaultDeviceGroupsNextSinglePage(String nextLink) { + return generateDefaultDeviceGroupsNextSinglePage(nextLink, Context.NONE); + } + /** * Get the next page of items. * @@ -1539,23 +1031,15 @@ private Mono> generateDefaultDeviceGroupsNextSin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 of a DeviceGroup list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a DeviceGroup list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> generateDefaultDeviceGroupsNextSinglePageAsync(String nextLink, + private PagedResponse generateDefaultDeviceGroupsNextSinglePage(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.generateDefaultDeviceGroupsNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.generateDefaultDeviceGroupsNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ProductsImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ProductsImpl.java index 4e76a66cc0174..a6781c18d9316 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ProductsImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ProductsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.implementation; @@ -31,26 +31,12 @@ public ProductsImpl(ProductsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable listByCatalog(String resourceGroupName, String catalogName) { - PagedIterable inner = this.serviceClient().listByCatalog(resourceGroupName, catalogName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ProductImpl(inner1, this.manager())); - } - - public PagedIterable listByCatalog(String resourceGroupName, String catalogName, Context context) { - PagedIterable inner = this.serviceClient().listByCatalog(resourceGroupName, catalogName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ProductImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String catalogName, String productName, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, catalogName, productName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ProductImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ProductImpl(inner.getValue(), this.manager())); } public Product get(String resourceGroupName, String catalogName, String productName) { @@ -63,23 +49,28 @@ public Product get(String resourceGroupName, String catalogName, String productN } public void delete(String resourceGroupName, String catalogName, String productName) { - this.serviceClient().delete(resourceGroupName, catalogName, productName); + this.delete(resourceGroupName, catalogName, productName, Context.NONE); } public void delete(String resourceGroupName, String catalogName, String productName, Context context) { this.serviceClient().delete(resourceGroupName, catalogName, productName, context); } + public PagedIterable listByCatalog(String resourceGroupName, String catalogName) { + return this.listByCatalog(resourceGroupName, catalogName, Context.NONE); + } + + public PagedIterable listByCatalog(String resourceGroupName, String catalogName, Context context) { + PagedIterable inner = this.serviceClient().listByCatalog(resourceGroupName, catalogName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ProductImpl(inner1, this.manager())); + } + public Response countDevicesWithResponse(String resourceGroupName, String catalogName, String productName, Context context) { Response inner = this.serviceClient().countDevicesWithResponse(resourceGroupName, catalogName, productName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CountDevicesResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CountDevicesResponseImpl(inner.getValue(), this.manager())); } public CountDevicesResponse countDevices(String resourceGroupName, String catalogName, String productName) { @@ -94,9 +85,7 @@ public CountDevicesResponse countDevices(String resourceGroupName, String catalo public PagedIterable generateDefaultDeviceGroups(String resourceGroupName, String catalogName, String productName) { - PagedIterable inner - = this.serviceClient().generateDefaultDeviceGroups(resourceGroupName, catalogName, productName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DeviceGroupImpl(inner1, this.manager())); + return this.generateDefaultDeviceGroups(resourceGroupName, catalogName, productName, Context.NONE); } public PagedIterable generateDefaultDeviceGroups(String resourceGroupName, String catalogName, @@ -107,78 +96,36 @@ public PagedIterable generateDefaultDeviceGroups(String resourceGro } public Product getById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); - if (catalogName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); - } - String productName = ResourceManagerUtils.getValueFromIdByName(id, "products"); - if (productName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); - } - return this.getWithResponse(resourceGroupName, catalogName, productName, Context.NONE).getValue(); + return this.getByIdWithResponse(id, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); - if (catalogName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); - } - String productName = ResourceManagerUtils.getValueFromIdByName(id, "products"); - if (productName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); - } + String resourceGroupName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}", + "resourceGroupName", "resourceGroups", LOGGER); + String catalogName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}", + "catalogName", "catalogs", LOGGER); + String productName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}", + "productName", "products", LOGGER); return this.getWithResponse(resourceGroupName, catalogName, productName, context); } public void deleteById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); - if (catalogName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); - } - String productName = ResourceManagerUtils.getValueFromIdByName(id, "products"); - if (productName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); - } - this.delete(resourceGroupName, catalogName, productName, Context.NONE); + this.deleteByIdWithResponse(id, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); - if (catalogName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); - } - String productName = ResourceManagerUtils.getValueFromIdByName(id, "products"); - if (productName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); - } + String resourceGroupName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}", + "resourceGroupName", "resourceGroups", LOGGER); + String catalogName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}", + "catalogName", "catalogs", LOGGER); + String productName = ResourceManagerUtils.getRequiredValueFromIdByParameterName(id, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}", + "productName", "products", LOGGER); this.delete(resourceGroupName, catalogName, productName, context); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ProofOfPossessionNonceResponseImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ProofOfPossessionNonceResponseImpl.java index 431290bc7a552..efb0d5376dfe6 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ProofOfPossessionNonceResponseImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ProofOfPossessionNonceResponseImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.implementation; diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ResourceManagerUtils.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ResourceManagerUtils.java index 53ffe8656ceb2..9e5dec11bf216 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ResourceManagerUtils.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ResourceManagerUtils.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.implementation; @@ -8,12 +8,9 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.util.CoreUtils; -import java.util.ArrayList; +import com.azure.core.util.logging.ClientLogger; import java.util.Arrays; -import java.util.Collections; import java.util.Iterator; -import java.util.List; import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -23,57 +20,53 @@ final class ResourceManagerUtils { private ResourceManagerUtils() { } - static String getValueFromIdByName(String id, String name) { - if (id == null) { + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null || parameterName == null) { + return null; + } + String[] idSegments = id.split("/", -1); + String[] pathSegments = pathTemplate.split("/", -1); + int idStart = idSegments[0].isEmpty() ? 1 : 0; + int pathStart = pathSegments[0].isEmpty() ? 1 : 0; + if (idStart == idSegments.length || pathStart == pathSegments.length) { return null; } - Iterator itr = Arrays.stream(id.split("/")).iterator(); - while (itr.hasNext()) { - String part = itr.next(); - if (part != null && !part.trim().isEmpty()) { - if (part.equalsIgnoreCase(name)) { - if (itr.hasNext()) { - return itr.next(); - } else { - return null; - } + for (int i = idStart; i < idSegments.length; ++i) { + if (idSegments[i].isEmpty()) { + return null; + } + } + String parameterPlaceholder = "{" + parameterName + "}"; + String value = null; + int idIndex = idSegments.length - 1; + for (int pathIndex = pathSegments.length - 1; pathIndex >= pathStart; --pathIndex, --idIndex) { + String pathSegment = pathSegments[pathIndex]; + boolean isParameter = pathSegment.startsWith("{") && pathSegment.endsWith("}"); + if (pathIndex == pathStart && isParameter) { + // A leading scope can span multiple segments, or be empty for tenant resources. + if (pathSegment.equalsIgnoreCase(parameterPlaceholder)) { + value = String.join("/", Arrays.copyOfRange(idSegments, idStart, idIndex + 1)); } + idIndex = idStart; + } else if (idIndex < idStart) { + return null; + } else if (!isParameter && !pathSegment.equalsIgnoreCase(idSegments[idIndex])) { + return null; + } else if (pathSegment.equalsIgnoreCase(parameterPlaceholder)) { + value = idSegments[idIndex]; } } - return null; + return idIndex < idStart ? value : null; } - static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { - if (id == null || pathTemplate == null) { - return null; - } - String parameterNameParentheses = "{" + parameterName + "}"; - List idSegmentsReverted = Arrays.asList(id.split("/")); - List pathSegments = Arrays.asList(pathTemplate.split("/")); - Collections.reverse(idSegmentsReverted); - Iterator idItrReverted = idSegmentsReverted.iterator(); - int pathIndex = pathSegments.size(); - while (idItrReverted.hasNext() && pathIndex > 0) { - String idSegment = idItrReverted.next(); - String pathSegment = pathSegments.get(--pathIndex); - if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { - if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { - if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { - List segments = new ArrayList<>(); - segments.add(idSegment); - idItrReverted.forEachRemaining(segments::add); - Collections.reverse(segments); - if (!segments.isEmpty() && segments.get(0).isEmpty()) { - segments.remove(0); - } - return String.join("/", segments); - } else { - return idSegment; - } - } - } + static String getRequiredValueFromIdByParameterName(String id, String pathTemplate, String parameterName, + String segmentName, ClientLogger logger) { + String value = getValueFromIdByParameterName(id, pathTemplate, parameterName); + if (value == null) { + throw logger.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment '%s'.", id, segmentName))); } - return null; + return value; } static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/SignedCapabilityImageResponseImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/SignedCapabilityImageResponseImpl.java index d5767277af923..a644041e12327 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/SignedCapabilityImageResponseImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/SignedCapabilityImageResponseImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.implementation; diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CatalogListResult.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/models/CatalogListResult.java similarity index 67% rename from sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CatalogListResult.java rename to sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/models/CatalogListResult.java index edd39c17852b3..f5bd543a34d60 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CatalogListResult.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/models/CatalogListResult.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.sphere.models; +package com.azure.resourcemanager.sphere.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,7 +16,7 @@ /** * The response of a Catalog list operation. */ -@Fluent +@Immutable public final class CatalogListResult implements JsonSerializable { /* * The Catalog items on this page @@ -32,7 +31,7 @@ public final class CatalogListResult implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The Catalog items on this page. - * - * @param value the value value to set. - * @return the CatalogListResult object itself. - */ - public CatalogListResult withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,33 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the CatalogListResult object itself. - */ - public CatalogListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model CatalogListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(CatalogListResult.class); - /** * {@inheritDoc} */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CertificateListResult.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/models/CertificateListResult.java similarity index 68% rename from sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CertificateListResult.java rename to sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/models/CertificateListResult.java index ea0be35c6fd85..50688cfe0e386 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CertificateListResult.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/models/CertificateListResult.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.sphere.models; +package com.azure.resourcemanager.sphere.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,7 +16,7 @@ /** * The response of a Certificate list operation. */ -@Fluent +@Immutable public final class CertificateListResult implements JsonSerializable { /* * The Certificate items on this page @@ -32,7 +31,7 @@ public final class CertificateListResult implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The Certificate items on this page. - * - * @param value the value value to set. - * @return the CertificateListResult object itself. - */ - public CertificateListResult withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,33 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the CertificateListResult object itself. - */ - public CertificateListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model CertificateListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(CertificateListResult.class); - /** * {@inheritDoc} */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeploymentListResult.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/models/DeploymentListResult.java similarity index 68% rename from sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeploymentListResult.java rename to sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/models/DeploymentListResult.java index 3a8571e601912..f94dface8283b 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeploymentListResult.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/models/DeploymentListResult.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.sphere.models; +package com.azure.resourcemanager.sphere.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,7 +16,7 @@ /** * The response of a Deployment list operation. */ -@Fluent +@Immutable public final class DeploymentListResult implements JsonSerializable { /* * The Deployment items on this page @@ -32,7 +31,7 @@ public final class DeploymentListResult implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The Deployment items on this page. - * - * @param value the value value to set. - * @return the DeploymentListResult object itself. - */ - public DeploymentListResult withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,33 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the DeploymentListResult object itself. - */ - public DeploymentListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model DeploymentListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(DeploymentListResult.class); - /** * {@inheritDoc} */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroupListResult.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/models/DeviceGroupListResult.java similarity index 68% rename from sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroupListResult.java rename to sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/models/DeviceGroupListResult.java index ed16acfc15632..f7a746698add9 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroupListResult.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/models/DeviceGroupListResult.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.sphere.models; +package com.azure.resourcemanager.sphere.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,7 +16,7 @@ /** * The response of a DeviceGroup list operation. */ -@Fluent +@Immutable public final class DeviceGroupListResult implements JsonSerializable { /* * The DeviceGroup items on this page @@ -32,7 +31,7 @@ public final class DeviceGroupListResult implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The DeviceGroup items on this page. - * - * @param value the value value to set. - * @return the DeviceGroupListResult object itself. - */ - public DeviceGroupListResult withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,33 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the DeviceGroupListResult object itself. - */ - public DeviceGroupListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model DeviceGroupListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(DeviceGroupListResult.class); - /** * {@inheritDoc} */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceListResult.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/models/DeviceListResult.java similarity index 67% rename from sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceListResult.java rename to sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/models/DeviceListResult.java index 762197a61e8e5..1da6cbcd3c7e0 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceListResult.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/models/DeviceListResult.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.sphere.models; +package com.azure.resourcemanager.sphere.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,7 +16,7 @@ /** * The response of a Device list operation. */ -@Fluent +@Immutable public final class DeviceListResult implements JsonSerializable { /* * The Device items on this page @@ -32,7 +31,7 @@ public final class DeviceListResult implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The Device items on this page. - * - * @param value the value value to set. - * @return the DeviceListResult object itself. - */ - public DeviceListResult withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,33 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the DeviceListResult object itself. - */ - public DeviceListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model DeviceListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(DeviceListResult.class); - /** * {@inheritDoc} */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ImageListResult.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/models/ImageListResult.java similarity index 67% rename from sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ImageListResult.java rename to sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/models/ImageListResult.java index e5d85c33cc350..0dd415c51fb69 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ImageListResult.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/models/ImageListResult.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.sphere.models; +package com.azure.resourcemanager.sphere.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,7 +16,7 @@ /** * The response of a Image list operation. */ -@Fluent +@Immutable public final class ImageListResult implements JsonSerializable { /* * The Image items on this page @@ -32,7 +31,7 @@ public final class ImageListResult implements JsonSerializable /** * Creates an instance of ImageListResult class. */ - public ImageListResult() { + private ImageListResult() { } /** @@ -44,17 +43,6 @@ public List value() { return this.value; } - /** - * Set the value property: The Image items on this page. - * - * @param value the value value to set. - * @return the ImageListResult object itself. - */ - public ImageListResult withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,33 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the ImageListResult object itself. - */ - public ImageListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model ImageListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ImageListResult.class); - /** * {@inheritDoc} */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/OperationListResult.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/models/OperationListResult.java similarity index 78% rename from sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/OperationListResult.java rename to sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/models/OperationListResult.java index 2c28d34fb2ca3..0701fed84410e 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/OperationListResult.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/models/OperationListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.sphere.models; +package com.azure.resourcemanager.sphere.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -20,23 +20,23 @@ @Immutable public final class OperationListResult implements JsonSerializable { /* - * List of operations supported by the resource provider + * The Operation items on this page */ private List value; /* - * URL to get the next set of operation list results (if there are any). + * The link to the next page of items */ private String nextLink; /** * Creates an instance of OperationListResult class. */ - public OperationListResult() { + private OperationListResult() { } /** - * Get the value property: List of operations supported by the resource provider. + * Get the value property: The Operation items on this page. * * @return the value value. */ @@ -45,7 +45,7 @@ public List value() { } /** - * Get the nextLink property: URL to get the next set of operation list results (if there are any). + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -53,23 +53,14 @@ public String nextLink() { return this.nextLink; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -79,6 +70,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the OperationListResult. */ public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/PagedDeviceInsight.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/models/PagedDeviceInsight.java similarity index 68% rename from sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/PagedDeviceInsight.java rename to sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/models/PagedDeviceInsight.java index 77c8ba0cc0eb3..b51cf4bea113a 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/PagedDeviceInsight.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/models/PagedDeviceInsight.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.sphere.models; +package com.azure.resourcemanager.sphere.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,7 +16,7 @@ /** * Paged collection of DeviceInsight items. */ -@Fluent +@Immutable public final class PagedDeviceInsight implements JsonSerializable { /* * The DeviceInsight items on this page @@ -32,7 +31,7 @@ public final class PagedDeviceInsight implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The DeviceInsight items on this page. - * - * @param value the value value to set. - * @return the PagedDeviceInsight object itself. - */ - public PagedDeviceInsight withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,33 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the PagedDeviceInsight object itself. - */ - public PagedDeviceInsight withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model PagedDeviceInsight")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(PagedDeviceInsight.class); - /** * {@inheritDoc} */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProductListResult.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/models/ProductListResult.java similarity index 67% rename from sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProductListResult.java rename to sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/models/ProductListResult.java index 7287b239311e7..4cb78dfaa290c 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProductListResult.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/models/ProductListResult.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.sphere.models; +package com.azure.resourcemanager.sphere.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,7 +16,7 @@ /** * The response of a Product list operation. */ -@Fluent +@Immutable public final class ProductListResult implements JsonSerializable { /* * The Product items on this page @@ -32,7 +31,7 @@ public final class ProductListResult implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The Product items on this page. - * - * @param value the value value to set. - * @return the ProductListResult object itself. - */ - public ProductListResult withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,33 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the ProductListResult object itself. - */ - public ProductListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model ProductListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ProductListResult.class); - /** * {@inheritDoc} */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/package-info.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/package-info.java index 878a1be7d183a..e5a590cc4d98a 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/package-info.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the implementations for AzureSphereMgmtClient. + * Package containing the implementations for AzureSphere. * Azure Sphere resource management API. */ package com.azure.resourcemanager.sphere.implementation; diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ActionType.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ActionType.java index 66657e6c9262f..664ea488b2540 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ActionType.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ActionType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; @@ -8,11 +8,11 @@ import java.util.Collection; /** - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ public final class ActionType extends ExpandableStringEnum { /** - * Static value Internal for ActionType. + * Actions are for internal-only APIs. */ public static final ActionType INTERNAL = fromString("Internal"); diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/AllowCrashDumpCollection.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/AllowCrashDumpCollection.java index 0381a3385b740..dd6a5ad924303 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/AllowCrashDumpCollection.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/AllowCrashDumpCollection.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; @@ -12,12 +12,12 @@ */ public final class AllowCrashDumpCollection extends ExpandableStringEnum { /** - * Static value Enabled for AllowCrashDumpCollection. + * Crash dump collection enabled. */ public static final AllowCrashDumpCollection ENABLED = fromString("Enabled"); /** - * Static value Disabled for AllowCrashDumpCollection. + * Crash dump collection disabled. */ public static final AllowCrashDumpCollection DISABLED = fromString("Disabled"); diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CapabilityType.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CapabilityType.java index 8c60c8b3d3bda..e79461b7209bc 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CapabilityType.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CapabilityType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; @@ -12,12 +12,12 @@ */ public final class CapabilityType extends ExpandableStringEnum { /** - * Static value ApplicationDevelopment for CapabilityType. + * Application development capability. */ public static final CapabilityType APPLICATION_DEVELOPMENT = fromString("ApplicationDevelopment"); /** - * Static value FieldServicing for CapabilityType. + * Field servicing capability. */ public static final CapabilityType FIELD_SERVICING = fromString("FieldServicing"); diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Catalog.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Catalog.java index 4cfb60a7b47e8..da4f97bc17d75 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Catalog.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Catalog.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CatalogProperties.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CatalogProperties.java index 725f7f672a6c3..ac0992318a448 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CatalogProperties.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CatalogProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; @@ -50,14 +50,6 @@ public ProvisioningState provisioningState() { return this.provisioningState; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CatalogUpdate.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CatalogUpdate.java index f66b1c7696cd1..2298da7cd349f 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CatalogUpdate.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CatalogUpdate.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; @@ -48,14 +48,6 @@ public CatalogUpdate withTags(Map tags) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Catalogs.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Catalogs.java index d399d00ab62d4..8c94994a55172 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Catalogs.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Catalogs.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; @@ -14,95 +14,95 @@ */ public interface Catalogs { /** - * List Catalog resources by subscription ID. + * Get a Catalog. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param catalogName Name of catalog. + * @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 of a Catalog list operation as paginated response with {@link PagedIterable}. + * @return a Catalog along with {@link Response}. */ - PagedIterable list(); + Response getByResourceGroupWithResponse(String resourceGroupName, String catalogName, Context context); /** - * List Catalog resources by subscription ID. + * Get a Catalog. * - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 of a Catalog list operation as paginated response with {@link PagedIterable}. + * @return a Catalog. */ - PagedIterable list(Context context); + Catalog getByResourceGroup(String resourceGroupName, String catalogName); /** - * List Catalog resources by resource group. + * Delete a Catalog. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 of a Catalog list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName); + void deleteByResourceGroup(String resourceGroupName, String catalogName); /** - * List Catalog resources by resource group. + * Delete a Catalog. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param catalogName Name of catalog. * @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 of a Catalog list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + void delete(String resourceGroupName, String catalogName, Context context); /** - * Get a Catalog. + * List Catalog resources by resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @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 Catalog along with {@link Response}. + * @return the response of a Catalog list operation as paginated response with {@link PagedIterable}. */ - Response getByResourceGroupWithResponse(String resourceGroupName, String catalogName, Context context); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Get a Catalog. + * List Catalog resources by resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. + * @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 Catalog. + * @return the response of a Catalog list operation as paginated response with {@link PagedIterable}. */ - Catalog getByResourceGroup(String resourceGroupName, String catalogName); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Delete a Catalog. + * List Catalog resources by subscription ID. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 of a Catalog list operation as paginated response with {@link PagedIterable}. */ - void deleteByResourceGroup(String resourceGroupName, String catalogName); + PagedIterable list(); /** - * Delete a Catalog. + * List Catalog resources by subscription ID. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. * @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 of a Catalog list operation as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String catalogName, Context context); + PagedIterable list(Context context); /** * Counts devices in catalog. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Certificate.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Certificate.java index 1aee6fd4d576d..dfae27a7b9734 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Certificate.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Certificate.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CertificateChainResponse.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CertificateChainResponse.java index 940f393fa3a8d..2ea1f51f6a389 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CertificateChainResponse.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CertificateChainResponse.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CertificateProperties.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CertificateProperties.java index 72d30e2f96dd4..6046006b56776 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CertificateProperties.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CertificateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; @@ -56,7 +56,7 @@ public class CertificateProperties implements JsonSerializable { /** - * Static value Active for CertificateStatus. + * Certificate is active. */ public static final CertificateStatus ACTIVE = fromString("Active"); /** - * Static value Inactive for CertificateStatus. + * Certificate is inactive. */ public static final CertificateStatus INACTIVE = fromString("Inactive"); /** - * Static value Expired for CertificateStatus. + * Certificate has expired. */ public static final CertificateStatus EXPIRED = fromString("Expired"); /** - * Static value Revoked for CertificateStatus. + * Certificate has been revoked. */ public static final CertificateStatus REVOKED = fromString("Revoked"); diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Certificates.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Certificates.java index bf130ef1ce0fe..ff6119dcc6d96 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Certificates.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Certificates.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; @@ -13,62 +13,62 @@ */ public interface Certificates { /** - * List Certificate resources by Catalog. + * Get a Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. + * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. + * @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 of a Certificate list operation as paginated response with {@link PagedIterable}. + * @return a Certificate along with {@link Response}. */ - PagedIterable listByCatalog(String resourceGroupName, String catalogName); + Response getWithResponse(String resourceGroupName, String catalogName, String serialNumber, + Context context); /** - * List Certificate resources by Catalog. + * Get a Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param filter Filter the result list using the given expression. - * @param top The number of result items to return. - * @param skip The number of result items to skip. - * @param maxpagesize The maximum number of result items per page. - * @param context The context to associate with this operation. + * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 of a Certificate list operation as paginated response with {@link PagedIterable}. + * @return a Certificate. */ - PagedIterable listByCatalog(String resourceGroupName, String catalogName, String filter, Integer top, - Integer skip, Integer maxpagesize, Context context); + Certificate get(String resourceGroupName, String catalogName, String serialNumber); /** - * Get a Certificate. + * List Certificate resources by Catalog. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. - * @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 Certificate along with {@link Response}. + * @return the response of a Certificate list operation as paginated response with {@link PagedIterable}. */ - Response getWithResponse(String resourceGroupName, String catalogName, String serialNumber, - Context context); + PagedIterable listByCatalog(String resourceGroupName, String catalogName); /** - * Get a Certificate. + * List Certificate resources by Catalog. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. + * @param filter Filter the result list using the given expression. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @param maxpagesize The maximum number of result items per page. + * @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 Certificate. + * @return the response of a Certificate list operation as paginated response with {@link PagedIterable}. */ - Certificate get(String resourceGroupName, String catalogName, String serialNumber); + PagedIterable listByCatalog(String resourceGroupName, String catalogName, String filter, Integer top, + Integer skip, Integer maxpagesize, Context context); /** * Retrieves cert chain. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ClaimDevicesRequest.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ClaimDevicesRequest.java index 1ded7f11712f7..6efb78b491e09 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ClaimDevicesRequest.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ClaimDevicesRequest.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -49,21 +48,6 @@ public ClaimDevicesRequest withDeviceIdentifiers(List deviceIdentifiers) return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (deviceIdentifiers() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property deviceIdentifiers in model ClaimDevicesRequest")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ClaimDevicesRequest.class); - /** * {@inheritDoc} */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CountDeviceResponse.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CountDeviceResponse.java deleted file mode 100644 index e73232bb77916..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CountDeviceResponse.java +++ /dev/null @@ -1,78 +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.sphere.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Response to the action call for count devices in a catalog (preview API). - */ -@Fluent -public final class CountDeviceResponse extends CountElementsResponse { - /** - * Creates an instance of CountDeviceResponse class. - */ - public CountDeviceResponse() { - } - - /** - * {@inheritDoc} - */ - @Override - public CountDeviceResponse withValue(int value) { - super.withValue(value); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeIntField("value", value()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CountDeviceResponse from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CountDeviceResponse if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the CountDeviceResponse. - */ - public static CountDeviceResponse fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CountDeviceResponse deserializedCountDeviceResponse = new CountDeviceResponse(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - deserializedCountDeviceResponse.withValue(reader.getInt()); - } else { - reader.skipChildren(); - } - } - - return deserializedCountDeviceResponse; - }); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CountDevicesResponse.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CountDevicesResponse.java index 61ba11c3736ba..99e22345ec4e9 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CountDevicesResponse.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CountDevicesResponse.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CountElementsResponse.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CountElementsResponse.java index e6914fe31cd04..d73bcd05dfd3d 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CountElementsResponse.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CountElementsResponse.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Response of the count for elements. */ -@Fluent +@Immutable public class CountElementsResponse implements JsonSerializable { /* * Number of children resources in parent resource. @@ -24,7 +24,7 @@ public class CountElementsResponse implements JsonSerializable e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Deployments.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Deployments.java index 71d8fff814d50..09d0ad9d4da5b 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Deployments.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Deployments.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; @@ -12,43 +12,6 @@ * Resource collection API of Deployments. */ public interface Deployments { - /** - * List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be - * used for product or device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device 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 the response of a Deployment list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, - String deviceGroupName); - - /** - * List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be - * used for product or device group name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param catalogName Name of catalog. - * @param productName Name of product. - * @param deviceGroupName Name of device group. - * @param filter Filter the result list using the given expression. - * @param top The number of result items to return. - * @param skip The number of result items to skip. - * @param maxpagesize The maximum number of result items per page. - * @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 of a Deployment list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, - String deviceGroupName, String filter, Integer top, Integer skip, Integer maxpagesize, Context context); - /** * Get a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device * group name. @@ -121,6 +84,43 @@ void delete(String resourceGroupName, String catalogName, String productName, St void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deploymentName, Context context); + /** + * List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be + * used for product or device group name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param catalogName Name of catalog. + * @param productName Name of product. + * @param deviceGroupName Name of device 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 the response of a Deployment list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, + String deviceGroupName); + + /** + * List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be + * used for product or device group name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param catalogName Name of catalog. + * @param productName Name of product. + * @param deviceGroupName Name of device group. + * @param filter Filter the result list using the given expression. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @param maxpagesize The maximum number of result items per page. + * @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 of a Deployment list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String filter, Integer top, Integer skip, Integer maxpagesize, Context context); + /** * Get a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device * group name. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Device.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Device.java index 0228d79e48579..926febbbe8d8d 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Device.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Device.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroup.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroup.java index b94eba078941a..87d4054144626 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroup.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroup.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroupProperties.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroupProperties.java index fb0f97ab06290..4e1b12dc533f7 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroupProperties.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroupProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; @@ -175,14 +175,6 @@ public ProvisioningState provisioningState() { return this.provisioningState; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroupUpdate.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroupUpdate.java index 9e9762802a5e5..6c8c8febf9f02 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroupUpdate.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroupUpdate.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; @@ -47,17 +47,6 @@ public DeviceGroupUpdate withProperties(DeviceGroupUpdateProperties properties) return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroupUpdateProperties.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroupUpdateProperties.java index fd179cb5cea01..8cb982bd08b13 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroupUpdateProperties.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroupUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; @@ -148,14 +148,6 @@ public DeviceGroupUpdateProperties withRegionalDataBoundary(RegionalDataBoundary return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroups.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroups.java index afed0f5f9dd90..9ed7a93555b46 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroups.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroups.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; @@ -13,100 +13,100 @@ */ public interface DeviceGroups { /** - * List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used - * for product name. + * Get a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or + * device group name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. + * @param deviceGroupName Name of device 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 the response of a DeviceGroup list operation as paginated response with {@link PagedIterable}. + * @return a DeviceGroup along with {@link Response}. */ - PagedIterable listByProduct(String resourceGroupName, String catalogName, String productName); + Response getWithResponse(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, Context context); /** - * List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used - * for product name. + * Get a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or + * device group name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. - * @param filter Filter the result list using the given expression. - * @param top The number of result items to return. - * @param skip The number of result items to skip. - * @param maxpagesize The maximum number of result items per page. - * @param context The context to associate with this operation. + * @param deviceGroupName Name of device 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 the response of a DeviceGroup list operation as paginated response with {@link PagedIterable}. + * @return a DeviceGroup. */ - PagedIterable listByProduct(String resourceGroupName, String catalogName, String productName, - String filter, Integer top, Integer skip, Integer maxpagesize, Context context); + DeviceGroup get(String resourceGroupName, String catalogName, String productName, String deviceGroupName); /** - * Get a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or + * Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device 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 a DeviceGroup along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String catalogName, String productName, - String deviceGroupName, Context context); + void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName); /** - * Get a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or + * Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device 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 a DeviceGroup. */ - DeviceGroup get(String resourceGroupName, String catalogName, String productName, String deviceGroupName); + void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + Context context); /** - * Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or - * device group name. + * List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used + * for product name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. - * @param deviceGroupName Name of device 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 the response of a DeviceGroup list operation as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName); + PagedIterable listByProduct(String resourceGroupName, String catalogName, String productName); /** - * Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or - * device group name. + * List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used + * for product name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. - * @param deviceGroupName Name of device group. + * @param filter Filter the result list using the given expression. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @param maxpagesize The maximum number of result items per page. * @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 of a DeviceGroup list operation as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, - Context context); + PagedIterable listByProduct(String resourceGroupName, String catalogName, String productName, + String filter, Integer top, Integer skip, Integer maxpagesize, Context context); /** * Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceInsight.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceInsight.java index 1ddc5e3df51f6..1dc709f0e3986 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceInsight.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceInsight.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceProperties.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceProperties.java index 646ce4adc9833..8bf9d36515706 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceProperties.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; @@ -133,14 +133,6 @@ public ProvisioningState provisioningState() { return this.provisioningState; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceUpdate.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceUpdate.java index dbc73c4c71452..92350ca715777 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceUpdate.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceUpdate.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; @@ -47,17 +47,6 @@ public DeviceUpdate withProperties(DeviceUpdateProperties properties) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceUpdateProperties.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceUpdateProperties.java index ed61cae1c8423..35e8b4723bc50 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceUpdateProperties.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; @@ -47,14 +47,6 @@ public DeviceUpdateProperties withDeviceGroupId(String deviceGroupId) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Devices.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Devices.java index ef2bd6c513eeb..cc17c9b3de10e 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Devices.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Devices.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; @@ -13,103 +13,103 @@ */ public interface Devices { /** - * List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used - * for product or device group name. + * Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not + * belong to a device group and product. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. + * @param deviceName Device name. + * @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 of a Device list operation as paginated response with {@link PagedIterable}. + * @return a Device along with {@link Response}. */ - PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, - String deviceGroupName); + Response getWithResponse(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deviceName, Context context); /** - * List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used - * for product or device group name. + * Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not + * belong to a device group and product. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. - * @param context The context to associate with this operation. + * @param deviceName Device name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 of a Device list operation as paginated response with {@link PagedIterable}. + * @return a Device. */ - PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, - String deviceGroupName, Context context); + Device get(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + String deviceName); /** - * Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not - * belong to a device group and product. + * Delete a Device. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deviceName Device name. - * @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 Device along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String catalogName, String productName, - String deviceGroupName, String deviceName, Context context); + void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + String deviceName); /** - * Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not - * belong to a device group and product. + * Delete a Device. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deviceName Device name. + * @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 Device. */ - Device get(String resourceGroupName, String catalogName, String productName, String deviceGroupName, - String deviceName); + void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + String deviceName, Context context); /** - * Delete a Device. + * List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used + * for product or device group name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. - * @param deviceName Device name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 of a Device list operation as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, - String deviceName); + PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, + String deviceGroupName); /** - * Delete a Device. + * List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used + * for product or device group name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. - * @param deviceName Device name. * @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 of a Device list operation as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, - String deviceName, Context context); + PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, Context context); /** * Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/GenerateCapabilityImageRequest.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/GenerateCapabilityImageRequest.java index 6cf526f2835bb..5966d4578fe6e 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/GenerateCapabilityImageRequest.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/GenerateCapabilityImageRequest.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -49,21 +48,6 @@ public GenerateCapabilityImageRequest withCapabilities(List capa return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (capabilities() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property capabilities in model GenerateCapabilityImageRequest")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(GenerateCapabilityImageRequest.class); - /** * {@inheritDoc} */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Image.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Image.java index 8db4189339e11..11ffc5d4b3cb4 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Image.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Image.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ImageProperties.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ImageProperties.java index ac015fc799684..eb7389718ccf0 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ImageProperties.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ImageProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; @@ -183,14 +183,6 @@ public ProvisioningState provisioningState() { return this.provisioningState; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ImageType.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ImageType.java index 5394d881b93ba..e05c1e2b8f204 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ImageType.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ImageType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; @@ -12,122 +12,122 @@ */ public final class ImageType extends ExpandableStringEnum { /** - * Static value InvalidImageType for ImageType. + * Invalid image. */ public static final ImageType INVALID_IMAGE_TYPE = fromString("InvalidImageType"); /** - * Static value OneBl for ImageType. + * One Bl image type. */ public static final ImageType ONE_BL = fromString("OneBl"); /** - * Static value PlutonRuntime for ImageType. + * Pluton image type. */ public static final ImageType PLUTON_RUNTIME = fromString("PlutonRuntime"); /** - * Static value WifiFirmware for ImageType. + * Wifi firmware image type. */ public static final ImageType WIFI_FIRMWARE = fromString("WifiFirmware"); /** - * Static value SecurityMonitor for ImageType. + * Security monitor image type. */ public static final ImageType SECURITY_MONITOR = fromString("SecurityMonitor"); /** - * Static value NormalWorldLoader for ImageType. + * Normal world loader image type. */ public static final ImageType NORMAL_WORLD_LOADER = fromString("NormalWorldLoader"); /** - * Static value NormalWorldDtb for ImageType. + * Normal world dtb image type. */ public static final ImageType NORMAL_WORLD_DTB = fromString("NormalWorldDtb"); /** - * Static value NormalWorldKernel for ImageType. + * Normal world kernel image type. */ public static final ImageType NORMAL_WORLD_KERNEL = fromString("NormalWorldKernel"); /** - * Static value RootFs for ImageType. + * Root FS image type. */ public static final ImageType ROOT_FS = fromString("RootFs"); /** - * Static value Services for ImageType. + * Services image type. */ public static final ImageType SERVICES = fromString("Services"); /** - * Static value Applications for ImageType. + * Applications image type. */ public static final ImageType APPLICATIONS = fromString("Applications"); /** - * Static value FwConfig for ImageType. + * FW config image type. */ public static final ImageType FW_CONFIG = fromString("FwConfig"); /** - * Static value BootManifest for ImageType. + * Boot manifest image type. */ public static final ImageType BOOT_MANIFEST = fromString("BootManifest"); /** - * Static value Nwfs for ImageType. + * Nwfs image type. */ public static final ImageType NWFS = fromString("Nwfs"); /** - * Static value TrustedKeystore for ImageType. + * Trusted key store image type. */ public static final ImageType TRUSTED_KEYSTORE = fromString("TrustedKeystore"); /** - * Static value Policy for ImageType. + * Policy image type. */ public static final ImageType POLICY = fromString("Policy"); /** - * Static value CustomerBoardConfig for ImageType. + * Customer board config image type. */ public static final ImageType CUSTOMER_BOARD_CONFIG = fromString("CustomerBoardConfig"); /** - * Static value UpdateCertStore for ImageType. + * Update certificate store image type. */ public static final ImageType UPDATE_CERT_STORE = fromString("UpdateCertStore"); /** - * Static value BaseSystemUpdateManifest for ImageType. + * Base system update manifest image type. */ public static final ImageType BASE_SYSTEM_UPDATE_MANIFEST = fromString("BaseSystemUpdateManifest"); /** - * Static value FirmwareUpdateManifest for ImageType. + * Firmware update manifest image type. */ public static final ImageType FIRMWARE_UPDATE_MANIFEST = fromString("FirmwareUpdateManifest"); /** - * Static value CustomerUpdateManifest for ImageType. + * Customer update manifest image type. */ public static final ImageType CUSTOMER_UPDATE_MANIFEST = fromString("CustomerUpdateManifest"); /** - * Static value RecoveryManifest for ImageType. + * Recovery manifest image type. */ public static final ImageType RECOVERY_MANIFEST = fromString("RecoveryManifest"); /** - * Static value ManifestSet for ImageType. + * Manifest set image type. */ public static final ImageType MANIFEST_SET = fromString("ManifestSet"); /** - * Static value Other for ImageType. + * Other image type. */ public static final ImageType OTHER = fromString("Other"); diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Images.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Images.java index da17aaf6899ac..2228eefd6e9d0 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Images.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Images.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; @@ -13,86 +13,86 @@ */ public interface Images { /** - * List Image resources by Catalog. + * Get a Image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. + * @param imageName Image name. Use an image GUID for GA versions of the API. + * @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 of a Image list operation as paginated response with {@link PagedIterable}. + * @return a Image along with {@link Response}. */ - PagedIterable listByCatalog(String resourceGroupName, String catalogName); + Response getWithResponse(String resourceGroupName, String catalogName, String imageName, Context context); /** - * List Image resources by Catalog. + * Get a Image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param filter Filter the result list using the given expression. - * @param top The number of result items to return. - * @param skip The number of result items to skip. - * @param maxpagesize The maximum number of result items per page. - * @param context The context to associate with this operation. + * @param imageName Image name. Use an image GUID for GA versions of the API. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 of a Image list operation as paginated response with {@link PagedIterable}. + * @return a Image. */ - PagedIterable listByCatalog(String resourceGroupName, String catalogName, String filter, Integer top, - Integer skip, Integer maxpagesize, Context context); + Image get(String resourceGroupName, String catalogName, String imageName); /** - * Get a Image. + * Delete a Image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param imageName Image name. Use an image GUID for GA versions of the API. - * @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 Image along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String catalogName, String imageName, Context context); + void delete(String resourceGroupName, String catalogName, String imageName); /** - * Get a Image. + * Delete a Image. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param imageName Image name. Use an image GUID for GA versions of the API. + * @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 Image. */ - Image get(String resourceGroupName, String catalogName, String imageName); + void delete(String resourceGroupName, String catalogName, String imageName, Context context); /** - * Delete a Image. + * List Image resources by Catalog. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use an image GUID for GA versions of the API. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 of a Image list operation as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String catalogName, String imageName); + PagedIterable listByCatalog(String resourceGroupName, String catalogName); /** - * Delete a Image. + * List Image resources by Catalog. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use an image GUID for GA versions of the API. + * @param filter Filter the result list using the given expression. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @param maxpagesize The maximum number of result items per page. * @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 of a Image list operation as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String catalogName, String imageName, Context context); + PagedIterable listByCatalog(String resourceGroupName, String catalogName, String filter, Integer top, + Integer skip, Integer maxpagesize, Context context); /** * Get a Image. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ListDeviceGroupsRequest.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ListDeviceGroupsRequest.java index 223b17b015bbc..acb8767daeb8a 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ListDeviceGroupsRequest.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ListDeviceGroupsRequest.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; @@ -47,14 +47,6 @@ public ListDeviceGroupsRequest withDeviceGroupName(String deviceGroupName) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/OSFeedType.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/OSFeedType.java index 1f90b19796366..f29dd209ed802 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/OSFeedType.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/OSFeedType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; @@ -12,12 +12,12 @@ */ public final class OSFeedType extends ExpandableStringEnum { /** - * Static value Retail for OSFeedType. + * Retail OS feed type. */ public static final OSFeedType RETAIL = fromString("Retail"); /** - * Static value RetailEval for OSFeedType. + * Retail evaluation OS feed type. */ public static final OSFeedType RETAIL_EVAL = fromString("RetailEval"); diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Operation.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Operation.java index f39a2845910dc..16b10e737143d 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Operation.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Operation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; @@ -20,7 +20,7 @@ public interface Operation { /** * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane - * operations and "false" for ARM/control-plane operations. + * operations and "false" for Azure Resource Manager/control-plane operations. * * @return the isDataAction value. */ @@ -42,8 +42,8 @@ public interface Operation { Origin origin(); /** - * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal - * only APIs. + * Gets the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. * * @return the actionType value. */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/OperationDisplay.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/OperationDisplay.java index 8855b96adada0..519a33f905376 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/OperationDisplay.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/OperationDisplay.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; @@ -12,7 +12,7 @@ import java.io.IOException; /** - * Localized display information for this particular operation. + * Localized display information for an operation. */ @Immutable public final class OperationDisplay implements JsonSerializable { @@ -42,7 +42,7 @@ public final class OperationDisplay implements JsonSerializable { /** - * Static value user for Origin. + * Indicates the operation is initiated by a user. */ public static final Origin USER = fromString("user"); /** - * Static value system for Origin. + * Indicates the operation is initiated by a system. */ public static final Origin SYSTEM = fromString("system"); /** - * Static value user,system for Origin. + * Indicates the operation is initiated by a user or system. */ public static final Origin USER_SYSTEM = fromString("user,system"); diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Product.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Product.java index e57616eacea67..12806563c00fb 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Product.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Product.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProductProperties.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProductProperties.java index 680ba11610a29..cd3b62418e840 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProductProperties.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProductProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; @@ -61,14 +61,6 @@ public ProvisioningState provisioningState() { return this.provisioningState; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProductUpdate.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProductUpdate.java index f1514c5d00beb..8e9cab7a08cc8 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProductUpdate.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProductUpdate.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; @@ -47,17 +47,6 @@ public ProductUpdate withProperties(ProductUpdateProperties properties) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProductUpdateProperties.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProductUpdateProperties.java index a174510994169..c289539a42df5 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProductUpdateProperties.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProductUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; @@ -47,14 +47,6 @@ public ProductUpdateProperties withDescription(String description) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Products.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Products.java index c6ebe0df8eafa..4e1fd4bc557eb 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Products.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Products.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; @@ -13,82 +13,82 @@ */ public interface Products { /** - * List Product resources by Catalog. + * Get a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. + * @param productName Name of product. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a Product list operation as paginated response with {@link PagedIterable}. + * @return a Product along with {@link Response}. */ - PagedIterable listByCatalog(String resourceGroupName, String catalogName); + Response getWithResponse(String resourceGroupName, String catalogName, String productName, + Context context); /** - * List Product resources by Catalog. + * Get a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param context The context to associate with this operation. + * @param productName Name of 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 the response of a Product list operation as paginated response with {@link PagedIterable}. + * @return a Product. */ - PagedIterable listByCatalog(String resourceGroupName, String catalogName, Context context); + Product get(String resourceGroupName, String catalogName, String productName); /** - * Get a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. + * Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name'. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Product along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String catalogName, String productName, - Context context); + void delete(String resourceGroupName, String catalogName, String productName); /** - * Get a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. + * Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name'. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Product. */ - Product get(String resourceGroupName, String catalogName, String productName); + void delete(String resourceGroupName, String catalogName, String productName, Context context); /** - * Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name'. + * List Product resources by Catalog. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param productName Name of 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 the response of a Product list operation as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String catalogName, String productName); + PagedIterable listByCatalog(String resourceGroupName, String catalogName); /** - * Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name'. + * List Product resources by Catalog. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param productName Name of product. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Product list operation as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String catalogName, String productName, Context context); + PagedIterable listByCatalog(String resourceGroupName, String catalogName, Context context); /** * Counts devices in product. '.default' and '.unassigned' are system defined values and cannot be used for product diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProofOfPossessionNonceRequest.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProofOfPossessionNonceRequest.java index 0f950c7222415..3bea853dc7a72 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProofOfPossessionNonceRequest.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProofOfPossessionNonceRequest.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -48,21 +47,6 @@ public ProofOfPossessionNonceRequest withProofOfPossessionNonce(String proofOfPo return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (proofOfPossessionNonce() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property proofOfPossessionNonce in model ProofOfPossessionNonceRequest")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ProofOfPossessionNonceRequest.class); - /** * {@inheritDoc} */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProofOfPossessionNonceResponse.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProofOfPossessionNonceResponse.java index 3bcdf8d2100d1..b8687a4d3377d 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProofOfPossessionNonceResponse.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProofOfPossessionNonceResponse.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProvisioningState.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProvisioningState.java index 2a6b59e7fcdda..be4d1e8619687 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProvisioningState.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; @@ -12,37 +12,37 @@ */ public final class ProvisioningState extends ExpandableStringEnum { /** - * Static value Succeeded for ProvisioningState. + * Resource has been created. */ public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for ProvisioningState. + * Resource creation failed. */ public static final ProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for ProvisioningState. + * Resource creation was canceled. */ public static final ProvisioningState CANCELED = fromString("Canceled"); /** - * Static value Provisioning for ProvisioningState. + * The resource is being provisioned. */ public static final ProvisioningState PROVISIONING = fromString("Provisioning"); /** - * Static value Updating for ProvisioningState. + * The resource is being updated. */ public static final ProvisioningState UPDATING = fromString("Updating"); /** - * Static value Deleting for ProvisioningState. + * The resource is being deleted. */ public static final ProvisioningState DELETING = fromString("Deleting"); /** - * Static value Accepted for ProvisioningState. + * The resource create request has been accepted. */ public static final ProvisioningState ACCEPTED = fromString("Accepted"); diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/RegionalDataBoundary.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/RegionalDataBoundary.java index a95797549724c..ed76ebd11f144 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/RegionalDataBoundary.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/RegionalDataBoundary.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; @@ -12,12 +12,12 @@ */ public final class RegionalDataBoundary extends ExpandableStringEnum { /** - * Static value None for RegionalDataBoundary. + * No data boundary. */ public static final RegionalDataBoundary NONE = fromString("None"); /** - * Static value EU for RegionalDataBoundary. + * EU data boundary. */ public static final RegionalDataBoundary EU = fromString("EU"); diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/SignedCapabilityImageResponse.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/SignedCapabilityImageResponse.java index d2477da612aeb..2b5a43e3a1db9 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/SignedCapabilityImageResponse.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/SignedCapabilityImageResponse.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/UpdatePolicy.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/UpdatePolicy.java index 6ee016843ca6a..2ac6a82a0e093 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/UpdatePolicy.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/UpdatePolicy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.models; @@ -12,12 +12,12 @@ */ public final class UpdatePolicy extends ExpandableStringEnum { /** - * Static value UpdateAll for UpdatePolicy. + * Update all policy. */ public static final UpdatePolicy UPDATE_ALL = fromString("UpdateAll"); /** - * Static value No3rdPartyAppUpdates for UpdatePolicy. + * No update for 3rd party app policy. */ public static final UpdatePolicy NO3RD_PARTY_APP_UPDATES = fromString("No3rdPartyAppUpdates"); diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/package-info.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/package-info.java index 5ee8c5416a246..2e13053320a34 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/package-info.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the data models for AzureSphereMgmtClient. + * Package containing the data models for AzureSphere. * Azure Sphere resource management API. */ package com.azure.resourcemanager.sphere.models; diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/package-info.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/package-info.java index 229d09be942a6..ecd7c7f1ac0bf 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/package-info.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the classes for AzureSphereMgmtClient. + * Package containing the classes for AzureSphere. * Azure Sphere resource management API. */ package com.azure.resourcemanager.sphere; diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/module-info.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/module-info.java index bded277fe62ef..87513b7af4042 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/module-info.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/module-info.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. module com.azure.resourcemanager.sphere { requires transitive com.azure.core.management; @@ -12,4 +12,5 @@ opens com.azure.resourcemanager.sphere.fluent.models to com.azure.core; opens com.azure.resourcemanager.sphere.models to com.azure.core; + opens com.azure.resourcemanager.sphere.implementation.models to com.azure.core; } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/resources/META-INF/azure-resourcemanager-sphere_metadata.json b/sdk/sphere/azure-resourcemanager-sphere/src/main/resources/META-INF/azure-resourcemanager-sphere_metadata.json new file mode 100644 index 0000000000000..7143ecdb78c40 --- /dev/null +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/resources/META-INF/azure-resourcemanager-sphere_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Microsoft.AzureSphere":"2024-04-01"},"crossLanguagePackageId":"Microsoft.AzureSphere","crossLanguageVersion":"9afa3c363747","crossLanguageDefinitions":{"com.azure.resourcemanager.sphere.fluent.AzureSphereManagementClient":"Microsoft.AzureSphere","com.azure.resourcemanager.sphere.fluent.CatalogsClient":"Microsoft.AzureSphere.Catalogs","com.azure.resourcemanager.sphere.fluent.CatalogsClient.beginCreateOrUpdate":"Microsoft.AzureSphere.Catalogs.createOrUpdate","com.azure.resourcemanager.sphere.fluent.CatalogsClient.beginDelete":"Microsoft.AzureSphere.Catalogs.delete","com.azure.resourcemanager.sphere.fluent.CatalogsClient.beginUploadImage":"Microsoft.AzureSphere.Catalogs.uploadImage","com.azure.resourcemanager.sphere.fluent.CatalogsClient.countDevices":"Microsoft.AzureSphere.Catalogs.countDevices","com.azure.resourcemanager.sphere.fluent.CatalogsClient.countDevicesWithResponse":"Microsoft.AzureSphere.Catalogs.countDevices","com.azure.resourcemanager.sphere.fluent.CatalogsClient.createOrUpdate":"Microsoft.AzureSphere.Catalogs.createOrUpdate","com.azure.resourcemanager.sphere.fluent.CatalogsClient.delete":"Microsoft.AzureSphere.Catalogs.delete","com.azure.resourcemanager.sphere.fluent.CatalogsClient.getByResourceGroup":"Microsoft.AzureSphere.Catalogs.get","com.azure.resourcemanager.sphere.fluent.CatalogsClient.getByResourceGroupWithResponse":"Microsoft.AzureSphere.Catalogs.get","com.azure.resourcemanager.sphere.fluent.CatalogsClient.list":"Microsoft.AzureSphere.Catalogs.listBySubscription","com.azure.resourcemanager.sphere.fluent.CatalogsClient.listByResourceGroup":"Microsoft.AzureSphere.Catalogs.listByResourceGroup","com.azure.resourcemanager.sphere.fluent.CatalogsClient.listDeployments":"Microsoft.AzureSphere.Catalogs.listDeployments","com.azure.resourcemanager.sphere.fluent.CatalogsClient.listDeviceGroups":"Microsoft.AzureSphere.Catalogs.listDeviceGroups","com.azure.resourcemanager.sphere.fluent.CatalogsClient.listDeviceInsights":"Microsoft.AzureSphere.Catalogs.listDeviceInsights","com.azure.resourcemanager.sphere.fluent.CatalogsClient.listDevices":"Microsoft.AzureSphere.Catalogs.listDevices","com.azure.resourcemanager.sphere.fluent.CatalogsClient.update":"Microsoft.AzureSphere.Catalogs.update","com.azure.resourcemanager.sphere.fluent.CatalogsClient.updateWithResponse":"Microsoft.AzureSphere.Catalogs.update","com.azure.resourcemanager.sphere.fluent.CatalogsClient.uploadImage":"Microsoft.AzureSphere.Catalogs.uploadImage","com.azure.resourcemanager.sphere.fluent.CertificatesClient":"Microsoft.AzureSphere.Certificates","com.azure.resourcemanager.sphere.fluent.CertificatesClient.get":"Microsoft.AzureSphere.Certificates.get","com.azure.resourcemanager.sphere.fluent.CertificatesClient.getWithResponse":"Microsoft.AzureSphere.Certificates.get","com.azure.resourcemanager.sphere.fluent.CertificatesClient.listByCatalog":"Microsoft.AzureSphere.Certificates.listByCatalog","com.azure.resourcemanager.sphere.fluent.CertificatesClient.retrieveCertChain":"Microsoft.AzureSphere.Certificates.retrieveCertChain","com.azure.resourcemanager.sphere.fluent.CertificatesClient.retrieveCertChainWithResponse":"Microsoft.AzureSphere.Certificates.retrieveCertChain","com.azure.resourcemanager.sphere.fluent.CertificatesClient.retrieveProofOfPossessionNonce":"Microsoft.AzureSphere.Certificates.retrieveProofOfPossessionNonce","com.azure.resourcemanager.sphere.fluent.CertificatesClient.retrieveProofOfPossessionNonceWithResponse":"Microsoft.AzureSphere.Certificates.retrieveProofOfPossessionNonce","com.azure.resourcemanager.sphere.fluent.DeploymentsClient":"Microsoft.AzureSphere.Deployments","com.azure.resourcemanager.sphere.fluent.DeploymentsClient.beginCreateOrUpdate":"Microsoft.AzureSphere.Deployments.createOrUpdate","com.azure.resourcemanager.sphere.fluent.DeploymentsClient.beginDelete":"Microsoft.AzureSphere.Deployments.delete","com.azure.resourcemanager.sphere.fluent.DeploymentsClient.createOrUpdate":"Microsoft.AzureSphere.Deployments.createOrUpdate","com.azure.resourcemanager.sphere.fluent.DeploymentsClient.delete":"Microsoft.AzureSphere.Deployments.delete","com.azure.resourcemanager.sphere.fluent.DeploymentsClient.get":"Microsoft.AzureSphere.Deployments.get","com.azure.resourcemanager.sphere.fluent.DeploymentsClient.getWithResponse":"Microsoft.AzureSphere.Deployments.get","com.azure.resourcemanager.sphere.fluent.DeploymentsClient.listByDeviceGroup":"Microsoft.AzureSphere.Deployments.listByDeviceGroup","com.azure.resourcemanager.sphere.fluent.DeviceGroupsClient":"Microsoft.AzureSphere.DeviceGroups","com.azure.resourcemanager.sphere.fluent.DeviceGroupsClient.beginClaimDevices":"Microsoft.AzureSphere.DeviceGroups.claimDevices","com.azure.resourcemanager.sphere.fluent.DeviceGroupsClient.beginCreateOrUpdate":"Microsoft.AzureSphere.DeviceGroups.createOrUpdate","com.azure.resourcemanager.sphere.fluent.DeviceGroupsClient.beginDelete":"Microsoft.AzureSphere.DeviceGroups.delete","com.azure.resourcemanager.sphere.fluent.DeviceGroupsClient.beginUpdate":"Microsoft.AzureSphere.DeviceGroups.update","com.azure.resourcemanager.sphere.fluent.DeviceGroupsClient.claimDevices":"Microsoft.AzureSphere.DeviceGroups.claimDevices","com.azure.resourcemanager.sphere.fluent.DeviceGroupsClient.countDevices":"Microsoft.AzureSphere.DeviceGroups.countDevices","com.azure.resourcemanager.sphere.fluent.DeviceGroupsClient.countDevicesWithResponse":"Microsoft.AzureSphere.DeviceGroups.countDevices","com.azure.resourcemanager.sphere.fluent.DeviceGroupsClient.createOrUpdate":"Microsoft.AzureSphere.DeviceGroups.createOrUpdate","com.azure.resourcemanager.sphere.fluent.DeviceGroupsClient.delete":"Microsoft.AzureSphere.DeviceGroups.delete","com.azure.resourcemanager.sphere.fluent.DeviceGroupsClient.get":"Microsoft.AzureSphere.DeviceGroups.get","com.azure.resourcemanager.sphere.fluent.DeviceGroupsClient.getWithResponse":"Microsoft.AzureSphere.DeviceGroups.get","com.azure.resourcemanager.sphere.fluent.DeviceGroupsClient.listByProduct":"Microsoft.AzureSphere.DeviceGroups.listByProduct","com.azure.resourcemanager.sphere.fluent.DeviceGroupsClient.update":"Microsoft.AzureSphere.DeviceGroups.update","com.azure.resourcemanager.sphere.fluent.DevicesClient":"Microsoft.AzureSphere.Devices","com.azure.resourcemanager.sphere.fluent.DevicesClient.beginCreateOrUpdate":"Microsoft.AzureSphere.Devices.createOrUpdate","com.azure.resourcemanager.sphere.fluent.DevicesClient.beginDelete":"Microsoft.AzureSphere.Devices.delete","com.azure.resourcemanager.sphere.fluent.DevicesClient.beginGenerateCapabilityImage":"Microsoft.AzureSphere.Devices.generateCapabilityImage","com.azure.resourcemanager.sphere.fluent.DevicesClient.beginUpdate":"Microsoft.AzureSphere.Devices.update","com.azure.resourcemanager.sphere.fluent.DevicesClient.createOrUpdate":"Microsoft.AzureSphere.Devices.createOrUpdate","com.azure.resourcemanager.sphere.fluent.DevicesClient.delete":"Microsoft.AzureSphere.Devices.delete","com.azure.resourcemanager.sphere.fluent.DevicesClient.generateCapabilityImage":"Microsoft.AzureSphere.Devices.generateCapabilityImage","com.azure.resourcemanager.sphere.fluent.DevicesClient.get":"Microsoft.AzureSphere.Devices.get","com.azure.resourcemanager.sphere.fluent.DevicesClient.getWithResponse":"Microsoft.AzureSphere.Devices.get","com.azure.resourcemanager.sphere.fluent.DevicesClient.listByDeviceGroup":"Microsoft.AzureSphere.Devices.listByDeviceGroup","com.azure.resourcemanager.sphere.fluent.DevicesClient.update":"Microsoft.AzureSphere.Devices.update","com.azure.resourcemanager.sphere.fluent.ImagesClient":"Microsoft.AzureSphere.Images","com.azure.resourcemanager.sphere.fluent.ImagesClient.beginCreateOrUpdate":"Microsoft.AzureSphere.Images.createOrUpdate","com.azure.resourcemanager.sphere.fluent.ImagesClient.beginDelete":"Microsoft.AzureSphere.Images.delete","com.azure.resourcemanager.sphere.fluent.ImagesClient.createOrUpdate":"Microsoft.AzureSphere.Images.createOrUpdate","com.azure.resourcemanager.sphere.fluent.ImagesClient.delete":"Microsoft.AzureSphere.Images.delete","com.azure.resourcemanager.sphere.fluent.ImagesClient.get":"Microsoft.AzureSphere.Images.get","com.azure.resourcemanager.sphere.fluent.ImagesClient.getWithResponse":"Microsoft.AzureSphere.Images.get","com.azure.resourcemanager.sphere.fluent.ImagesClient.listByCatalog":"Microsoft.AzureSphere.Images.listByCatalog","com.azure.resourcemanager.sphere.fluent.OperationsClient":"Microsoft.AzureSphere.Operations","com.azure.resourcemanager.sphere.fluent.OperationsClient.list":"Azure.ResourceManager.Operations.list","com.azure.resourcemanager.sphere.fluent.ProductsClient":"Microsoft.AzureSphere.Products","com.azure.resourcemanager.sphere.fluent.ProductsClient.beginCreateOrUpdate":"Microsoft.AzureSphere.Products.createOrUpdate","com.azure.resourcemanager.sphere.fluent.ProductsClient.beginDelete":"Microsoft.AzureSphere.Products.delete","com.azure.resourcemanager.sphere.fluent.ProductsClient.beginUpdate":"Microsoft.AzureSphere.Products.update","com.azure.resourcemanager.sphere.fluent.ProductsClient.countDevices":"Microsoft.AzureSphere.Products.countDevices","com.azure.resourcemanager.sphere.fluent.ProductsClient.countDevicesWithResponse":"Microsoft.AzureSphere.Products.countDevices","com.azure.resourcemanager.sphere.fluent.ProductsClient.createOrUpdate":"Microsoft.AzureSphere.Products.createOrUpdate","com.azure.resourcemanager.sphere.fluent.ProductsClient.delete":"Microsoft.AzureSphere.Products.delete","com.azure.resourcemanager.sphere.fluent.ProductsClient.generateDefaultDeviceGroups":"Microsoft.AzureSphere.Products.generateDefaultDeviceGroups","com.azure.resourcemanager.sphere.fluent.ProductsClient.get":"Microsoft.AzureSphere.Products.get","com.azure.resourcemanager.sphere.fluent.ProductsClient.getWithResponse":"Microsoft.AzureSphere.Products.get","com.azure.resourcemanager.sphere.fluent.ProductsClient.listByCatalog":"Microsoft.AzureSphere.Products.listByCatalog","com.azure.resourcemanager.sphere.fluent.ProductsClient.update":"Microsoft.AzureSphere.Products.update","com.azure.resourcemanager.sphere.fluent.models.CatalogInner":"Microsoft.AzureSphere.Catalog","com.azure.resourcemanager.sphere.fluent.models.CertificateChainResponseInner":"Microsoft.AzureSphere.CertificateChainResponse","com.azure.resourcemanager.sphere.fluent.models.CertificateInner":"Microsoft.AzureSphere.Certificate","com.azure.resourcemanager.sphere.fluent.models.CountDevicesResponseInner":"Microsoft.AzureSphere.CountDevicesResponse","com.azure.resourcemanager.sphere.fluent.models.DeploymentInner":"Microsoft.AzureSphere.Deployment","com.azure.resourcemanager.sphere.fluent.models.DeviceGroupInner":"Microsoft.AzureSphere.DeviceGroup","com.azure.resourcemanager.sphere.fluent.models.DeviceInner":"Microsoft.AzureSphere.Device","com.azure.resourcemanager.sphere.fluent.models.DeviceInsightInner":"Microsoft.AzureSphere.DeviceInsight","com.azure.resourcemanager.sphere.fluent.models.ImageInner":"Microsoft.AzureSphere.Image","com.azure.resourcemanager.sphere.fluent.models.OperationInner":"Azure.ResourceManager.CommonTypes.Operation","com.azure.resourcemanager.sphere.fluent.models.ProductInner":"Microsoft.AzureSphere.Product","com.azure.resourcemanager.sphere.fluent.models.ProofOfPossessionNonceResponseInner":"Microsoft.AzureSphere.ProofOfPossessionNonceResponse","com.azure.resourcemanager.sphere.fluent.models.SignedCapabilityImageResponseInner":"Microsoft.AzureSphere.SignedCapabilityImageResponse","com.azure.resourcemanager.sphere.implementation.AzureSphereManagementClientBuilder":"Microsoft.AzureSphere","com.azure.resourcemanager.sphere.implementation.models.CatalogListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.sphere.implementation.models.CertificateListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.sphere.implementation.models.DeploymentListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.sphere.implementation.models.DeviceGroupListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.sphere.implementation.models.DeviceListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.sphere.implementation.models.ImageListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.sphere.implementation.models.OperationListResult":"Azure.ResourceManager.CommonTypes.OperationListResult","com.azure.resourcemanager.sphere.implementation.models.PagedDeviceInsight":"Microsoft.AzureSphere.PagedDeviceInsight","com.azure.resourcemanager.sphere.implementation.models.ProductListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.sphere.models.ActionType":"Azure.ResourceManager.CommonTypes.ActionType","com.azure.resourcemanager.sphere.models.AllowCrashDumpCollection":"Microsoft.AzureSphere.AllowCrashDumpCollection","com.azure.resourcemanager.sphere.models.CapabilityType":"Microsoft.AzureSphere.CapabilityType","com.azure.resourcemanager.sphere.models.CatalogProperties":"Microsoft.AzureSphere.CatalogProperties","com.azure.resourcemanager.sphere.models.CatalogUpdate":"Microsoft.AzureSphere.CatalogUpdate","com.azure.resourcemanager.sphere.models.CertificateProperties":"Microsoft.AzureSphere.CertificateProperties","com.azure.resourcemanager.sphere.models.CertificateStatus":"Microsoft.AzureSphere.CertificateStatus","com.azure.resourcemanager.sphere.models.ClaimDevicesRequest":"Microsoft.AzureSphere.ClaimDevicesRequest","com.azure.resourcemanager.sphere.models.CountElementsResponse":"Microsoft.AzureSphere.CountElementsResponse","com.azure.resourcemanager.sphere.models.DeploymentProperties":"Microsoft.AzureSphere.DeploymentProperties","com.azure.resourcemanager.sphere.models.DeviceGroupProperties":"Microsoft.AzureSphere.DeviceGroupProperties","com.azure.resourcemanager.sphere.models.DeviceGroupUpdate":"Microsoft.AzureSphere.DeviceGroupUpdate","com.azure.resourcemanager.sphere.models.DeviceGroupUpdateProperties":"Microsoft.AzureSphere.DeviceGroupUpdateProperties","com.azure.resourcemanager.sphere.models.DeviceProperties":"Microsoft.AzureSphere.DeviceProperties","com.azure.resourcemanager.sphere.models.DeviceUpdate":"Microsoft.AzureSphere.DeviceUpdate","com.azure.resourcemanager.sphere.models.DeviceUpdateProperties":"Microsoft.AzureSphere.DeviceUpdateProperties","com.azure.resourcemanager.sphere.models.GenerateCapabilityImageRequest":"Microsoft.AzureSphere.GenerateCapabilityImageRequest","com.azure.resourcemanager.sphere.models.ImageProperties":"Microsoft.AzureSphere.ImageProperties","com.azure.resourcemanager.sphere.models.ImageType":"Microsoft.AzureSphere.ImageType","com.azure.resourcemanager.sphere.models.ListDeviceGroupsRequest":"Microsoft.AzureSphere.ListDeviceGroupsRequest","com.azure.resourcemanager.sphere.models.OSFeedType":"Microsoft.AzureSphere.OSFeedType","com.azure.resourcemanager.sphere.models.OperationDisplay":"Azure.ResourceManager.CommonTypes.OperationDisplay","com.azure.resourcemanager.sphere.models.Origin":"Azure.ResourceManager.CommonTypes.Origin","com.azure.resourcemanager.sphere.models.ProductProperties":"Microsoft.AzureSphere.ProductProperties","com.azure.resourcemanager.sphere.models.ProductUpdate":"Microsoft.AzureSphere.ProductUpdate","com.azure.resourcemanager.sphere.models.ProductUpdateProperties":"Microsoft.AzureSphere.ProductUpdateProperties","com.azure.resourcemanager.sphere.models.ProofOfPossessionNonceRequest":"Microsoft.AzureSphere.ProofOfPossessionNonceRequest","com.azure.resourcemanager.sphere.models.ProvisioningState":"Microsoft.AzureSphere.ProvisioningState","com.azure.resourcemanager.sphere.models.RegionalDataBoundary":"Microsoft.AzureSphere.RegionalDataBoundary","com.azure.resourcemanager.sphere.models.UpdatePolicy":"Microsoft.AzureSphere.UpdatePolicy"},"generatedFiles":["src/main/java/com/azure/resourcemanager/sphere/AzureSphereManager.java","src/main/java/com/azure/resourcemanager/sphere/fluent/AzureSphereManagementClient.java","src/main/java/com/azure/resourcemanager/sphere/fluent/CatalogsClient.java","src/main/java/com/azure/resourcemanager/sphere/fluent/CertificatesClient.java","src/main/java/com/azure/resourcemanager/sphere/fluent/DeploymentsClient.java","src/main/java/com/azure/resourcemanager/sphere/fluent/DeviceGroupsClient.java","src/main/java/com/azure/resourcemanager/sphere/fluent/DevicesClient.java","src/main/java/com/azure/resourcemanager/sphere/fluent/ImagesClient.java","src/main/java/com/azure/resourcemanager/sphere/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/sphere/fluent/ProductsClient.java","src/main/java/com/azure/resourcemanager/sphere/fluent/models/CatalogInner.java","src/main/java/com/azure/resourcemanager/sphere/fluent/models/CertificateChainResponseInner.java","src/main/java/com/azure/resourcemanager/sphere/fluent/models/CertificateInner.java","src/main/java/com/azure/resourcemanager/sphere/fluent/models/CountDevicesResponseInner.java","src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeploymentInner.java","src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeviceGroupInner.java","src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeviceInner.java","src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeviceInsightInner.java","src/main/java/com/azure/resourcemanager/sphere/fluent/models/ImageInner.java","src/main/java/com/azure/resourcemanager/sphere/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/sphere/fluent/models/ProductInner.java","src/main/java/com/azure/resourcemanager/sphere/fluent/models/ProofOfPossessionNonceResponseInner.java","src/main/java/com/azure/resourcemanager/sphere/fluent/models/SignedCapabilityImageResponseInner.java","src/main/java/com/azure/resourcemanager/sphere/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/sphere/fluent/package-info.java","src/main/java/com/azure/resourcemanager/sphere/implementation/AzureSphereManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/sphere/implementation/AzureSphereManagementClientImpl.java","src/main/java/com/azure/resourcemanager/sphere/implementation/CatalogImpl.java","src/main/java/com/azure/resourcemanager/sphere/implementation/CatalogsClientImpl.java","src/main/java/com/azure/resourcemanager/sphere/implementation/CatalogsImpl.java","src/main/java/com/azure/resourcemanager/sphere/implementation/CertificateChainResponseImpl.java","src/main/java/com/azure/resourcemanager/sphere/implementation/CertificateImpl.java","src/main/java/com/azure/resourcemanager/sphere/implementation/CertificatesClientImpl.java","src/main/java/com/azure/resourcemanager/sphere/implementation/CertificatesImpl.java","src/main/java/com/azure/resourcemanager/sphere/implementation/CountDevicesResponseImpl.java","src/main/java/com/azure/resourcemanager/sphere/implementation/DeploymentImpl.java","src/main/java/com/azure/resourcemanager/sphere/implementation/DeploymentsClientImpl.java","src/main/java/com/azure/resourcemanager/sphere/implementation/DeploymentsImpl.java","src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceGroupImpl.java","src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceGroupsClientImpl.java","src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceGroupsImpl.java","src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceImpl.java","src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceInsightImpl.java","src/main/java/com/azure/resourcemanager/sphere/implementation/DevicesClientImpl.java","src/main/java/com/azure/resourcemanager/sphere/implementation/DevicesImpl.java","src/main/java/com/azure/resourcemanager/sphere/implementation/ImageImpl.java","src/main/java/com/azure/resourcemanager/sphere/implementation/ImagesClientImpl.java","src/main/java/com/azure/resourcemanager/sphere/implementation/ImagesImpl.java","src/main/java/com/azure/resourcemanager/sphere/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/sphere/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/sphere/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/sphere/implementation/ProductImpl.java","src/main/java/com/azure/resourcemanager/sphere/implementation/ProductsClientImpl.java","src/main/java/com/azure/resourcemanager/sphere/implementation/ProductsImpl.java","src/main/java/com/azure/resourcemanager/sphere/implementation/ProofOfPossessionNonceResponseImpl.java","src/main/java/com/azure/resourcemanager/sphere/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/sphere/implementation/SignedCapabilityImageResponseImpl.java","src/main/java/com/azure/resourcemanager/sphere/implementation/models/CatalogListResult.java","src/main/java/com/azure/resourcemanager/sphere/implementation/models/CertificateListResult.java","src/main/java/com/azure/resourcemanager/sphere/implementation/models/DeploymentListResult.java","src/main/java/com/azure/resourcemanager/sphere/implementation/models/DeviceGroupListResult.java","src/main/java/com/azure/resourcemanager/sphere/implementation/models/DeviceListResult.java","src/main/java/com/azure/resourcemanager/sphere/implementation/models/ImageListResult.java","src/main/java/com/azure/resourcemanager/sphere/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/sphere/implementation/models/PagedDeviceInsight.java","src/main/java/com/azure/resourcemanager/sphere/implementation/models/ProductListResult.java","src/main/java/com/azure/resourcemanager/sphere/implementation/package-info.java","src/main/java/com/azure/resourcemanager/sphere/models/ActionType.java","src/main/java/com/azure/resourcemanager/sphere/models/AllowCrashDumpCollection.java","src/main/java/com/azure/resourcemanager/sphere/models/CapabilityType.java","src/main/java/com/azure/resourcemanager/sphere/models/Catalog.java","src/main/java/com/azure/resourcemanager/sphere/models/CatalogProperties.java","src/main/java/com/azure/resourcemanager/sphere/models/CatalogUpdate.java","src/main/java/com/azure/resourcemanager/sphere/models/Catalogs.java","src/main/java/com/azure/resourcemanager/sphere/models/Certificate.java","src/main/java/com/azure/resourcemanager/sphere/models/CertificateChainResponse.java","src/main/java/com/azure/resourcemanager/sphere/models/CertificateProperties.java","src/main/java/com/azure/resourcemanager/sphere/models/CertificateStatus.java","src/main/java/com/azure/resourcemanager/sphere/models/Certificates.java","src/main/java/com/azure/resourcemanager/sphere/models/ClaimDevicesRequest.java","src/main/java/com/azure/resourcemanager/sphere/models/CountDevicesResponse.java","src/main/java/com/azure/resourcemanager/sphere/models/CountElementsResponse.java","src/main/java/com/azure/resourcemanager/sphere/models/Deployment.java","src/main/java/com/azure/resourcemanager/sphere/models/DeploymentProperties.java","src/main/java/com/azure/resourcemanager/sphere/models/Deployments.java","src/main/java/com/azure/resourcemanager/sphere/models/Device.java","src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroup.java","src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroupProperties.java","src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroupUpdate.java","src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroupUpdateProperties.java","src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroups.java","src/main/java/com/azure/resourcemanager/sphere/models/DeviceInsight.java","src/main/java/com/azure/resourcemanager/sphere/models/DeviceProperties.java","src/main/java/com/azure/resourcemanager/sphere/models/DeviceUpdate.java","src/main/java/com/azure/resourcemanager/sphere/models/DeviceUpdateProperties.java","src/main/java/com/azure/resourcemanager/sphere/models/Devices.java","src/main/java/com/azure/resourcemanager/sphere/models/GenerateCapabilityImageRequest.java","src/main/java/com/azure/resourcemanager/sphere/models/Image.java","src/main/java/com/azure/resourcemanager/sphere/models/ImageProperties.java","src/main/java/com/azure/resourcemanager/sphere/models/ImageType.java","src/main/java/com/azure/resourcemanager/sphere/models/Images.java","src/main/java/com/azure/resourcemanager/sphere/models/ListDeviceGroupsRequest.java","src/main/java/com/azure/resourcemanager/sphere/models/OSFeedType.java","src/main/java/com/azure/resourcemanager/sphere/models/Operation.java","src/main/java/com/azure/resourcemanager/sphere/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/sphere/models/Operations.java","src/main/java/com/azure/resourcemanager/sphere/models/Origin.java","src/main/java/com/azure/resourcemanager/sphere/models/Product.java","src/main/java/com/azure/resourcemanager/sphere/models/ProductProperties.java","src/main/java/com/azure/resourcemanager/sphere/models/ProductUpdate.java","src/main/java/com/azure/resourcemanager/sphere/models/ProductUpdateProperties.java","src/main/java/com/azure/resourcemanager/sphere/models/Products.java","src/main/java/com/azure/resourcemanager/sphere/models/ProofOfPossessionNonceRequest.java","src/main/java/com/azure/resourcemanager/sphere/models/ProofOfPossessionNonceResponse.java","src/main/java/com/azure/resourcemanager/sphere/models/ProvisioningState.java","src/main/java/com/azure/resourcemanager/sphere/models/RegionalDataBoundary.java","src/main/java/com/azure/resourcemanager/sphere/models/SignedCapabilityImageResponse.java","src/main/java/com/azure/resourcemanager/sphere/models/UpdatePolicy.java","src/main/java/com/azure/resourcemanager/sphere/models/package-info.java","src/main/java/com/azure/resourcemanager/sphere/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/resources/azure-resourcemanager-sphere.properties b/sdk/sphere/azure-resourcemanager-sphere/src/main/resources/azure-resourcemanager-sphere.properties new file mode 100644 index 0000000000000..defbd48204e47 --- /dev/null +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/resources/azure-resourcemanager-sphere.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsCountDevicesSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsCountDevicesSamples.java index 564480312993f..827dce07db0ce 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsCountDevicesSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsCountDevicesSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,9 +9,7 @@ */ public final class CatalogsCountDevicesSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PostCountDevicesCatalog. - * json + * x-ms-original-file: 2024-04-01/PostCountDevicesCatalog.json */ /** * Sample code: Catalogs_CountDevices. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsCreateOrUpdateSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsCreateOrUpdateSamples.java index b92c09270a230..522de0ce12ecd 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsCreateOrUpdateSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,8 +9,7 @@ */ public final class CatalogsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PutCatalog.json + * x-ms-original-file: 2024-04-01/PutCatalog.json */ /** * Sample code: Catalogs_CreateOrUpdate. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsDeleteSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsDeleteSamples.java index c5433706b759e..36290157d1371 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsDeleteSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,8 +9,7 @@ */ public final class CatalogsDeleteSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/DeleteCatalog.json + * x-ms-original-file: 2024-04-01/DeleteCatalog.json */ /** * Sample code: Catalogs_Delete. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsGetByResourceGroupSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsGetByResourceGroupSamples.java index 2cccdcc18627c..b08d153e9b17f 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsGetByResourceGroupSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsGetByResourceGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,8 +9,7 @@ */ public final class CatalogsGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetCatalog.json + * x-ms-original-file: 2024-04-01/GetCatalog.json */ /** * Sample code: Catalogs_Get. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListByResourceGroupSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListByResourceGroupSamples.java index da2880834e187..476e5e8df6afe 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListByResourceGroupSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListByResourceGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,8 +9,7 @@ */ public final class CatalogsListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetCatalogsRG.json + * x-ms-original-file: 2024-04-01/GetCatalogsRG.json */ /** * Sample code: Catalogs_ListByResourceGroup. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeploymentsSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeploymentsSamples.java index ba22dc4d53847..76a80507ec263 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeploymentsSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeploymentsSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,8 +9,7 @@ */ public final class CatalogsListDeploymentsSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/ - * PostListDeploymentsByCatalog.json + * x-ms-original-file: 2024-04-01/PostListDeploymentsByCatalog.json */ /** * Sample code: Catalogs_ListDeployments. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceGroupsSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceGroupsSamples.java index e6ed6ad3be967..7934c3a789f07 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceGroupsSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceGroupsSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -11,8 +11,7 @@ */ public final class CatalogsListDeviceGroupsSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/ - * PostListDeviceGroupsCatalog.json + * x-ms-original-file: 2024-04-01/PostListDeviceGroupsCatalog.json */ /** * Sample code: Catalogs_ListDeviceGroups. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceInsightsSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceInsightsSamples.java index 72a6f96bd8763..bedef9175427b 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceInsightsSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceInsightsSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,8 +9,7 @@ */ public final class CatalogsListDeviceInsightsSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/ - * PostListDeviceInsightsCatalog.json + * x-ms-original-file: 2024-04-01/PostListDeviceInsightsCatalog.json */ /** * Sample code: Catalogs_ListDeviceInsights. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListDevicesSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListDevicesSamples.java index 4a84d8604a29e..6616823ff3b13 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListDevicesSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListDevicesSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,9 +9,7 @@ */ public final class CatalogsListDevicesSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PostListDevicesByCatalog. - * json + * x-ms-original-file: 2024-04-01/PostListDevicesByCatalog.json */ /** * Sample code: Catalogs_ListDevices. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListSamples.java index 5171e9f9ee640..35f00128745a1 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,8 +9,7 @@ */ public final class CatalogsListSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetCatalogsSub.json + * x-ms-original-file: 2024-04-01/GetCatalogsSub.json */ /** * Sample code: Catalogs_ListBySubscription. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsUpdateSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsUpdateSamples.java index e22025f5572cc..87d7b5f529c52 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsUpdateSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -11,8 +11,7 @@ */ public final class CatalogsUpdateSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PatchCatalog.json + * x-ms-original-file: 2024-04-01/PatchCatalog.json */ /** * Sample code: Catalogs_Update. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsUploadImageSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsUploadImageSamples.java index ed56408e6bb3f..c3ed93aea0b87 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsUploadImageSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsUploadImageSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -12,9 +12,7 @@ */ public final class CatalogsUploadImageSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PostUploadImageCatalog. - * json + * x-ms-original-file: 2024-04-01/PostUploadImageCatalog.json */ /** * Sample code: Catalogs_UploadImage. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CertificatesGetSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CertificatesGetSamples.java index 5d1f3d779f12e..6b7127ee4bb78 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CertificatesGetSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CertificatesGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,8 +9,7 @@ */ public final class CertificatesGetSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetCertificate.json + * x-ms-original-file: 2024-04-01/GetCertificate.json */ /** * Sample code: Certificates_Get. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CertificatesListByCatalogSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CertificatesListByCatalogSamples.java index 56a1019b02d4f..9287cec96cbc6 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CertificatesListByCatalogSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CertificatesListByCatalogSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,8 +9,7 @@ */ public final class CertificatesListByCatalogSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetCertificates.json + * x-ms-original-file: 2024-04-01/GetCertificates.json */ /** * Sample code: Certificates_ListByCatalog. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveCertChainSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveCertChainSamples.java index b7bc5ec25bff9..9c63f53adbf90 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveCertChainSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveCertChainSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,8 +9,7 @@ */ public final class CertificatesRetrieveCertChainSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/ - * PostRetrieveCatalogCertChain.json + * x-ms-original-file: 2024-04-01/PostRetrieveCatalogCertChain.json */ /** * Sample code: Certificates_RetrieveCertChain. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveProofOfPossessionNonceSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveProofOfPossessionNonceSamples.java index b55a4beb50c6e..bf65e21de1b21 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveProofOfPossessionNonceSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveProofOfPossessionNonceSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -11,8 +11,7 @@ */ public final class CertificatesRetrieveProofOfPossessionNonceSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/ - * PostRetrieveProofOfPossessionNonce.json + * x-ms-original-file: 2024-04-01/PostRetrieveProofOfPossessionNonce.json */ /** * Sample code: Certificates_RetrieveProofOfPossessionNonce. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeploymentsCreateOrUpdateSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeploymentsCreateOrUpdateSamples.java index a5e88b3f9dfb5..5751b1f5ef65c 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeploymentsCreateOrUpdateSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeploymentsCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,8 +9,7 @@ */ public final class DeploymentsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PutDeployment.json + * x-ms-original-file: 2024-04-01/PutDeployment.json */ /** * Sample code: Deployments_CreateOrUpdate. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeploymentsDeleteSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeploymentsDeleteSamples.java index 9d7822a83600d..b7e6b01c7cb01 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeploymentsDeleteSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeploymentsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,8 +9,7 @@ */ public final class DeploymentsDeleteSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/DeleteDeployment.json + * x-ms-original-file: 2024-04-01/DeleteDeployment.json */ /** * Sample code: Deployments_Delete. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeploymentsGetSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeploymentsGetSamples.java index b0f6ab82acfa8..7d7c50d967c8d 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeploymentsGetSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeploymentsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,8 +9,7 @@ */ public final class DeploymentsGetSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetDeployment.json + * x-ms-original-file: 2024-04-01/GetDeployment.json */ /** * Sample code: Deployments_Get. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeploymentsListByDeviceGroupSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeploymentsListByDeviceGroupSamples.java index 5e52f81fe25b6..14709a14d723b 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeploymentsListByDeviceGroupSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeploymentsListByDeviceGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,8 +9,7 @@ */ public final class DeploymentsListByDeviceGroupSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetDeployments.json + * x-ms-original-file: 2024-04-01/GetDeployments.json */ /** * Sample code: Deployments_ListByDeviceGroup. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsClaimDevicesSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsClaimDevicesSamples.java index 780631a9b6219..cf52a69501b6f 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsClaimDevicesSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsClaimDevicesSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -12,8 +12,7 @@ */ public final class DeviceGroupsClaimDevicesSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PostClaimDevices.json + * x-ms-original-file: 2024-04-01/PostClaimDevices.json */ /** * Sample code: DeviceGroups_ClaimDevices. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCountDevicesSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCountDevicesSamples.java index 72f59bb118a66..44ed53e9d5217 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCountDevicesSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCountDevicesSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,8 +9,7 @@ */ public final class DeviceGroupsCountDevicesSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/ - * PostCountDevicesDeviceGroup.json + * x-ms-original-file: 2024-04-01/PostCountDevicesDeviceGroup.json */ /** * Sample code: DeviceGroups_CountDevices. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCreateOrUpdateSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCreateOrUpdateSamples.java index 339a50c125755..63cb942c5031f 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCreateOrUpdateSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -13,8 +13,7 @@ */ public final class DeviceGroupsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PutDeviceGroup.json + * x-ms-original-file: 2024-04-01/PutDeviceGroup.json */ /** * Sample code: DeviceGroups_CreateOrUpdate. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsDeleteSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsDeleteSamples.java index 68a1ee70783fb..6c4d1591297f1 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsDeleteSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,8 +9,7 @@ */ public final class DeviceGroupsDeleteSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/DeleteDeviceGroup.json + * x-ms-original-file: 2024-04-01/DeleteDeviceGroup.json */ /** * Sample code: DeviceGroups_Delete. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsGetSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsGetSamples.java index 2f12dff024b38..84e4ad5fa6165 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsGetSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,8 +9,7 @@ */ public final class DeviceGroupsGetSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetDeviceGroup.json + * x-ms-original-file: 2024-04-01/GetDeviceGroup.json */ /** * Sample code: DeviceGroups_Get. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsListByProductSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsListByProductSamples.java index c0cdfd264c272..4f0e16e906a20 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsListByProductSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsListByProductSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,8 +9,7 @@ */ public final class DeviceGroupsListByProductSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetDeviceGroups.json + * x-ms-original-file: 2024-04-01/GetDeviceGroups.json */ /** * Sample code: DeviceGroups_ListByProduct. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsUpdateSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsUpdateSamples.java index 3f572ba2a6dc2..039086bfa248b 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsUpdateSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -11,8 +11,7 @@ */ public final class DeviceGroupsUpdateSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PatchDeviceGroup.json + * x-ms-original-file: 2024-04-01/PatchDeviceGroup.json */ /** * Sample code: DeviceGroups_Update. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesCreateOrUpdateSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesCreateOrUpdateSamples.java index 1ec3bb6cb5ec4..63cf7f3090fb1 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesCreateOrUpdateSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,8 +9,7 @@ */ public final class DevicesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PutDevice.json + * x-ms-original-file: 2024-04-01/PutDevice.json */ /** * Sample code: Devices_CreateOrUpdate. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesDeleteSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesDeleteSamples.java index bbef55ea2e20b..d19ccd671576c 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesDeleteSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,8 +9,7 @@ */ public final class DevicesDeleteSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/DeleteDevice.json + * x-ms-original-file: 2024-04-01/DeleteDevice.json */ /** * Sample code: Devices_Delete. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesGenerateCapabilityImageSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesGenerateCapabilityImageSamples.java index f5a2bf1255cf2..5cd2c77e3cdb7 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesGenerateCapabilityImageSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesGenerateCapabilityImageSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -13,8 +13,7 @@ */ public final class DevicesGenerateCapabilityImageSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/ - * PostGenerateDeviceCapabilityImage.json + * x-ms-original-file: 2024-04-01/PostGenerateDeviceCapabilityImage.json */ /** * Sample code: Devices_GenerateCapabilityImage. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesGetSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesGetSamples.java index 775fc01b83c28..20994148f91bf 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesGetSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,8 +9,7 @@ */ public final class DevicesGetSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetDevice.json + * x-ms-original-file: 2024-04-01/GetDevice.json */ /** * Sample code: Devices_Get. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesListByDeviceGroupSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesListByDeviceGroupSamples.java index de92ff276bf18..6ae4e42fbc538 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesListByDeviceGroupSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesListByDeviceGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,8 +9,7 @@ */ public final class DevicesListByDeviceGroupSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetDevices.json + * x-ms-original-file: 2024-04-01/GetDevices.json */ /** * Sample code: Devices_ListByDeviceGroup. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesUpdateSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesUpdateSamples.java index eb97bdd42be28..a331230e1f0c5 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesUpdateSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -11,8 +11,7 @@ */ public final class DevicesUpdateSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PatchDevice.json + * x-ms-original-file: 2024-04-01/PatchDevice.json */ /** * Sample code: Devices_Update. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ImagesCreateOrUpdateSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ImagesCreateOrUpdateSamples.java index 1f91098a4c89a..38a5a6de34430 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ImagesCreateOrUpdateSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ImagesCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -11,8 +11,7 @@ */ public final class ImagesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PutImage.json + * x-ms-original-file: 2024-04-01/PutImage.json */ /** * Sample code: Image_CreateOrUpdate. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ImagesDeleteSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ImagesDeleteSamples.java index dfa862a0c4b84..c18a37664a77a 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ImagesDeleteSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ImagesDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,8 +9,7 @@ */ public final class ImagesDeleteSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/DeleteImage.json + * x-ms-original-file: 2024-04-01/DeleteImage.json */ /** * Sample code: Images_Delete. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ImagesGetSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ImagesGetSamples.java index 6a23a8e19efdc..a3ba6d37877e8 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ImagesGetSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ImagesGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,8 +9,7 @@ */ public final class ImagesGetSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetImage.json + * x-ms-original-file: 2024-04-01/GetImage.json */ /** * Sample code: Images_Get. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ImagesListByCatalogSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ImagesListByCatalogSamples.java index 13473dfdec272..1bc6a36e037d6 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ImagesListByCatalogSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ImagesListByCatalogSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,8 +9,7 @@ */ public final class ImagesListByCatalogSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetImages.json + * x-ms-original-file: 2024-04-01/GetImages.json */ /** * Sample code: Images_ListByCatalog. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/OperationsListSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/OperationsListSamples.java index a11da63ebadb2..45dd79d4eaa6f 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/OperationsListSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/OperationsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,8 +9,7 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetOperations.json + * x-ms-original-file: 2024-04-01/GetOperations.json */ /** * Sample code: Operations_List. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsCountDevicesSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsCountDevicesSamples.java index c51e8465508b8..4a22924585dd0 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsCountDevicesSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsCountDevicesSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,9 +9,7 @@ */ public final class ProductsCountDevicesSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PostCountDevicesProduct. - * json + * x-ms-original-file: 2024-04-01/PostCountDevicesProduct.json */ /** * Sample code: Products_CountDevices. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsCreateOrUpdateSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsCreateOrUpdateSamples.java index c487141ce71cc..60b2c134b7e22 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsCreateOrUpdateSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,8 +9,7 @@ */ public final class ProductsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PutProduct.json + * x-ms-original-file: 2024-04-01/PutProduct.json */ /** * Sample code: Products_CreateOrUpdate. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsDeleteSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsDeleteSamples.java index b8664ba9eaf4c..61ae034848bb9 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsDeleteSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,8 +9,7 @@ */ public final class ProductsDeleteSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/DeleteProduct.json + * x-ms-original-file: 2024-04-01/DeleteProduct.json */ /** * Sample code: Products_Delete. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsGenerateDefaultDeviceGroupsSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsGenerateDefaultDeviceGroupsSamples.java index 279c4b9c221a9..aeb1d560752cb 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsGenerateDefaultDeviceGroupsSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsGenerateDefaultDeviceGroupsSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,8 +9,7 @@ */ public final class ProductsGenerateDefaultDeviceGroupsSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/ - * PostGenerateDefaultDeviceGroups.json + * x-ms-original-file: 2024-04-01/PostGenerateDefaultDeviceGroups.json */ /** * Sample code: Products_GenerateDefaultDeviceGroups. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsGetSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsGetSamples.java index c355f4377dcb6..dc1bf97cb2f15 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsGetSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,8 +9,7 @@ */ public final class ProductsGetSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetProduct.json + * x-ms-original-file: 2024-04-01/GetProduct.json */ /** * Sample code: Products_Get. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsListByCatalogSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsListByCatalogSamples.java index 0518ce64f8725..9b64e4334e597 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsListByCatalogSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsListByCatalogSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -9,8 +9,7 @@ */ public final class ProductsListByCatalogSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetProducts.json + * x-ms-original-file: 2024-04-01/GetProducts.json */ /** * Sample code: Products_ListByCatalog. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsUpdateSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsUpdateSamples.java index 58b204a769434..a538d87cef723 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsUpdateSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -11,8 +11,7 @@ */ public final class ProductsUpdateSamples { /* - * x-ms-original-file: - * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PatchProduct.json + * x-ms-original-file: 2024-04-01/PatchProduct.json */ /** * Sample code: Products_Update. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogInnerTests.java index f5860910910d6..95c66efb3244d 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogInnerTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -15,20 +15,20 @@ public final class CatalogInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CatalogInner model = BinaryData.fromString( - "{\"properties\":{\"tenantId\":\"vpjhulsuuv\",\"provisioningState\":\"Failed\"},\"location\":\"zkrwfn\",\"tags\":{\"jdpvwryo\":\"djpslw\",\"hbcryffdfdosyge\":\"psoacctazakljl\",\"rzevdphlxaol\":\"paojakhmsbzjh\"},\"id\":\"hqtrgqjbpf\",\"name\":\"fsinzgvfcjrwzoxx\",\"type\":\"tfell\"}") + "{\"properties\":{\"tenantId\":\"jbpzvgnwzsymg\",\"provisioningState\":\"Accepted\"},\"location\":\"cyzkohdbihanuf\",\"tags\":{\"s\":\"bj\"},\"id\":\"git\",\"name\":\"xqhabi\",\"type\":\"pikxwczbyscnpqxu\"}") .toObject(CatalogInner.class); - Assertions.assertEquals("zkrwfn", model.location()); - Assertions.assertEquals("djpslw", model.tags().get("jdpvwryo")); + Assertions.assertEquals("cyzkohdbihanuf", model.location()); + Assertions.assertEquals("bj", model.tags().get("s")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CatalogInner model = new CatalogInner().withLocation("zkrwfn") - .withTags(mapOf("jdpvwryo", "djpslw", "hbcryffdfdosyge", "psoacctazakljl", "rzevdphlxaol", "paojakhmsbzjh")) + CatalogInner model = new CatalogInner().withLocation("cyzkohdbihanuf") + .withTags(mapOf("s", "bj")) .withProperties(new CatalogProperties()); model = BinaryData.fromObject(model).toObject(CatalogInner.class); - Assertions.assertEquals("zkrwfn", model.location()); - Assertions.assertEquals("djpslw", model.tags().get("jdpvwryo")); + Assertions.assertEquals("cyzkohdbihanuf", model.location()); + Assertions.assertEquals("bj", model.tags().get("s")); } // Use "Map.of" if available diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogListResultTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogListResultTests.java index 65084dba3fe25..75b7d94d48d89 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogListResultTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogListResultTests.java @@ -1,50 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.CatalogInner; -import com.azure.resourcemanager.sphere.models.CatalogListResult; -import com.azure.resourcemanager.sphere.models.CatalogProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; +import com.azure.resourcemanager.sphere.implementation.models.CatalogListResult; import org.junit.jupiter.api.Assertions; public final class CatalogListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CatalogListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"tenantId\":\"ithxqhabifpi\",\"provisioningState\":\"Accepted\"},\"location\":\"zb\",\"tags\":{\"vyq\":\"npqxuh\",\"tfwvukxgaudc\":\"iwbybrkxvdumjg\",\"napczwlokjy\":\"snhsjcnyejhkryh\",\"oxzjnchgejspod\":\"mkkvnip\"},\"id\":\"ailzydehojwyahu\",\"name\":\"inpm\",\"type\":\"njaqwixjspro\"}],\"nextLink\":\"cputegjvwmfdats\"}") + "{\"value\":[{\"properties\":{\"tenantId\":\"rtfw\",\"provisioningState\":\"Canceled\"},\"location\":\"gaudcc\",\"tags\":{\"cnyejhkryhtnapcz\":\"s\"},\"id\":\"lokjyemkk\",\"name\":\"ni\",\"type\":\"joxzjnchgejspodm\"}],\"nextLink\":\"lzydehojwyahux\"}") .toObject(CatalogListResult.class); - Assertions.assertEquals("zb", model.value().get(0).location()); - Assertions.assertEquals("npqxuh", model.value().get(0).tags().get("vyq")); - Assertions.assertEquals("cputegjvwmfdats", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CatalogListResult model = new CatalogListResult().withValue(Arrays.asList(new CatalogInner().withLocation("zb") - .withTags(mapOf("vyq", "npqxuh", "tfwvukxgaudc", "iwbybrkxvdumjg", "napczwlokjy", "snhsjcnyejhkryh", - "oxzjnchgejspod", "mkkvnip")) - .withProperties(new CatalogProperties()))).withNextLink("cputegjvwmfdats"); - model = BinaryData.fromObject(model).toObject(CatalogListResult.class); - Assertions.assertEquals("zb", model.value().get(0).location()); - Assertions.assertEquals("npqxuh", model.value().get(0).tags().get("vyq")); - Assertions.assertEquals("cputegjvwmfdats", model.nextLink()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + Assertions.assertEquals("gaudcc", model.value().get(0).location()); + Assertions.assertEquals("s", model.value().get(0).tags().get("cnyejhkryhtnapcz")); + Assertions.assertEquals("lzydehojwyahux", model.nextLink()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogPropertiesTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogPropertiesTests.java index 6b9c7983e55ae..3043d63ee520c 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogPropertiesTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -10,7 +10,7 @@ public final class CatalogPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - CatalogProperties model = BinaryData.fromString("{\"tenantId\":\"fziton\",\"provisioningState\":\"Failed\"}") + CatalogProperties model = BinaryData.fromString("{\"tenantId\":\"vyq\",\"provisioningState\":\"Deleting\"}") .toObject(CatalogProperties.class); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogUpdateTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogUpdateTests.java index 94d41f62fe14a..472aae6c74ee1 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogUpdateTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogUpdateTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -13,19 +13,15 @@ public final class CatalogUpdateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - CatalogUpdate model = BinaryData - .fromString( - "{\"tags\":{\"ypininm\":\"jkjlxofpdvhpfx\",\"po\":\"yhuybbkpod\",\"ognarxzxtheotus\":\"ginuvamih\"}}") - .toObject(CatalogUpdate.class); - Assertions.assertEquals("jkjlxofpdvhpfx", model.tags().get("ypininm")); + CatalogUpdate model = BinaryData.fromString("{\"tags\":{\"xvd\":\"br\"}}").toObject(CatalogUpdate.class); + Assertions.assertEquals("br", model.tags().get("xvd")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CatalogUpdate model = new CatalogUpdate() - .withTags(mapOf("ypininm", "jkjlxofpdvhpfx", "po", "yhuybbkpod", "ognarxzxtheotus", "ginuvamih")); + CatalogUpdate model = new CatalogUpdate().withTags(mapOf("xvd", "br")); model = BinaryData.fromObject(model).toObject(CatalogUpdate.class); - Assertions.assertEquals("jkjlxofpdvhpfx", model.tags().get("ypininm")); + Assertions.assertEquals("br", model.tags().get("xvd")); } // Use "Map.of" if available diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsCountDevicesWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsCountDevicesWithResponseMockTests.java index 9bf49fb8c0aee..4378894c2206b 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsCountDevicesWithResponseMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsCountDevicesWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.CountDevicesResponse; @@ -20,19 +20,19 @@ public final class CatalogsCountDevicesWithResponseMockTests { @Test public void testCountDevicesWithResponse() throws Exception { - String responseStr = "{\"value\":1560245881}"; + String responseStr = "{\"value\":1879830205}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); CountDevicesResponse response = manager.catalogs() - .countDevicesWithResponse("cjooxdjebwpucwwf", "ovbvmeueciv", com.azure.core.util.Context.NONE) + .countDevicesWithResponse("hashsfwxosow", "xcug", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(1560245881, response.value()); + Assertions.assertEquals(1879830205, response.value()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsCreateOrUpdateMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsCreateOrUpdateMockTests.java index 14d5177b2428b..5963b9df2475a 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsCreateOrUpdateMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsCreateOrUpdateMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.Catalog; @@ -24,25 +24,25 @@ public final class CatalogsCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"tenantId\":\"yngudivk\",\"provisioningState\":\"Succeeded\"},\"location\":\"bxqz\",\"tags\":{\"e\":\"jfauvjfdxxi\"},\"id\":\"vtcqaqtdo\",\"name\":\"mcbxvwvxysl\",\"type\":\"bhsfxob\"}"; + = "{\"properties\":{\"tenantId\":\"ygmi\",\"provisioningState\":\"Succeeded\"},\"location\":\"zdnds\",\"tags\":{\"qlkth\":\"ayqigynduhav\",\"tgccymvaolpss\":\"maqolbgycduie\"},\"id\":\"qlfmmdnbb\",\"name\":\"lzpswiydm\",\"type\":\"wyhzdx\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Catalog response = manager.catalogs() - .define("zhxgktrmgucn") - .withRegion("lwptfdy") - .withExistingResourceGroup("medjvcslynqwwncw") - .withTags(mapOf("huaoppp", "qbuaceopzfqr", "z", "qeqxo", "moizpos", "ahzxctobgbk")) + .define("vasrruvwb") + .withRegion("bjf") + .withExistingResourceGroup("shqjohxcrsbf") + .withTags(mapOf("zbexilzznfqqnvw", "ssotftpv")) .withProperties(new CatalogProperties()) .create(); - Assertions.assertEquals("bxqz", response.location()); - Assertions.assertEquals("jfauvjfdxxi", response.tags().get("e")); + Assertions.assertEquals("zdnds", response.location()); + Assertions.assertEquals("ayqigynduhav", response.tags().get("qlkth")); } // Use "Map.of" if available diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsDeleteMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsDeleteMockTests.java index 8ffee9ee88336..59b3c4d065abd 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsDeleteMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsDeleteMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDelete() throws Exception { AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.catalogs().delete("hashsfwxosow", "xcug", com.azure.core.util.Context.NONE); + manager.catalogs().delete("kafkuwbcrnwbm", "hhseyv", com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsGetByResourceGroupWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsGetByResourceGroupWithResponseMockTests.java index b85a5ee9d6709..cd26e1f5590ed 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsGetByResourceGroupWithResponseMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsGetByResourceGroupWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.Catalog; @@ -21,20 +21,20 @@ public final class CatalogsGetByResourceGroupWithResponseMockTests { @Test public void testGetByResourceGroupWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"tenantId\":\"ag\",\"provisioningState\":\"Accepted\"},\"location\":\"elmqk\",\"tags\":{\"dhmdua\":\"hvljuahaquh\",\"pvfadmwsrcr\":\"aex\",\"fmisg\":\"vxpvgomz\"},\"id\":\"bnbbeldawkz\",\"name\":\"ali\",\"type\":\"urqhaka\"}"; + = "{\"properties\":{\"tenantId\":\"dxyt\",\"provisioningState\":\"Accepted\"},\"location\":\"rxv\",\"tags\":{\"zntxhdz\":\"dw\"},\"id\":\"lrqjbhckfr\",\"name\":\"hrxsbk\",\"type\":\"vpycanuzbp\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Catalog response = manager.catalogs() - .getByResourceGroupWithResponse("ehhseyvjusrts", "hspkdeemao", com.azure.core.util.Context.NONE) + .getByResourceGroupWithResponse("onobglaocqx", "ccm", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("elmqk", response.location()); - Assertions.assertEquals("hvljuahaquh", response.tags().get("dhmdua")); + Assertions.assertEquals("rxv", response.location()); + Assertions.assertEquals("dw", response.tags().get("zntxhdz")); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListByResourceGroupMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListByResourceGroupMockTests.java index 3736be42ed418..1d08a28e90021 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListByResourceGroupMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListByResourceGroupMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.Catalog; @@ -22,18 +22,19 @@ public final class CatalogsListByResourceGroupMockTests { @Test public void testListByResourceGroup() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"tenantId\":\"xy\",\"provisioningState\":\"Deleting\"},\"location\":\"yrxvwfudwpznt\",\"tags\":{\"ck\":\"zhlrqjb\",\"kyv\":\"rlhrxs\"},\"id\":\"ycanuzbpzkafku\",\"name\":\"b\",\"type\":\"rnwb\"}]}"; + = "{\"value\":[{\"properties\":{\"tenantId\":\"lhspkdee\",\"provisioningState\":\"Provisioning\"},\"location\":\"mx\",\"tags\":{\"elmqk\":\"vt\"},\"id\":\"hahvljuahaq\",\"name\":\"hcdhmdual\",\"type\":\"exq\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.catalogs().listByResourceGroup("g", com.azure.core.util.Context.NONE); + PagedIterable response + = manager.catalogs().listByResourceGroup("us", com.azure.core.util.Context.NONE); - Assertions.assertEquals("yrxvwfudwpznt", response.iterator().next().location()); - Assertions.assertEquals("zhlrqjb", response.iterator().next().tags().get("ck")); + Assertions.assertEquals("mx", response.iterator().next().location()); + Assertions.assertEquals("vt", response.iterator().next().tags().get("elmqk")); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeploymentsMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeploymentsMockTests.java index 8bfde429b343d..46961256728f9 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeploymentsMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeploymentsMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.Deployment; @@ -23,23 +23,23 @@ public final class CatalogsListDeploymentsMockTests { @Test public void testListDeployments() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"deploymentId\":\"jawgqwg\",\"deployedImages\":[{\"properties\":{\"image\":\"kxfbkpycgklwndn\",\"imageId\":\"dauwhvylwzbtd\",\"imageName\":\"ujznb\",\"regionalDataBoundary\":\"None\",\"uri\":\"uwprzql\",\"description\":\"ualupjmkh\",\"componentId\":\"obbc\",\"imageType\":\"CustomerBoardConfig\",\"provisioningState\":\"Updating\"},\"id\":\"riplrbpbewtg\",\"name\":\"fgb\",\"type\":\"c\"}],\"deploymentDateUtc\":\"2021-02-14T22:48:14Z\",\"provisioningState\":\"Accepted\"},\"id\":\"v\",\"name\":\"hjkbegibtnmxieb\",\"type\":\"waloayqcgwr\"}]}"; + = "{\"value\":[{\"properties\":{\"deploymentId\":\"ecivyh\",\"deployedImages\":[{\"properties\":{\"image\":\"jgjrwjueiotwm\",\"imageId\":\"ytdxwit\",\"imageName\":\"rjaw\",\"regionalDataBoundary\":\"None\",\"uri\":\"xhniskxfbkpycgk\",\"description\":\"ndnhj\",\"componentId\":\"uwhvylwzbtdhxujz\",\"imageType\":\"NormalWorldLoader\",\"provisioningState\":\"Accepted\"},\"id\":\"uwprzql\",\"name\":\"eualupjmkhf\",\"type\":\"obbc\"},{\"properties\":{\"image\":\"rtjriplrbpbew\",\"imageId\":\"hfgblc\",\"imageName\":\"xzvlvqhjkbegib\",\"regionalDataBoundary\":\"None\",\"uri\":\"iebwwaloayqcgwrt\",\"description\":\"uzgwyzmhtx\",\"componentId\":\"gmtsavjcbpwxqpsr\",\"imageType\":\"Services\",\"provisioningState\":\"Accepted\"},\"id\":\"vriuhprwmdyvx\",\"name\":\"tayriwwroyqbex\",\"type\":\"mcqibycnojv\"},{\"properties\":{\"image\":\"e\",\"imageId\":\"sgzvahapjyzhpv\",\"imageName\":\"zcjrvxdjzlmwlx\",\"regionalDataBoundary\":\"None\",\"uri\":\"fhzovawjvzunluth\",\"description\":\"prnxipeil\",\"componentId\":\"zuaejxd\",\"imageType\":\"RecoveryManifest\",\"provisioningState\":\"Deleting\"},\"id\":\"bbtdzumvee\",\"name\":\"gpw\",\"type\":\"zuhkfpbsjyof\"}],\"deploymentDateUtc\":\"2021-03-14T10:54:45Z\",\"provisioningState\":\"Canceled\"},\"id\":\"dttouwaboekqvkel\",\"name\":\"smv\",\"type\":\"xwyjsflhhc\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.catalogs() - .listDeployments("zceuojgjrw", "ueiotwmcdyt", "x", 384724385, 1665373545, 838785311, + .listDeployments("jooxdjebw", "ucww", "vo", 337559995, 1748456219, 812601807, com.azure.core.util.Context.NONE); - Assertions.assertEquals("jawgqwg", response.iterator().next().properties().deploymentId()); - Assertions.assertEquals("kxfbkpycgklwndn", + Assertions.assertEquals("ecivyh", response.iterator().next().properties().deploymentId()); + Assertions.assertEquals("jgjrwjueiotwm", response.iterator().next().properties().deployedImages().get(0).properties().image()); - Assertions.assertEquals("dauwhvylwzbtd", + Assertions.assertEquals("ytdxwit", response.iterator().next().properties().deployedImages().get(0).properties().imageId()); Assertions.assertEquals(RegionalDataBoundary.NONE, response.iterator().next().properties().deployedImages().get(0).properties().regionalDataBoundary()); diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceGroupsMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceGroupsMockTests.java index cdf204ce5d4c5..94d58521b02a7 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceGroupsMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceGroupsMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.AllowCrashDumpCollection; @@ -27,21 +27,20 @@ public final class CatalogsListDeviceGroupsMockTests { @Test public void testListDeviceGroups() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"description\":\"iwwroyqbexrmc\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Disabled\",\"regionalDataBoundary\":\"None\",\"hasDeployment\":true,\"provisioningState\":\"Accepted\"},\"id\":\"qsgzvahapj\",\"name\":\"zhpvgqzcjrvxd\",\"type\":\"zlmwlxkvugfhz\"}]}"; + = "{\"value\":[{\"properties\":{\"description\":\"bnxknalaulppg\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Disabled\",\"regionalDataBoundary\":\"None\",\"hasDeployment\":true,\"provisioningState\":\"Updating\"},\"id\":\"hpigv\",\"name\":\"gylgqgitxmedjvcs\",\"type\":\"ynqwwncwzzhxgk\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.catalogs() - .listDeviceGroups("zjuzgwyz", "htxongmtsavjc", - new ListDeviceGroupsRequest().withDeviceGroupName("wxqpsrknftguvri"), "hprwmdyv", 1468047146, - 1392355180, 1817218794, com.azure.core.util.Context.NONE); + .listDeviceGroups("aln", "ixisxyawjoy", new ListDeviceGroupsRequest().withDeviceGroupName("cslyjpk"), + "idzyexznelixhnr", 2120108327, 644635434, 231705927, com.azure.core.util.Context.NONE); - Assertions.assertEquals("iwwroyqbexrmc", response.iterator().next().properties().description()); + Assertions.assertEquals("bnxknalaulppg", response.iterator().next().properties().description()); Assertions.assertEquals(OSFeedType.RETAIL_EVAL, response.iterator().next().properties().osFeedType()); Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, response.iterator().next().properties().updatePolicy()); diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceInsightsMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceInsightsMockTests.java index 240c47df09d90..d33a8e4e8f8ca 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceInsightsMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceInsightsMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.DeviceInsight; @@ -22,28 +22,28 @@ public final class CatalogsListDeviceInsightsMockTests { @Test public void testListDeviceInsights() throws Exception { String responseStr - = "{\"value\":[{\"deviceId\":\"skzbb\",\"description\":\"dzumveekg\",\"startTimestampUtc\":\"2021-02-08T12:29:03Z\",\"endTimestampUtc\":\"2021-07-01T08:04:50Z\",\"eventCategory\":\"zuhkfpbsjyof\",\"eventClass\":\"xl\",\"eventType\":\"us\",\"eventCount\":1856979158}]}"; + = "{\"value\":[{\"deviceId\":\"gpfqbuace\",\"description\":\"pzfqrhhuaoppp\",\"startTimestampUtc\":\"2021-12-04T10:32:02Z\",\"endTimestampUtc\":\"2021-06-20T04:26:50Z\",\"eventCategory\":\"qxolzdahzx\",\"eventClass\":\"t\",\"eventType\":\"bgbkdmoizpost\",\"eventCount\":1176728044}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.catalogs() - .listDeviceInsights("vawjvzunlu", "hnnpr", "xipeilpjzuaejx", 677451354, 122222845, 1732418843, + .listDeviceInsights("rmgucnap", "t", "oellwp", 1750481006, 220477618, 1401142659, com.azure.core.util.Context.NONE); - Assertions.assertEquals("skzbb", response.iterator().next().deviceId()); - Assertions.assertEquals("dzumveekg", response.iterator().next().description()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-08T12:29:03Z"), + Assertions.assertEquals("gpfqbuace", response.iterator().next().deviceId()); + Assertions.assertEquals("pzfqrhhuaoppp", response.iterator().next().description()); + Assertions.assertEquals(OffsetDateTime.parse("2021-12-04T10:32:02Z"), response.iterator().next().startTimestampUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-01T08:04:50Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-06-20T04:26:50Z"), response.iterator().next().endTimestampUtc()); - Assertions.assertEquals("zuhkfpbsjyof", response.iterator().next().eventCategory()); - Assertions.assertEquals("xl", response.iterator().next().eventClass()); - Assertions.assertEquals("us", response.iterator().next().eventType()); - Assertions.assertEquals(1856979158, response.iterator().next().eventCount()); + Assertions.assertEquals("qxolzdahzx", response.iterator().next().eventCategory()); + Assertions.assertEquals("t", response.iterator().next().eventClass()); + Assertions.assertEquals("bgbkdmoizpost", response.iterator().next().eventType()); + Assertions.assertEquals(1176728044, response.iterator().next().eventCount()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDevicesMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDevicesMockTests.java index a14ed5a866a5e..19766d750bd58 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDevicesMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDevicesMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.Device; @@ -22,19 +22,19 @@ public final class CatalogsListDevicesMockTests { @Test public void testListDevices() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"deviceId\":\"joya\",\"chipSku\":\"slyjpkiid\",\"lastAvailableOsVersion\":\"exznelixhnr\",\"lastInstalledOsVersion\":\"folhbnxknal\",\"lastOsUpdateUtc\":\"2021-06-16T03:28:56Z\",\"lastUpdateRequestUtc\":\"2021-05-05T13:18:41Z\",\"provisioningState\":\"Deleting\"},\"id\":\"tpnapnyiropuhpig\",\"name\":\"pgylg\",\"type\":\"git\"}]}"; + = "{\"value\":[{\"properties\":{\"deviceId\":\"zvszj\",\"chipSku\":\"uvjfdxxive\",\"lastAvailableOsVersion\":\"t\",\"lastInstalledOsVersion\":\"aqtdoqmcbx\",\"lastOsUpdateUtc\":\"2021-11-29T03:42:10Z\",\"lastUpdateRequestUtc\":\"2021-02-11T04:09:09Z\",\"provisioningState\":\"Deleting\"},\"id\":\"bhsfxob\",\"name\":\"ytkblmpew\",\"type\":\"wfbkrvrns\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.catalogs() - .listDevices("touwaboekqv", "elnsmvbxw", "jsflhhcaalnjix", 923639125, 1143509001, 589324262, + .listDevices("rcfbunrm", "qjhhkxbpv", "ymjhxxjyngudivkr", 1501018415, 855265021, 1042702068, com.azure.core.util.Context.NONE); - Assertions.assertEquals("joya", response.iterator().next().properties().deviceId()); + Assertions.assertEquals("zvszj", response.iterator().next().properties().deviceId()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListMockTests.java index ee9f7e47fe160..2e2338bbcdca5 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.Catalog; @@ -22,18 +22,18 @@ public final class CatalogsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"tenantId\":\"nxdhbt\",\"provisioningState\":\"Provisioning\"},\"location\":\"ywpnvjt\",\"tags\":{\"abgy\":\"ermclfplphoxuscr\",\"qugxywpmueefjzwf\":\"psbjta\"},\"id\":\"kqujidsuyono\",\"name\":\"glaocq\",\"type\":\"tcc\"}]}"; + = "{\"value\":[{\"properties\":{\"tenantId\":\"adm\",\"provisioningState\":\"Deleting\"},\"location\":\"r\",\"tags\":{\"omzlfmi\":\"pv\",\"b\":\"gwb\"},\"id\":\"e\",\"name\":\"dawkzbali\",\"type\":\"urqhaka\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.catalogs().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("ywpnvjt", response.iterator().next().location()); - Assertions.assertEquals("ermclfplphoxuscr", response.iterator().next().tags().get("abgy")); + Assertions.assertEquals("r", response.iterator().next().location()); + Assertions.assertEquals("pv", response.iterator().next().tags().get("omzlfmi")); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificateChainResponseInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificateChainResponseInnerTests.java index 8f4a231aa5546..ba9d104a5f666 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificateChainResponseInnerTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificateChainResponseInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -10,13 +10,7 @@ public final class CertificateChainResponseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - CertificateChainResponseInner model - = BinaryData.fromString("{\"certificateChain\":\"cph\"}").toObject(CertificateChainResponseInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CertificateChainResponseInner model = new CertificateChainResponseInner(); - model = BinaryData.fromObject(model).toObject(CertificateChainResponseInner.class); + CertificateChainResponseInner model = BinaryData.fromString("{\"certificateChain\":\"izcdrqjsd\"}") + .toObject(CertificateChainResponseInner.class); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificateInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificateInnerTests.java index 9b8b53b83170c..2b90dcf17a2cb 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificateInnerTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificateInnerTests.java @@ -1,24 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.sphere.fluent.models.CertificateInner; -import com.azure.resourcemanager.sphere.models.CertificateProperties; public final class CertificateInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CertificateInner model = BinaryData.fromString( - "{\"properties\":{\"certificate\":\"oc\",\"status\":\"Inactive\",\"subject\":\"blgphuticn\",\"thumbprint\":\"kao\",\"expiryUtc\":\"2021-10-08T07:48:08Z\",\"notBeforeUtc\":\"2021-02-22T11:39:16Z\",\"provisioningState\":\"Updating\"},\"id\":\"xhurok\",\"name\":\"tyxolniwpwc\",\"type\":\"kjfkg\"}") + "{\"properties\":{\"certificate\":\"bczw\",\"status\":\"Inactive\",\"subject\":\"iqzbq\",\"thumbprint\":\"sovmyokacspkwl\",\"expiryUtc\":\"2021-04-27T23:18:31Z\",\"notBeforeUtc\":\"2021-05-25T01:26:18Z\",\"provisioningState\":\"Accepted\"},\"id\":\"mflbv\",\"name\":\"nchrkcciww\",\"type\":\"juqk\"}") .toObject(CertificateInner.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CertificateInner model = new CertificateInner().withProperties(new CertificateProperties()); - model = BinaryData.fromObject(model).toObject(CertificateInner.class); - } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificateListResultTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificateListResultTests.java index cf27aed5b76ff..3b7f86c751b7c 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificateListResultTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificateListResultTests.java @@ -1,34 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.CertificateInner; -import com.azure.resourcemanager.sphere.models.CertificateListResult; -import com.azure.resourcemanager.sphere.models.CertificateProperties; -import java.util.Arrays; +import com.azure.resourcemanager.sphere.implementation.models.CertificateListResult; import org.junit.jupiter.api.Assertions; public final class CertificateListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CertificateListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"certificate\":\"v\",\"status\":\"Inactive\",\"subject\":\"ihnhun\",\"thumbprint\":\"wjzrnfygxgisp\",\"expiryUtc\":\"2021-05-03T11:09:18Z\",\"notBeforeUtc\":\"2021-01-12T09:11:57Z\",\"provisioningState\":\"Accepted\"},\"id\":\"fublj\",\"name\":\"fxqeof\",\"type\":\"aeqjhqjbasvms\"},{\"properties\":{\"certificate\":\"ulngsntn\",\"status\":\"Expired\",\"subject\":\"zgcwrw\",\"thumbprint\":\"xxwr\",\"expiryUtc\":\"2021-07-19T21:40:35Z\",\"notBeforeUtc\":\"2021-04-09T18:31:52Z\",\"provisioningState\":\"Canceled\"},\"id\":\"qvkoc\",\"name\":\"cjdkwtnhxbnjbi\",\"type\":\"sqrglssainq\"},{\"properties\":{\"certificate\":\"nzl\",\"status\":\"Inactive\",\"subject\":\"ppeebvmgxsab\",\"thumbprint\":\"qduujitcjczdz\",\"expiryUtc\":\"2021-11-12T14:41:45Z\",\"notBeforeUtc\":\"2021-05-08T08:52:13Z\",\"provisioningState\":\"Deleting\"},\"id\":\"pdappds\",\"name\":\"dkvwrwjfe\",\"type\":\"snhu\"}],\"nextLink\":\"eltmrldhugjzzdat\"}") + "{\"value\":[{\"properties\":{\"certificate\":\"dyjrrfbyaosv\",\"status\":\"Expired\",\"subject\":\"onpc\",\"thumbprint\":\"ocohslkevleg\",\"expiryUtc\":\"2021-07-27T15:10:57Z\",\"notBeforeUtc\":\"2021-09-05T06:09:57Z\",\"provisioningState\":\"Updating\"},\"id\":\"vfaxkffeiith\",\"name\":\"vmezy\",\"type\":\"shxmzsbbzoggigrx\"},{\"properties\":{\"certificate\":\"rvjx\",\"status\":\"Revoked\",\"subject\":\"pydptko\",\"thumbprint\":\"kouknvudwtiu\",\"expiryUtc\":\"2021-08-10T13:58:21Z\",\"notBeforeUtc\":\"2021-07-01T14:11:39Z\",\"provisioningState\":\"Canceled\"},\"id\":\"ocipazyxoeg\",\"name\":\"kgjn\",\"type\":\"iucgygevqzn\"}],\"nextLink\":\"pmr\"}") .toObject(CertificateListResult.class); - Assertions.assertEquals("eltmrldhugjzzdat", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CertificateListResult model - = new CertificateListResult() - .withValue(Arrays.asList(new CertificateInner().withProperties(new CertificateProperties()), - new CertificateInner().withProperties(new CertificateProperties()), - new CertificateInner().withProperties(new CertificateProperties()))) - .withNextLink("eltmrldhugjzzdat"); - model = BinaryData.fromObject(model).toObject(CertificateListResult.class); - Assertions.assertEquals("eltmrldhugjzzdat", model.nextLink()); + Assertions.assertEquals("pmr", model.nextLink()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatePropertiesTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatePropertiesTests.java index c49965d7ba157..9e01c648357a3 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatePropertiesTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -11,13 +11,7 @@ public final class CertificatePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CertificateProperties model = BinaryData.fromString( - "{\"certificate\":\"w\",\"status\":\"Revoked\",\"subject\":\"ypl\",\"thumbprint\":\"kbasyypn\",\"expiryUtc\":\"2021-11-02T07:55:59Z\",\"notBeforeUtc\":\"2021-11-25T20:26:44Z\",\"provisioningState\":\"Accepted\"}") + "{\"certificate\":\"sa\",\"status\":\"Revoked\",\"subject\":\"uo\",\"thumbprint\":\"skghsauuimj\",\"expiryUtc\":\"2021-04-14T04:20:05Z\",\"notBeforeUtc\":\"2021-09-12T20:46:22Z\",\"provisioningState\":\"Deleting\"}") .toObject(CertificateProperties.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CertificateProperties model = new CertificateProperties(); - model = BinaryData.fromObject(model).toObject(CertificateProperties.class); - } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesGetWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesGetWithResponseMockTests.java index e40b786140b69..277cec81ab53f 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesGetWithResponseMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.Certificate; @@ -20,17 +20,17 @@ public final class CertificatesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"certificate\":\"fthnzdn\",\"status\":\"Active\",\"subject\":\"nayqi\",\"thumbprint\":\"nduhavhqlkthum\",\"expiryUtc\":\"2021-08-13T06:24:50Z\",\"notBeforeUtc\":\"2021-04-19T22:18:17Z\",\"provisioningState\":\"Accepted\"},\"id\":\"duiertgcc\",\"name\":\"mvaolps\",\"type\":\"lqlfm\"}"; + = "{\"properties\":{\"certificate\":\"hxsrzdzucersc\",\"status\":\"Active\",\"subject\":\"evfiwjmygt\",\"thumbprint\":\"slswtm\",\"expiryUtc\":\"2021-05-03T05:05:06Z\",\"notBeforeUtc\":\"2021-04-28T07:00:50Z\",\"provisioningState\":\"Canceled\"},\"id\":\"yqsemwa\",\"name\":\"n\",\"type\":\"tshhszhedp\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Certificate response = manager.certificates() - .getWithResponse("wqytjrybnwjewgdr", "ervnaenqpehi", "doy", com.azure.core.util.Context.NONE) + .getWithResponse("sadbz", "nvdfznuda", "dvxzbncblylpst", com.azure.core.util.Context.NONE) .getValue(); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesListByCatalogMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesListByCatalogMockTests.java index 68731c7dd05cc..ecf201e12e07d 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesListByCatalogMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesListByCatalogMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.Certificate; @@ -21,17 +21,17 @@ public final class CertificatesListByCatalogMockTests { @Test public void testListByCatalog() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"certificate\":\"uvwbhsqfs\",\"status\":\"Expired\",\"subject\":\"jbi\",\"thumbprint\":\"bpybsrfbjf\",\"expiryUtc\":\"2021-07-05T13:20:17Z\",\"notBeforeUtc\":\"2021-10-31T01:03:52Z\",\"provisioningState\":\"Updating\"},\"id\":\"tpvjzbexilzznfqq\",\"name\":\"vwpm\",\"type\":\"taruoujmkcj\"}]}"; + = "{\"value\":[{\"properties\":{\"certificate\":\"kvmkqzeqq\",\"status\":\"Active\",\"subject\":\"fzxmhhvhgureodkw\",\"thumbprint\":\"dagxtibqd\",\"expiryUtc\":\"2021-07-15T23:41:45Z\",\"notBeforeUtc\":\"2021-11-03T17:56:12Z\",\"provisioningState\":\"Failed\"},\"id\":\"gqxndlkzgxhuripl\",\"name\":\"podxunkb\",\"type\":\"bxmubyynt\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.certificates() - .listByCatalog("ytkblmpew", "wfbkrvrns", "shqjohxcrsbf", 249445305, 1210534043, 1966093769, + .listByCatalog("vwiwubmwmbesld", "k", "wtppjflcxogaoko", 204366319, 21704487, 1640463449, com.azure.core.util.Context.NONE); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveCertChainWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveCertChainWithResponseMockTests.java index dab51d61ec1de..c392c4e1bdb62 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveCertChainWithResponseMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveCertChainWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.CertificateChainResponse; @@ -19,18 +19,17 @@ public final class CertificatesRetrieveCertChainWithResponseMockTests { @Test public void testRetrieveCertChainWithResponse() throws Exception { - String responseStr = "{\"certificateChain\":\"dvxzbncblylpst\"}"; + String responseStr = "{\"certificateChain\":\"muwlauwzizxbm\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); CertificateChainResponse response = manager.certificates() - .retrieveCertChainWithResponse("dnbbglzps", "iydmcwyhzdxs", "adbzmnvdfznud", - com.azure.core.util.Context.NONE) + .retrieveCertChainWithResponse("lrb", "tkoievseotgq", "l", com.azure.core.util.Context.NONE) .getValue(); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveProofOfPossessionNonceWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveProofOfPossessionNonceWithResponseMockTests.java index ad5d4b9572610..c46b10939c060 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveProofOfPossessionNonceWithResponseMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveProofOfPossessionNonceWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.ProofOfPossessionNonceRequest; @@ -21,19 +21,18 @@ public final class CertificatesRetrieveProofOfPossessionNonceWithResponseMockTes @Test public void testRetrieveProofOfPossessionNonceWithResponse() throws Exception { String responseStr - = "{\"certificate\":\"mweriofzpy\",\"status\":\"Inactive\",\"subject\":\"wab\",\"thumbprint\":\"tshhszhedp\",\"expiryUtc\":\"2021-10-13T23:51:57Z\",\"notBeforeUtc\":\"2021-09-12T04:45:44Z\",\"provisioningState\":\"Succeeded\"}"; + = "{\"certificate\":\"ebmnzbtbhjpglk\",\"status\":\"Inactive\",\"subject\":\"dneu\",\"thumbprint\":\"fphsdyhtozfikdow\",\"expiryUtc\":\"2021-03-27T06:25:36Z\",\"notBeforeUtc\":\"2021-11-16T12:15:10Z\",\"provisioningState\":\"Deleting\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ProofOfPossessionNonceResponse response = manager.certificates() - .retrieveProofOfPossessionNonceWithResponse("bhhxsrzdzuc", "rsc", "ntnev", - new ProofOfPossessionNonceRequest().withProofOfPossessionNonce("iwjmygtdssls"), - com.azure.core.util.Context.NONE) + .retrieveProofOfPossessionNonceWithResponse("gcj", "fuzmuvpbtt", "um", + new ProofOfPossessionNonceRequest().withProofOfPossessionNonce("rp"), com.azure.core.util.Context.NONE) .getValue(); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ClaimDevicesRequestTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ClaimDevicesRequestTests.java index 157bd75444d16..6396f4ab60698 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ClaimDevicesRequestTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ClaimDevicesRequestTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -12,16 +12,17 @@ public final class ClaimDevicesRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ClaimDevicesRequest model = BinaryData.fromString("{\"deviceIdentifiers\":[\"wiyighxpkdw\",\"baiuebbaumny\"]}") - .toObject(ClaimDevicesRequest.class); - Assertions.assertEquals("wiyighxpkdw", model.deviceIdentifiers().get(0)); + ClaimDevicesRequest model + = BinaryData.fromString("{\"deviceIdentifiers\":[\"htldwk\",\"zxuutkncwscwsvl\",\"otogtwrupqs\"]}") + .toObject(ClaimDevicesRequest.class); + Assertions.assertEquals("htldwk", model.deviceIdentifiers().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ClaimDevicesRequest model - = new ClaimDevicesRequest().withDeviceIdentifiers(Arrays.asList("wiyighxpkdw", "baiuebbaumny")); + ClaimDevicesRequest model = new ClaimDevicesRequest() + .withDeviceIdentifiers(Arrays.asList("htldwk", "zxuutkncwscwsvl", "otogtwrupqs")); model = BinaryData.fromObject(model).toObject(ClaimDevicesRequest.class); - Assertions.assertEquals("wiyighxpkdw", model.deviceIdentifiers().get(0)); + Assertions.assertEquals("htldwk", model.deviceIdentifiers().get(0)); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CountDeviceResponseTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CountDeviceResponseTests.java deleted file mode 100644 index 5b91fb03e7476..0000000000000 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CountDeviceResponseTests.java +++ /dev/null @@ -1,24 +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.sphere.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.models.CountDeviceResponse; -import org.junit.jupiter.api.Assertions; - -public final class CountDeviceResponseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CountDeviceResponse model = BinaryData.fromString("{\"value\":329870770}").toObject(CountDeviceResponse.class); - Assertions.assertEquals(329870770, model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CountDeviceResponse model = new CountDeviceResponse().withValue(329870770); - model = BinaryData.fromObject(model).toObject(CountDeviceResponse.class); - Assertions.assertEquals(329870770, model.value()); - } -} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CountDevicesResponseInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CountDevicesResponseInnerTests.java index 234ac109554c5..0d5eedacb6a80 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CountDevicesResponseInnerTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CountDevicesResponseInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -12,14 +12,7 @@ public final class CountDevicesResponseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CountDevicesResponseInner model - = BinaryData.fromString("{\"value\":1041920176}").toObject(CountDevicesResponseInner.class); - Assertions.assertEquals(1041920176, model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CountDevicesResponseInner model = new CountDevicesResponseInner().withValue(1041920176); - model = BinaryData.fromObject(model).toObject(CountDevicesResponseInner.class); - Assertions.assertEquals(1041920176, model.value()); + = BinaryData.fromString("{\"value\":2053508957}").toObject(CountDevicesResponseInner.class); + Assertions.assertEquals(2053508957, model.value()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CountElementsResponseTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CountElementsResponseTests.java index 126ce4506c957..6188bddd281f4 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CountElementsResponseTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CountElementsResponseTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -12,14 +12,7 @@ public final class CountElementsResponseTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CountElementsResponse model - = BinaryData.fromString("{\"value\":494669618}").toObject(CountElementsResponse.class); - Assertions.assertEquals(494669618, model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CountElementsResponse model = new CountElementsResponse().withValue(494669618); - model = BinaryData.fromObject(model).toObject(CountElementsResponse.class); - Assertions.assertEquals(494669618, model.value()); + = BinaryData.fromString("{\"value\":1511051439}").toObject(CountElementsResponse.class); + Assertions.assertEquals(1511051439, model.value()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentInnerTests.java index a19370b9228f8..8a25292969659 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentInnerTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -17,37 +17,37 @@ public final class DeploymentInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DeploymentInner model = BinaryData.fromString( - "{\"properties\":{\"deploymentId\":\"jrmvdjwzrlo\",\"deployedImages\":[{\"properties\":{\"image\":\"hijco\",\"imageId\":\"ctbzaq\",\"imageName\":\"sycbkbfk\",\"regionalDataBoundary\":\"None\",\"uri\":\"kexxppof\",\"description\":\"axcfjpgddtocjjx\",\"componentId\":\"pmouexhdz\",\"imageType\":\"InvalidImageType\",\"provisioningState\":\"Accepted\"},\"id\":\"jnxqbzvddntwn\",\"name\":\"eic\",\"type\":\"twnpzaoqvuhrhcf\"},{\"properties\":{\"image\":\"ddglm\",\"imageId\":\"hjq\",\"imageName\":\"pyeicxm\",\"regionalDataBoundary\":\"None\",\"uri\":\"q\",\"description\":\"khixuigdtopbo\",\"componentId\":\"og\",\"imageType\":\"InvalidImageType\",\"provisioningState\":\"Deleting\"},\"id\":\"m\",\"name\":\"uhrzayvvt\",\"type\":\"gvdfgiotkftutq\"},{\"properties\":{\"image\":\"gxlefgugnxkrxd\",\"imageId\":\"i\",\"imageName\":\"thz\",\"regionalDataBoundary\":\"EU\",\"uri\":\"rabhjybigeho\",\"description\":\"bowsk\",\"componentId\":\"yktz\",\"imageType\":\"SecurityMonitor\",\"provisioningState\":\"Provisioning\"},\"id\":\"gqywgndrv\",\"name\":\"nhzgpphrcgyn\",\"type\":\"ocpecfvmmco\"},{\"properties\":{\"image\":\"xlzevgbmqjqabcy\",\"imageId\":\"ivkwlzuvccfwnfnb\",\"imageName\":\"fionl\",\"regionalDataBoundary\":\"None\",\"uri\":\"tqgtzxdpnqbqq\",\"description\":\"rjfeallnwsubisnj\",\"componentId\":\"pmng\",\"imageType\":\"FwConfig\",\"provisioningState\":\"Provisioning\"},\"id\":\"qwoochcbon\",\"name\":\"vpk\",\"type\":\"lrxnjeaseiphe\"}],\"deploymentDateUtc\":\"2021-04-05T14:36:27Z\",\"provisioningState\":\"Failed\"},\"id\":\"yyien\",\"name\":\"bdlwtgrhpdjpj\",\"type\":\"masxazjpqyegu\"}") + "{\"properties\":{\"deploymentId\":\"aeqjhqjbasvms\",\"deployedImages\":[{\"properties\":{\"image\":\"ngsntnbybk\",\"imageId\":\"cwrwclxxwrljdous\",\"imageName\":\"qvkoc\",\"regionalDataBoundary\":\"EU\",\"uri\":\"kwt\",\"description\":\"xbnjbiksq\",\"componentId\":\"lssai\",\"imageType\":\"CustomerBoardConfig\",\"provisioningState\":\"Failed\"},\"id\":\"zlljfmppeebvm\",\"name\":\"xsabkyqdu\",\"type\":\"jitcjczdzevn\"},{\"properties\":{\"image\":\"rwpdappdsbdkvwrw\",\"imageId\":\"eusnhutj\",\"imageName\":\"tmrldhugjzzdatq\",\"regionalDataBoundary\":\"None\",\"uri\":\"dgeablgphu\",\"description\":\"cndvkaozwyiftyhx\",\"componentId\":\"rokft\",\"imageType\":\"Policy\",\"provisioningState\":\"Accepted\"},\"id\":\"wpwcukjfkgiawxkl\",\"name\":\"ypl\",\"type\":\"ckbasyypndd\"},{\"properties\":{\"image\":\"cbacphejkotynqg\",\"imageId\":\"l\",\"imageName\":\"dlikwyqkgfgibma\",\"regionalDataBoundary\":\"None\",\"uri\":\"eqsrxybzqqedqyt\",\"description\":\"iqfouflmmnkz\",\"componentId\":\"odmgl\",\"imageType\":\"CustomerUpdateManifest\",\"provisioningState\":\"Provisioning\"},\"id\":\"wtmutduq\",\"name\":\"ta\",\"type\":\"spwgcuertumkdosv\"},{\"properties\":{\"image\":\"bmdg\",\"imageId\":\"jfddgmbmbe\",\"imageName\":\"pbhtqqrolfpfpsa\",\"regionalDataBoundary\":\"None\",\"uri\":\"uxig\",\"description\":\"jgzjaoyfhrtx\",\"componentId\":\"n\",\"imageType\":\"OneBl\",\"provisioningState\":\"Accepted\"},\"id\":\"s\",\"name\":\"l\",\"type\":\"juvf\"}],\"deploymentDateUtc\":\"2021-11-11T16:20:30Z\",\"provisioningState\":\"Canceled\"},\"id\":\"xwjkcprbnwbxg\",\"name\":\"vtb\",\"type\":\"p\"}") .toObject(DeploymentInner.class); - Assertions.assertEquals("jrmvdjwzrlo", model.properties().deploymentId()); - Assertions.assertEquals("hijco", model.properties().deployedImages().get(0).properties().image()); - Assertions.assertEquals("ctbzaq", model.properties().deployedImages().get(0).properties().imageId()); - Assertions.assertEquals(RegionalDataBoundary.NONE, + Assertions.assertEquals("aeqjhqjbasvms", model.properties().deploymentId()); + Assertions.assertEquals("ngsntnbybk", model.properties().deployedImages().get(0).properties().image()); + Assertions.assertEquals("cwrwclxxwrljdous", model.properties().deployedImages().get(0).properties().imageId()); + Assertions.assertEquals(RegionalDataBoundary.EU, model.properties().deployedImages().get(0).properties().regionalDataBoundary()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { DeploymentInner model - = new DeploymentInner().withProperties(new DeploymentProperties().withDeploymentId("jrmvdjwzrlo") + = new DeploymentInner().withProperties(new DeploymentProperties().withDeploymentId("aeqjhqjbasvms") .withDeployedImages(Arrays.asList( - new ImageInner().withProperties(new ImageProperties().withImage("hijco") - .withImageId("ctbzaq") + new ImageInner().withProperties(new ImageProperties().withImage("ngsntnbybk") + .withImageId("cwrwclxxwrljdous") + .withRegionalDataBoundary(RegionalDataBoundary.EU)), + new ImageInner().withProperties(new ImageProperties().withImage("rwpdappdsbdkvwrw") + .withImageId("eusnhutj") .withRegionalDataBoundary(RegionalDataBoundary.NONE)), - new ImageInner().withProperties(new ImageProperties().withImage("ddglm") - .withImageId("hjq") + new ImageInner().withProperties(new ImageProperties().withImage("cbacphejkotynqg") + .withImageId("l") .withRegionalDataBoundary(RegionalDataBoundary.NONE)), - new ImageInner().withProperties(new ImageProperties().withImage("gxlefgugnxkrxd") - .withImageId("i") - .withRegionalDataBoundary(RegionalDataBoundary.EU)), - new ImageInner().withProperties(new ImageProperties().withImage("xlzevgbmqjqabcy") - .withImageId("ivkwlzuvccfwnfnb") + new ImageInner().withProperties(new ImageProperties().withImage("bmdg") + .withImageId("jfddgmbmbe") .withRegionalDataBoundary(RegionalDataBoundary.NONE))))); model = BinaryData.fromObject(model).toObject(DeploymentInner.class); - Assertions.assertEquals("jrmvdjwzrlo", model.properties().deploymentId()); - Assertions.assertEquals("hijco", model.properties().deployedImages().get(0).properties().image()); - Assertions.assertEquals("ctbzaq", model.properties().deployedImages().get(0).properties().imageId()); - Assertions.assertEquals(RegionalDataBoundary.NONE, + Assertions.assertEquals("aeqjhqjbasvms", model.properties().deploymentId()); + Assertions.assertEquals("ngsntnbybk", model.properties().deployedImages().get(0).properties().image()); + Assertions.assertEquals("cwrwclxxwrljdous", model.properties().deployedImages().get(0).properties().imageId()); + Assertions.assertEquals(RegionalDataBoundary.EU, model.properties().deployedImages().get(0).properties().regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentListResultTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentListResultTests.java index 697d0c3b2bab6..75dc1ac257a79 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentListResultTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentListResultTests.java @@ -1,37 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.DeploymentInner; -import com.azure.resourcemanager.sphere.fluent.models.ImageInner; -import com.azure.resourcemanager.sphere.models.DeploymentListResult; -import com.azure.resourcemanager.sphere.models.DeploymentProperties; -import com.azure.resourcemanager.sphere.models.ImageProperties; -import java.util.Arrays; +import com.azure.resourcemanager.sphere.implementation.models.DeploymentListResult; import org.junit.jupiter.api.Assertions; public final class DeploymentListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DeploymentListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"deploymentId\":\"jmkljavbqidtqajz\",\"deployedImages\":[{\"properties\":{},\"id\":\"u\",\"name\":\"jkrlkhbzhfepg\",\"type\":\"gqexzlocxs\"}],\"deploymentDateUtc\":\"2021-11-18T07:05:01Z\",\"provisioningState\":\"Canceled\"},\"id\":\"hhbcsglummajtjao\",\"name\":\"xobnbdxkqpxok\",\"type\":\"jionpimexgstxgc\"}],\"nextLink\":\"dg\"}") + "{\"value\":[{\"properties\":{\"deploymentId\":\"jaqwixjsp\",\"deployedImages\":[{\"properties\":{},\"id\":\"putegjvwmfd\",\"name\":\"t\",\"type\":\"cmdv\"},{\"properties\":{},\"id\":\"u\",\"name\":\"suuv\",\"type\":\"kjozkrwfnd\"},{\"properties\":{},\"id\":\"jpslwejd\",\"name\":\"vwryoqpso\",\"type\":\"cctazakljlahbc\"},{\"properties\":{},\"id\":\"fdfdosygexpa\",\"name\":\"jakhmsbzjh\",\"type\":\"rzevdphlxaol\"}],\"deploymentDateUtc\":\"2021-07-01T23:02:37Z\",\"provisioningState\":\"Canceled\"},\"id\":\"qjbpfzfsin\",\"name\":\"gvfcj\",\"type\":\"wzo\"},{\"properties\":{\"deploymentId\":\"tfell\",\"deployedImages\":[{\"properties\":{},\"id\":\"tonpe\",\"name\":\"fpjkjlxofp\",\"type\":\"vhpfxxypininmay\"},{\"properties\":{},\"id\":\"bbkpodep\",\"name\":\"oginuvamiheognar\",\"type\":\"zxtheotusivyevcc\"}],\"deploymentDateUtc\":\"2021-09-11T13:19:30Z\",\"provisioningState\":\"Deleting\"},\"id\":\"un\",\"name\":\"bwjzr\",\"type\":\"fygxgispemvtzfk\"}],\"nextLink\":\"ubljofxqe\"}") .toObject(DeploymentListResult.class); - Assertions.assertEquals("jmkljavbqidtqajz", model.value().get(0).properties().deploymentId()); - Assertions.assertEquals("dg", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeploymentListResult model = new DeploymentListResult() - .withValue(Arrays.asList( - new DeploymentInner().withProperties(new DeploymentProperties().withDeploymentId("jmkljavbqidtqajz") - .withDeployedImages(Arrays.asList(new ImageInner().withProperties(new ImageProperties())))))) - .withNextLink("dg"); - model = BinaryData.fromObject(model).toObject(DeploymentListResult.class); - Assertions.assertEquals("jmkljavbqidtqajz", model.value().get(0).properties().deploymentId()); - Assertions.assertEquals("dg", model.nextLink()); + Assertions.assertEquals("jaqwixjsp", model.value().get(0).properties().deploymentId()); + Assertions.assertEquals("ubljofxqe", model.nextLink()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentPropertiesTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentPropertiesTests.java index 42b3330ba4282..ce17abd0ea20f 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentPropertiesTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -16,30 +16,30 @@ public final class DeploymentPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DeploymentProperties model = BinaryData.fromString( - "{\"deploymentId\":\"hb\",\"deployedImages\":[{\"properties\":{\"image\":\"jzzvdud\",\"imageId\":\"dslfhotwmcy\",\"imageName\":\"wlbjnpgacftade\",\"regionalDataBoundary\":\"EU\",\"uri\":\"tyfsoppusuesn\",\"description\":\"dejbavo\",\"componentId\":\"zdmohctbqvu\",\"imageType\":\"BaseSystemUpdateManifest\",\"provisioningState\":\"Canceled\"},\"id\":\"nvowgujju\",\"name\":\"wdkcglhsl\",\"type\":\"zj\"},{\"properties\":{\"image\":\"gdtjixhbkuofqwey\",\"imageId\":\"menevfyexfwh\",\"imageName\":\"cibvyvdcsitynn\",\"regionalDataBoundary\":\"EU\",\"uri\":\"ectehf\",\"description\":\"scjeypv\",\"componentId\":\"zrkgqhcjrefovg\",\"imageType\":\"CustomerBoardConfig\",\"provisioningState\":\"Succeeded\"},\"id\":\"yyvxyqjpkcattpn\",\"name\":\"jcrcczsqpjhvmda\",\"type\":\"v\"}],\"deploymentDateUtc\":\"2021-09-30T19:57Z\",\"provisioningState\":\"Failed\"}") + "{\"deploymentId\":\"szdnr\",\"deployedImages\":[{\"properties\":{\"image\":\"hmuouqfprwzwbn\",\"imageId\":\"itnwuizgazxufi\",\"imageName\":\"ckyfih\",\"regionalDataBoundary\":\"None\",\"uri\":\"fvzwdzuhty\",\"description\":\"isdkfthwxmnteiw\",\"componentId\":\"pvkmijcmmxdcuf\",\"imageType\":\"FwConfig\",\"provisioningState\":\"Accepted\"},\"id\":\"mzidnsezcxtb\",\"name\":\"sgfyccsnew\",\"type\":\"dwzjeiach\"},{\"properties\":{\"image\":\"sflnrosfqp\",\"imageId\":\"ehzzvypyqrim\",\"imageName\":\"npvswjdkirso\",\"regionalDataBoundary\":\"None\",\"uri\":\"hc\",\"description\":\"nohjt\",\"componentId\":\"whdsoifiyip\",\"imageType\":\"OneBl\",\"provisioningState\":\"Provisioning\"},\"id\":\"gr\",\"name\":\"bznorcjxvsnby\",\"type\":\"qabnmoc\"}],\"deploymentDateUtc\":\"2021-06-01T07:07:44Z\",\"provisioningState\":\"Canceled\"}") .toObject(DeploymentProperties.class); - Assertions.assertEquals("hb", model.deploymentId()); - Assertions.assertEquals("jzzvdud", model.deployedImages().get(0).properties().image()); - Assertions.assertEquals("dslfhotwmcy", model.deployedImages().get(0).properties().imageId()); - Assertions.assertEquals(RegionalDataBoundary.EU, + Assertions.assertEquals("szdnr", model.deploymentId()); + Assertions.assertEquals("hmuouqfprwzwbn", model.deployedImages().get(0).properties().image()); + Assertions.assertEquals("itnwuizgazxufi", model.deployedImages().get(0).properties().imageId()); + Assertions.assertEquals(RegionalDataBoundary.NONE, model.deployedImages().get(0).properties().regionalDataBoundary()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DeploymentProperties model = new DeploymentProperties().withDeploymentId("hb") + DeploymentProperties model = new DeploymentProperties().withDeploymentId("szdnr") .withDeployedImages(Arrays.asList( - new ImageInner().withProperties(new ImageProperties().withImage("jzzvdud") - .withImageId("dslfhotwmcy") - .withRegionalDataBoundary(RegionalDataBoundary.EU)), - new ImageInner().withProperties(new ImageProperties().withImage("gdtjixhbkuofqwey") - .withImageId("menevfyexfwh") - .withRegionalDataBoundary(RegionalDataBoundary.EU)))); + new ImageInner().withProperties(new ImageProperties().withImage("hmuouqfprwzwbn") + .withImageId("itnwuizgazxufi") + .withRegionalDataBoundary(RegionalDataBoundary.NONE)), + new ImageInner().withProperties(new ImageProperties().withImage("sflnrosfqp") + .withImageId("ehzzvypyqrim") + .withRegionalDataBoundary(RegionalDataBoundary.NONE)))); model = BinaryData.fromObject(model).toObject(DeploymentProperties.class); - Assertions.assertEquals("hb", model.deploymentId()); - Assertions.assertEquals("jzzvdud", model.deployedImages().get(0).properties().image()); - Assertions.assertEquals("dslfhotwmcy", model.deployedImages().get(0).properties().imageId()); - Assertions.assertEquals(RegionalDataBoundary.EU, + Assertions.assertEquals("szdnr", model.deploymentId()); + Assertions.assertEquals("hmuouqfprwzwbn", model.deployedImages().get(0).properties().image()); + Assertions.assertEquals("itnwuizgazxufi", model.deployedImages().get(0).properties().imageId()); + Assertions.assertEquals(RegionalDataBoundary.NONE, model.deployedImages().get(0).properties().regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsCreateOrUpdateMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsCreateOrUpdateMockTests.java index 5ca9298d2219f..0a3aa7e2a4ae9 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsCreateOrUpdateMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsCreateOrUpdateMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.fluent.models.ImageInner; @@ -26,32 +26,32 @@ public final class DeploymentsCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"deploymentId\":\"wib\",\"deployedImages\":[{\"properties\":{\"image\":\"bhshfwpracstwity\",\"imageId\":\"evxccedcp\",\"imageName\":\"dyodnwzxltj\",\"regionalDataBoundary\":\"EU\",\"uri\":\"ltiugcxnavv\",\"description\":\"qiby\",\"componentId\":\"nyowxwlmdjrkvfg\",\"imageType\":\"FwConfig\",\"provisioningState\":\"Updating\"},\"id\":\"bodacizsjq\",\"name\":\"hkr\",\"type\":\"ibdeibq\"}],\"deploymentDateUtc\":\"2021-10-05T18:29:09Z\",\"provisioningState\":\"Succeeded\"},\"id\":\"vxndz\",\"name\":\"mkrefajpjorwkq\",\"type\":\"yhgbijtjivfx\"}"; + = "{\"properties\":{\"deploymentId\":\"j\",\"deployedImages\":[{\"properties\":{\"image\":\"zxiavrm\",\"imageId\":\"onok\",\"imageName\":\"rjqc\",\"regionalDataBoundary\":\"None\",\"uri\":\"pfrlazsz\",\"description\":\"woiindf\",\"componentId\":\"pj\",\"imageType\":\"UpdateCertStore\",\"provisioningState\":\"Accepted\"},\"id\":\"h\",\"name\":\"lsj\",\"type\":\"dhszfjv\"},{\"properties\":{\"image\":\"ofel\",\"imageId\":\"grqmqhldvrii\",\"imageName\":\"jnalghf\",\"regionalDataBoundary\":\"EU\",\"uri\":\"sexso\",\"description\":\"el\",\"componentId\":\"hhahhxvrhmzkwpjg\",\"imageType\":\"ManifestSet\",\"provisioningState\":\"Updating\"},\"id\":\"hftqsxhqxujxukn\",\"name\":\"xdigrjg\",\"type\":\"ufzdmsyq\"},{\"properties\":{\"image\":\"hwhbotzingamv\",\"imageId\":\"ho\",\"imageName\":\"qzudphq\",\"regionalDataBoundary\":\"EU\",\"uri\":\"kfwynw\",\"description\":\"tbvkayhmtnvyq\",\"componentId\":\"tkzwpcnpwzc\",\"imageType\":\"BootManifest\",\"provisioningState\":\"Canceled\"},\"id\":\"v\",\"name\":\"ccyajg\",\"type\":\"qfhwyg\"}],\"deploymentDateUtc\":\"2020-12-30T23:23:57Z\",\"provisioningState\":\"Succeeded\"},\"id\":\"fxusemdwzr\",\"name\":\"uh\",\"type\":\"pfcqdp\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Deployment response = manager.deployments() - .define("wpusdsttwvogv") - .withExistingDeviceGroup("bykutw", "fhpagmhrskdsnf", "sd", "akgtdlmkkzevdlh") - .withProperties(new DeploymentProperties().withDeploymentId("jdcngqqm") + .define("y") + .withExistingDeviceGroup("nmdyodnwzxl", "jc", "nhltiugcxn", "vvwxqi") + .withProperties(new DeploymentProperties().withDeploymentId("y") .withDeployedImages(Arrays.asList( - new ImageInner().withProperties(new ImageProperties().withImage("gm") - .withImageId("rwr") + new ImageInner().withProperties(new ImageProperties().withImage("mdjrkvfgbvfvp") + .withImageId("odacizs") .withRegionalDataBoundary(RegionalDataBoundary.NONE)), - new ImageInner().withProperties(new ImageProperties().withImage("kaivwit") - .withImageId("cywuggwol") + new ImageInner().withProperties(new ImageProperties().withImage("jjklff") + .withImageId("ouw") .withRegionalDataBoundary(RegionalDataBoundary.EU))))) .create(); - Assertions.assertEquals("wib", response.properties().deploymentId()); - Assertions.assertEquals("bhshfwpracstwity", response.properties().deployedImages().get(0).properties().image()); - Assertions.assertEquals("evxccedcp", response.properties().deployedImages().get(0).properties().imageId()); - Assertions.assertEquals(RegionalDataBoundary.EU, + Assertions.assertEquals("j", response.properties().deploymentId()); + Assertions.assertEquals("zxiavrm", response.properties().deployedImages().get(0).properties().image()); + Assertions.assertEquals("onok", response.properties().deployedImages().get(0).properties().imageId()); + Assertions.assertEquals(RegionalDataBoundary.NONE, response.properties().deployedImages().get(0).properties().regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsDeleteMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsDeleteMockTests.java index 9bf65f164599f..5ddabd19bf0b6 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsDeleteMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsDeleteMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import java.nio.charset.StandardCharsets; @@ -25,11 +25,9 @@ public void testDelete() throws Exception { AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.deployments() - .delete("toego", "dwbwhkszzcmrvexz", "vbtqgsfraoyzk", "owtlmnguxawqald", "yuuximerqfobwyzn", - com.azure.core.util.Context.NONE); + manager.deployments().delete("l", "wabm", "oefki", "rvtp", "qujmqlgkf", com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsGetWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsGetWithResponseMockTests.java index 4cbfe81adbfae..6198fe733d744 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsGetWithResponseMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.Deployment; @@ -22,23 +22,23 @@ public final class DeploymentsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"deploymentId\":\"qdpfuvglsbjjca\",\"deployedImages\":[{\"properties\":{\"image\":\"t\",\"imageId\":\"dut\",\"imageName\":\"ormrlxqtvcofudfl\",\"regionalDataBoundary\":\"None\",\"uri\":\"u\",\"description\":\"dknnqvsazn\",\"componentId\":\"tor\",\"imageType\":\"Policy\",\"provisioningState\":\"Succeeded\"},\"id\":\"hmk\",\"name\":\"c\",\"type\":\"rauwjuetaebu\"},{\"properties\":{\"image\":\"dmovsm\",\"imageId\":\"xwabmqoe\",\"imageName\":\"ifrvtpu\",\"regionalDataBoundary\":\"None\",\"uri\":\"qlgkfbtn\",\"description\":\"aongbj\",\"componentId\":\"tujitcjedft\",\"imageType\":\"BaseSystemUpdateManifest\",\"provisioningState\":\"Updating\"},\"id\":\"ojvdcpzfoqo\",\"name\":\"i\",\"type\":\"ybxarzgszu\"}],\"deploymentDateUtc\":\"2021-07-26T12:22:12Z\",\"provisioningState\":\"Canceled\"},\"id\":\"opidoamciodh\",\"name\":\"haz\",\"type\":\"khnzbonlw\"}"; + = "{\"properties\":{\"deploymentId\":\"e\",\"deployedImages\":[{\"properties\":{\"image\":\"kfzbeyvpnqicvi\",\"imageId\":\"kjj\",\"imageName\":\"xrbuukzclew\",\"regionalDataBoundary\":\"None\",\"uri\":\"wp\",\"description\":\"tzpofncckwyfzq\",\"componentId\":\"xxbuyq\",\"imageType\":\"NormalWorldLoader\",\"provisioningState\":\"Succeeded\"},\"id\":\"ztppriolxorjalto\",\"name\":\"mncwsobqwcsdb\",\"type\":\"wdcfhucqdpfuv\"},{\"properties\":{\"image\":\"bjj\",\"imageId\":\"nvxbvt\",\"imageName\":\"dut\",\"regionalDataBoundary\":\"EU\",\"uri\":\"mr\",\"description\":\"qtvcofudflvkgj\",\"componentId\":\"gdknnqv\",\"imageType\":\"ManifestSet\",\"provisioningState\":\"Provisioning\"},\"id\":\"tor\",\"name\":\"dsg\",\"type\":\"a\"}],\"deploymentDateUtc\":\"2021-06-13T19:03:44Z\",\"provisioningState\":\"Succeeded\"},\"id\":\"rauwjuetaebu\",\"name\":\"u\",\"type\":\"dmovsm\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Deployment response = manager.deployments() - .getWithResponse("cckwyfzqwhxxbu", "qa", "zfeqztppri", "lxorjaltolmncws", "bqwcsdbnwdcf", + .getWithResponse("nfwjlfltkacjvefk", "lfoakg", "kfpagao", "pulpqblylsyxk", "jnsjervtiagxsd", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("qdpfuvglsbjjca", response.properties().deploymentId()); - Assertions.assertEquals("t", response.properties().deployedImages().get(0).properties().image()); - Assertions.assertEquals("dut", response.properties().deployedImages().get(0).properties().imageId()); + Assertions.assertEquals("e", response.properties().deploymentId()); + Assertions.assertEquals("kfzbeyvpnqicvi", response.properties().deployedImages().get(0).properties().image()); + Assertions.assertEquals("kjj", response.properties().deployedImages().get(0).properties().imageId()); Assertions.assertEquals(RegionalDataBoundary.NONE, response.properties().deployedImages().get(0).properties().regionalDataBoundary()); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsListByDeviceGroupMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsListByDeviceGroupMockTests.java index f1624f66b4d78..61f71a086226b 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsListByDeviceGroupMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsListByDeviceGroupMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.Deployment; @@ -23,23 +23,23 @@ public final class DeploymentsListByDeviceGroupMockTests { @Test public void testListByDeviceGroup() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"deploymentId\":\"wmewzsyy\",\"deployedImages\":[{\"properties\":{\"image\":\"oibjudpfrxtrthz\",\"imageId\":\"ytdw\",\"imageName\":\"brqubp\",\"regionalDataBoundary\":\"None\",\"uri\":\"xiilivpdtiirqt\",\"description\":\"oaxoruzfgsqu\",\"componentId\":\"xrxxlep\",\"imageType\":\"OneBl\",\"provisioningState\":\"Deleting\"},\"id\":\"ezw\",\"name\":\"wnwxuqlcvyd\",\"type\":\"patdooaojkniodko\"},{\"properties\":{\"image\":\"wnujhemmsbvdk\",\"imageId\":\"odtji\",\"imageName\":\"wj\",\"regionalDataBoundary\":\"None\",\"uri\":\"kacjvefkdlfo\",\"description\":\"ggkfpagaowpul\",\"componentId\":\"blylsyxkqjnsj\",\"imageType\":\"UpdateCertStore\",\"provisioningState\":\"Succeeded\"},\"id\":\"gxsds\",\"name\":\"uem\",\"type\":\"sbzkf\"}],\"deploymentDateUtc\":\"2021-06-16T01:14:17Z\",\"provisioningState\":\"Failed\"},\"id\":\"nqicvinvkjjxdxrb\",\"name\":\"ukzclewyhmlwpaz\",\"type\":\"zpof\"}]}"; + = "{\"value\":[{\"properties\":{\"deploymentId\":\"opidoamciodh\",\"deployedImages\":[{\"properties\":{\"image\":\"khnzbonlw\",\"imageId\":\"oegokdwbwh\",\"imageName\":\"z\",\"regionalDataBoundary\":\"None\",\"uri\":\"vexztvbtqgs\",\"description\":\"aoyzkoow\",\"componentId\":\"mnguxawqaldsyu\",\"imageType\":\"Other\",\"provisioningState\":\"Provisioning\"},\"id\":\"qfobwyz\",\"name\":\"kby\",\"type\":\"utwpfhp\"},{\"properties\":{\"image\":\"hrskdsnfd\",\"imageId\":\"oakgtdlmkkzev\",\"imageName\":\"hewpusdsttwv\",\"regionalDataBoundary\":\"EU\",\"uri\":\"bejdcn\",\"description\":\"qmoa\",\"componentId\":\"fgmjzrwrdgrt\",\"imageType\":\"BootManifest\",\"provisioningState\":\"Deleting\"},\"id\":\"zkopb\",\"name\":\"inrfdwoyu\",\"type\":\"hziuiefozbhdms\"},{\"properties\":{\"image\":\"zqhof\",\"imageId\":\"maequiahxicslfa\",\"imageName\":\"z\",\"regionalDataBoundary\":\"EU\",\"uri\":\"lhalnswh\",\"description\":\"sp\",\"componentId\":\"aivwitqscywu\",\"imageType\":\"Applications\",\"provisioningState\":\"Succeeded\"},\"id\":\"h\",\"name\":\"zbwemh\",\"type\":\"i\"},{\"properties\":{\"image\":\"rgzdwmsweyp\",\"imageId\":\"dxggicccnxqhuexm\",\"imageName\":\"tlstvlzywem\",\"regionalDataBoundary\":\"EU\",\"uri\":\"csdtclusiypbs\",\"description\":\"ytguslf\",\"componentId\":\"dcygqukyhejhz\",\"imageType\":\"NormalWorldDtb\",\"provisioningState\":\"Provisioning\"},\"id\":\"elolppvksrpqvuj\",\"name\":\"raehtwdwrft\",\"type\":\"wib\"}],\"deploymentDateUtc\":\"2021-11-04T23:57:55Z\",\"provisioningState\":\"Deleting\"},\"id\":\"h\",\"name\":\"hfwpracstwit\",\"type\":\"khevxccedc\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.deployments() - .listByDeviceGroup("cqqudf", "byxbaaabjy", "ayffim", "zrtuzq", "gsexne", 850324011, 779817958, 1536688095, - com.azure.core.util.Context.NONE); + .listByDeviceGroup("tndoaongbjc", "tujitcjedft", "waezkojvd", "pzfoqoui", "ybxarzgszu", 1813944379, + 37759464, 122630062, com.azure.core.util.Context.NONE); - Assertions.assertEquals("wmewzsyy", response.iterator().next().properties().deploymentId()); - Assertions.assertEquals("oibjudpfrxtrthz", + Assertions.assertEquals("opidoamciodh", response.iterator().next().properties().deploymentId()); + Assertions.assertEquals("khnzbonlw", response.iterator().next().properties().deployedImages().get(0).properties().image()); - Assertions.assertEquals("ytdw", + Assertions.assertEquals("oegokdwbwh", response.iterator().next().properties().deployedImages().get(0).properties().imageId()); Assertions.assertEquals(RegionalDataBoundary.NONE, response.iterator().next().properties().deployedImages().get(0).properties().regionalDataBoundary()); diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupInnerTests.java index c1e4d80143536..0695b0c3174db 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupInnerTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -17,9 +17,9 @@ public final class DeviceGroupInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DeviceGroupInner model = BinaryData.fromString( - "{\"properties\":{\"description\":\"d\",\"osFeedType\":\"Retail\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Enabled\",\"regionalDataBoundary\":\"EU\",\"hasDeployment\":true,\"provisioningState\":\"Canceled\"},\"id\":\"czwtruwiqzbqjv\",\"name\":\"ovm\",\"type\":\"okacspk\"}") + "{\"properties\":{\"description\":\"u\",\"osFeedType\":\"Retail\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Enabled\",\"regionalDataBoundary\":\"EU\",\"hasDeployment\":true,\"provisioningState\":\"Updating\"},\"id\":\"vdfgiotk\",\"name\":\"tutqxlngxlefgug\",\"type\":\"xkrxdqmi\"}") .toObject(DeviceGroupInner.class); - Assertions.assertEquals("d", model.properties().description()); + Assertions.assertEquals("u", model.properties().description()); Assertions.assertEquals(OSFeedType.RETAIL, model.properties().osFeedType()); Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, model.properties().updatePolicy()); Assertions.assertEquals(AllowCrashDumpCollection.ENABLED, model.properties().allowCrashDumpsCollection()); @@ -28,13 +28,13 @@ public void testDeserialize() throws Exception { @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DeviceGroupInner model = new DeviceGroupInner().withProperties(new DeviceGroupProperties().withDescription("d") + DeviceGroupInner model = new DeviceGroupInner().withProperties(new DeviceGroupProperties().withDescription("u") .withOsFeedType(OSFeedType.RETAIL) .withUpdatePolicy(UpdatePolicy.NO3RD_PARTY_APP_UPDATES) .withAllowCrashDumpsCollection(AllowCrashDumpCollection.ENABLED) .withRegionalDataBoundary(RegionalDataBoundary.EU)); model = BinaryData.fromObject(model).toObject(DeviceGroupInner.class); - Assertions.assertEquals("d", model.properties().description()); + Assertions.assertEquals("u", model.properties().description()); Assertions.assertEquals(OSFeedType.RETAIL, model.properties().osFeedType()); Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, model.properties().updatePolicy()); Assertions.assertEquals(AllowCrashDumpCollection.ENABLED, model.properties().allowCrashDumpsCollection()); diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupListResultTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupListResultTests.java index 5293fa9c4830e..a8831902937c3 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupListResultTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupListResultTests.java @@ -1,61 +1,29 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.DeviceGroupInner; +import com.azure.resourcemanager.sphere.implementation.models.DeviceGroupListResult; import com.azure.resourcemanager.sphere.models.AllowCrashDumpCollection; -import com.azure.resourcemanager.sphere.models.DeviceGroupListResult; -import com.azure.resourcemanager.sphere.models.DeviceGroupProperties; import com.azure.resourcemanager.sphere.models.OSFeedType; import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; import com.azure.resourcemanager.sphere.models.UpdatePolicy; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class DeviceGroupListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DeviceGroupListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"description\":\"oaeupfhyhltrpmo\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"UpdateAll\",\"allowCrashDumpsCollection\":\"Enabled\",\"regionalDataBoundary\":\"None\",\"hasDeployment\":true,\"provisioningState\":\"Failed\"},\"id\":\"iuaod\",\"name\":\"fcp\",\"type\":\"vxodpu\"},{\"properties\":{\"description\":\"yzydagfuaxbezyi\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Disabled\",\"regionalDataBoundary\":\"EU\",\"hasDeployment\":false,\"provisioningState\":\"Failed\"},\"id\":\"q\",\"name\":\"mbsureximo\",\"type\":\"yocf\"},{\"properties\":{\"description\":\"s\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"UpdateAll\",\"allowCrashDumpsCollection\":\"Enabled\",\"regionalDataBoundary\":\"None\",\"hasDeployment\":false,\"provisioningState\":\"Failed\"},\"id\":\"yudxorrqnbp\",\"name\":\"czvyifq\",\"type\":\"vkd\"}],\"nextLink\":\"sllr\"}") + "{\"value\":[{\"properties\":{\"description\":\"zaqsqsycbkbfk\",\"osFeedType\":\"Retail\",\"updatePolicy\":\"UpdateAll\",\"allowCrashDumpsCollection\":\"Enabled\",\"regionalDataBoundary\":\"EU\",\"hasDeployment\":false,\"provisioningState\":\"Updating\"},\"id\":\"axcfjpgddtocjjx\",\"name\":\"vpmouexhdzxib\",\"type\":\"eojnxqbzvddn\"},{\"properties\":{\"description\":\"deicbtwnpzao\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Disabled\",\"regionalDataBoundary\":\"None\",\"hasDeployment\":false,\"provisioningState\":\"Deleting\"},\"id\":\"lmjthjq\",\"name\":\"wpyeicxmqciwqvh\",\"type\":\"hix\"}],\"nextLink\":\"gdtopbobjogh\"}") .toObject(DeviceGroupListResult.class); - Assertions.assertEquals("oaeupfhyhltrpmo", model.value().get(0).properties().description()); - Assertions.assertEquals(OSFeedType.RETAIL_EVAL, model.value().get(0).properties().osFeedType()); + Assertions.assertEquals("zaqsqsycbkbfk", model.value().get(0).properties().description()); + Assertions.assertEquals(OSFeedType.RETAIL, model.value().get(0).properties().osFeedType()); Assertions.assertEquals(UpdatePolicy.UPDATE_ALL, model.value().get(0).properties().updatePolicy()); Assertions.assertEquals(AllowCrashDumpCollection.ENABLED, model.value().get(0).properties().allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.NONE, model.value().get(0).properties().regionalDataBoundary()); - Assertions.assertEquals("sllr", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeviceGroupListResult model = new DeviceGroupListResult().withValue(Arrays.asList( - new DeviceGroupInner().withProperties(new DeviceGroupProperties().withDescription("oaeupfhyhltrpmo") - .withOsFeedType(OSFeedType.RETAIL_EVAL) - .withUpdatePolicy(UpdatePolicy.UPDATE_ALL) - .withAllowCrashDumpsCollection(AllowCrashDumpCollection.ENABLED) - .withRegionalDataBoundary(RegionalDataBoundary.NONE)), - new DeviceGroupInner().withProperties(new DeviceGroupProperties().withDescription("yzydagfuaxbezyi") - .withOsFeedType(OSFeedType.RETAIL_EVAL) - .withUpdatePolicy(UpdatePolicy.NO3RD_PARTY_APP_UPDATES) - .withAllowCrashDumpsCollection(AllowCrashDumpCollection.DISABLED) - .withRegionalDataBoundary(RegionalDataBoundary.EU)), - new DeviceGroupInner().withProperties(new DeviceGroupProperties().withDescription("s") - .withOsFeedType(OSFeedType.RETAIL_EVAL) - .withUpdatePolicy(UpdatePolicy.UPDATE_ALL) - .withAllowCrashDumpsCollection(AllowCrashDumpCollection.ENABLED) - .withRegionalDataBoundary(RegionalDataBoundary.NONE)))) - .withNextLink("sllr"); - model = BinaryData.fromObject(model).toObject(DeviceGroupListResult.class); - Assertions.assertEquals("oaeupfhyhltrpmo", model.value().get(0).properties().description()); - Assertions.assertEquals(OSFeedType.RETAIL_EVAL, model.value().get(0).properties().osFeedType()); - Assertions.assertEquals(UpdatePolicy.UPDATE_ALL, model.value().get(0).properties().updatePolicy()); - Assertions.assertEquals(AllowCrashDumpCollection.ENABLED, - model.value().get(0).properties().allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.NONE, model.value().get(0).properties().regionalDataBoundary()); - Assertions.assertEquals("sllr", model.nextLink()); + Assertions.assertEquals(RegionalDataBoundary.EU, model.value().get(0).properties().regionalDataBoundary()); + Assertions.assertEquals("gdtopbobjogh", model.nextLink()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupPropertiesTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupPropertiesTests.java index 1be0bff3bd685..fdbc335710ea0 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupPropertiesTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -16,27 +16,27 @@ public final class DeviceGroupPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DeviceGroupProperties model = BinaryData.fromString( - "{\"description\":\"hzdobpxjmflbvvnc\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Disabled\",\"regionalDataBoundary\":\"EU\",\"hasDeployment\":true,\"provisioningState\":\"Failed\"}") + "{\"description\":\"thz\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Enabled\",\"regionalDataBoundary\":\"None\",\"hasDeployment\":false,\"provisioningState\":\"Succeeded\"}") .toObject(DeviceGroupProperties.class); - Assertions.assertEquals("hzdobpxjmflbvvnc", model.description()); + Assertions.assertEquals("thz", model.description()); Assertions.assertEquals(OSFeedType.RETAIL_EVAL, model.osFeedType()); Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, model.updatePolicy()); - Assertions.assertEquals(AllowCrashDumpCollection.DISABLED, model.allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.EU, model.regionalDataBoundary()); + Assertions.assertEquals(AllowCrashDumpCollection.ENABLED, model.allowCrashDumpsCollection()); + Assertions.assertEquals(RegionalDataBoundary.NONE, model.regionalDataBoundary()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DeviceGroupProperties model = new DeviceGroupProperties().withDescription("hzdobpxjmflbvvnc") + DeviceGroupProperties model = new DeviceGroupProperties().withDescription("thz") .withOsFeedType(OSFeedType.RETAIL_EVAL) .withUpdatePolicy(UpdatePolicy.NO3RD_PARTY_APP_UPDATES) - .withAllowCrashDumpsCollection(AllowCrashDumpCollection.DISABLED) - .withRegionalDataBoundary(RegionalDataBoundary.EU); + .withAllowCrashDumpsCollection(AllowCrashDumpCollection.ENABLED) + .withRegionalDataBoundary(RegionalDataBoundary.NONE); model = BinaryData.fromObject(model).toObject(DeviceGroupProperties.class); - Assertions.assertEquals("hzdobpxjmflbvvnc", model.description()); + Assertions.assertEquals("thz", model.description()); Assertions.assertEquals(OSFeedType.RETAIL_EVAL, model.osFeedType()); Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, model.updatePolicy()); - Assertions.assertEquals(AllowCrashDumpCollection.DISABLED, model.allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.EU, model.regionalDataBoundary()); + Assertions.assertEquals(AllowCrashDumpCollection.ENABLED, model.allowCrashDumpsCollection()); + Assertions.assertEquals(RegionalDataBoundary.NONE, model.regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupUpdatePropertiesTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupUpdatePropertiesTests.java index 90f5251c33cdf..2b071b21fbcc2 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupUpdatePropertiesTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupUpdatePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -16,27 +16,27 @@ public final class DeviceGroupUpdatePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DeviceGroupUpdateProperties model = BinaryData.fromString( - "{\"description\":\"kjz\",\"osFeedType\":\"Retail\",\"updatePolicy\":\"UpdateAll\",\"allowCrashDumpsCollection\":\"Disabled\",\"regionalDataBoundary\":\"None\"}") + "{\"description\":\"esap\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Disabled\",\"regionalDataBoundary\":\"EU\"}") .toObject(DeviceGroupUpdateProperties.class); - Assertions.assertEquals("kjz", model.description()); - Assertions.assertEquals(OSFeedType.RETAIL, model.osFeedType()); - Assertions.assertEquals(UpdatePolicy.UPDATE_ALL, model.updatePolicy()); + Assertions.assertEquals("esap", model.description()); + Assertions.assertEquals(OSFeedType.RETAIL_EVAL, model.osFeedType()); + Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, model.updatePolicy()); Assertions.assertEquals(AllowCrashDumpCollection.DISABLED, model.allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.NONE, model.regionalDataBoundary()); + Assertions.assertEquals(RegionalDataBoundary.EU, model.regionalDataBoundary()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DeviceGroupUpdateProperties model = new DeviceGroupUpdateProperties().withDescription("kjz") - .withOsFeedType(OSFeedType.RETAIL) - .withUpdatePolicy(UpdatePolicy.UPDATE_ALL) + DeviceGroupUpdateProperties model = new DeviceGroupUpdateProperties().withDescription("esap") + .withOsFeedType(OSFeedType.RETAIL_EVAL) + .withUpdatePolicy(UpdatePolicy.NO3RD_PARTY_APP_UPDATES) .withAllowCrashDumpsCollection(AllowCrashDumpCollection.DISABLED) - .withRegionalDataBoundary(RegionalDataBoundary.NONE); + .withRegionalDataBoundary(RegionalDataBoundary.EU); model = BinaryData.fromObject(model).toObject(DeviceGroupUpdateProperties.class); - Assertions.assertEquals("kjz", model.description()); - Assertions.assertEquals(OSFeedType.RETAIL, model.osFeedType()); - Assertions.assertEquals(UpdatePolicy.UPDATE_ALL, model.updatePolicy()); + Assertions.assertEquals("esap", model.description()); + Assertions.assertEquals(OSFeedType.RETAIL_EVAL, model.osFeedType()); + Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, model.updatePolicy()); Assertions.assertEquals(AllowCrashDumpCollection.DISABLED, model.allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.NONE, model.regionalDataBoundary()); + Assertions.assertEquals(RegionalDataBoundary.EU, model.regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupUpdateTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupUpdateTests.java index 0ac3daa08c95f..f20b6049e69ee 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupUpdateTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupUpdateTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -17,10 +17,10 @@ public final class DeviceGroupUpdateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DeviceGroupUpdate model = BinaryData.fromString( - "{\"properties\":{\"description\":\"xquk\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Disabled\",\"regionalDataBoundary\":\"EU\"}}") + "{\"properties\":{\"description\":\"nabckhsmtx\",\"osFeedType\":\"Retail\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Disabled\",\"regionalDataBoundary\":\"EU\"}}") .toObject(DeviceGroupUpdate.class); - Assertions.assertEquals("xquk", model.properties().description()); - Assertions.assertEquals(OSFeedType.RETAIL_EVAL, model.properties().osFeedType()); + Assertions.assertEquals("nabckhsmtx", model.properties().description()); + Assertions.assertEquals(OSFeedType.RETAIL, model.properties().osFeedType()); Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, model.properties().updatePolicy()); Assertions.assertEquals(AllowCrashDumpCollection.DISABLED, model.properties().allowCrashDumpsCollection()); Assertions.assertEquals(RegionalDataBoundary.EU, model.properties().regionalDataBoundary()); @@ -29,14 +29,14 @@ public void testDeserialize() throws Exception { @org.junit.jupiter.api.Test public void testSerialize() throws Exception { DeviceGroupUpdate model - = new DeviceGroupUpdate().withProperties(new DeviceGroupUpdateProperties().withDescription("xquk") - .withOsFeedType(OSFeedType.RETAIL_EVAL) + = new DeviceGroupUpdate().withProperties(new DeviceGroupUpdateProperties().withDescription("nabckhsmtx") + .withOsFeedType(OSFeedType.RETAIL) .withUpdatePolicy(UpdatePolicy.NO3RD_PARTY_APP_UPDATES) .withAllowCrashDumpsCollection(AllowCrashDumpCollection.DISABLED) .withRegionalDataBoundary(RegionalDataBoundary.EU)); model = BinaryData.fromObject(model).toObject(DeviceGroupUpdate.class); - Assertions.assertEquals("xquk", model.properties().description()); - Assertions.assertEquals(OSFeedType.RETAIL_EVAL, model.properties().osFeedType()); + Assertions.assertEquals("nabckhsmtx", model.properties().description()); + Assertions.assertEquals(OSFeedType.RETAIL, model.properties().osFeedType()); Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, model.properties().updatePolicy()); Assertions.assertEquals(AllowCrashDumpCollection.DISABLED, model.properties().allowCrashDumpsCollection()); Assertions.assertEquals(RegionalDataBoundary.EU, model.properties().regionalDataBoundary()); diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCountDevicesWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCountDevicesWithResponseMockTests.java index e5a8901bb86e8..fa66a5e8f8bb7 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCountDevicesWithResponseMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCountDevicesWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.CountDevicesResponse; @@ -20,20 +20,19 @@ public final class DeviceGroupsCountDevicesWithResponseMockTests { @Test public void testCountDevicesWithResponse() throws Exception { - String responseStr = "{\"value\":326673667}"; + String responseStr = "{\"value\":1475196585}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); CountDevicesResponse response = manager.deviceGroups() - .countDevicesWithResponse("elpcirelsfeaenwa", "fatkld", "xbjhwuaanozjosph", "oulpjrv", - com.azure.core.util.Context.NONE) + .countDevicesWithResponse("zrtuzq", "gsexne", "fdnw", "wmewzsyy", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(326673667, response.value()); + Assertions.assertEquals(1475196585, response.value()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCreateOrUpdateMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCreateOrUpdateMockTests.java index 4d68363ca839b..881e6aa31e9ef 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCreateOrUpdateMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCreateOrUpdateMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.AllowCrashDumpCollection; @@ -26,29 +26,29 @@ public final class DeviceGroupsCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"description\":\"oduhp\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Enabled\",\"regionalDataBoundary\":\"EU\",\"hasDeployment\":false,\"provisioningState\":\"Succeeded\"},\"id\":\"qugjhkycube\",\"name\":\"dgssofwqmzqal\",\"type\":\"rmnjijpx\"}"; + = "{\"properties\":{\"description\":\"lcvydy\",\"osFeedType\":\"Retail\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Disabled\",\"regionalDataBoundary\":\"None\",\"hasDeployment\":true,\"provisioningState\":\"Succeeded\"},\"id\":\"kooebwnu\",\"name\":\"hemms\",\"type\":\"vdkcrodtj\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); DeviceGroup response = manager.deviceGroups() - .define("gge") - .withExistingProduct("glrvimjwosytxi", "cskfcktqumiekk", "zzikhlyfjhdg") - .withProperties(new DeviceGroupProperties().withDescription("nyga") - .withOsFeedType(OSFeedType.RETAIL) - .withUpdatePolicy(UpdatePolicy.NO3RD_PARTY_APP_UPDATES) - .withAllowCrashDumpsCollection(AllowCrashDumpCollection.DISABLED) + .define("paxh") + .withExistingProduct("uzsoi", "judpfrxt", "thzvaytdwkqbrqu") + .withProperties(new DeviceGroupProperties().withDescription("i") + .withOsFeedType(OSFeedType.RETAIL_EVAL) + .withUpdatePolicy(UpdatePolicy.UPDATE_ALL) + .withAllowCrashDumpsCollection(AllowCrashDumpCollection.ENABLED) .withRegionalDataBoundary(RegionalDataBoundary.NONE)) .create(); - Assertions.assertEquals("oduhp", response.properties().description()); - Assertions.assertEquals(OSFeedType.RETAIL_EVAL, response.properties().osFeedType()); + Assertions.assertEquals("lcvydy", response.properties().description()); + Assertions.assertEquals(OSFeedType.RETAIL, response.properties().osFeedType()); Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, response.properties().updatePolicy()); - Assertions.assertEquals(AllowCrashDumpCollection.ENABLED, response.properties().allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.EU, response.properties().regionalDataBoundary()); + Assertions.assertEquals(AllowCrashDumpCollection.DISABLED, response.properties().allowCrashDumpsCollection()); + Assertions.assertEquals(RegionalDataBoundary.NONE, response.properties().regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsDeleteMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsDeleteMockTests.java index 48e5c1ad96e60..314aeac18837b 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsDeleteMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsDeleteMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,9 @@ public void testDelete() throws Exception { AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.deviceGroups() - .delete("imfnjhfjx", "mszkkfo", "rey", "kzikfjawneaivxwc", com.azure.core.util.Context.NONE); + manager.deviceGroups().delete("cyjmoadsuvarmy", "dmjsjqb", "hhyxxrw", "yc", com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsGetWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsGetWithResponseMockTests.java index f24f7acf9eb27..858732f883ab0 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsGetWithResponseMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.AllowCrashDumpCollection; @@ -25,23 +25,23 @@ public final class DeviceGroupsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"description\":\"v\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Disabled\",\"regionalDataBoundary\":\"None\",\"hasDeployment\":true,\"provisioningState\":\"Updating\"},\"id\":\"dxepxgyq\",\"name\":\"gvr\",\"type\":\"mnpkukghimdblxg\"}"; + = "{\"properties\":{\"description\":\"khly\",\"osFeedType\":\"Retail\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Enabled\",\"regionalDataBoundary\":\"None\",\"hasDeployment\":false,\"provisioningState\":\"Deleting\"},\"id\":\"g\",\"name\":\"eqidbqfatpx\",\"type\":\"lr\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); DeviceGroup response = manager.deviceGroups() - .getWithResponse("xxmueedn", "rdvstkwqqtch", "alm", "mtdaa", com.azure.core.util.Context.NONE) + .getWithResponse("jrvxaglrv", "mjwosytx", "tcs", "fcktqumiekke", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("v", response.properties().description()); - Assertions.assertEquals(OSFeedType.RETAIL_EVAL, response.properties().osFeedType()); + Assertions.assertEquals("khly", response.properties().description()); + Assertions.assertEquals(OSFeedType.RETAIL, response.properties().osFeedType()); Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, response.properties().updatePolicy()); - Assertions.assertEquals(AllowCrashDumpCollection.DISABLED, response.properties().allowCrashDumpsCollection()); + Assertions.assertEquals(AllowCrashDumpCollection.ENABLED, response.properties().allowCrashDumpsCollection()); Assertions.assertEquals(RegionalDataBoundary.NONE, response.properties().regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsListByProductMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsListByProductMockTests.java index 61de68c3b5805..ef228877a503d 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsListByProductMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsListByProductMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.AllowCrashDumpCollection; @@ -26,26 +26,26 @@ public final class DeviceGroupsListByProductMockTests { @Test public void testListByProduct() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"description\":\"mqg\",\"osFeedType\":\"Retail\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Enabled\",\"regionalDataBoundary\":\"None\",\"hasDeployment\":true,\"provisioningState\":\"Provisioning\"},\"id\":\"allatmelwuipic\",\"name\":\"jzkzi\",\"type\":\"gvvcnayrhyr\"}]}"; + = "{\"value\":[{\"properties\":{\"description\":\"mzqa\",\"osFeedType\":\"Retail\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Enabled\",\"regionalDataBoundary\":\"EU\",\"hasDeployment\":true,\"provisioningState\":\"Deleting\"},\"id\":\"udfnbyxba\",\"name\":\"abjy\",\"type\":\"ayffim\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.deviceGroups() - .listByProduct("lxdy", "gsyocogj", "tdtbnnhadooc", "kvci", 464313768, 1515797519, 600474862, + .listByProduct("duhpk", "kgymareqnajxqug", "hky", "ubeddg", 2056337569, 947899145, 1063119881, com.azure.core.util.Context.NONE); - Assertions.assertEquals("mqg", response.iterator().next().properties().description()); + Assertions.assertEquals("mzqa", response.iterator().next().properties().description()); Assertions.assertEquals(OSFeedType.RETAIL, response.iterator().next().properties().osFeedType()); Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, response.iterator().next().properties().updatePolicy()); Assertions.assertEquals(AllowCrashDumpCollection.ENABLED, response.iterator().next().properties().allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.NONE, + Assertions.assertEquals(RegionalDataBoundary.EU, response.iterator().next().properties().regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceInnerTests.java index 57dbd6f596d0f..8b8c5fbaa748f 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceInnerTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -13,15 +13,15 @@ public final class DeviceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DeviceInner model = BinaryData.fromString( - "{\"properties\":{\"deviceId\":\"kpikadrgvt\",\"chipSku\":\"gnbuy\",\"lastAvailableOsVersion\":\"ijggmebfsiar\",\"lastInstalledOsVersion\":\"trcvpnazzmh\",\"lastOsUpdateUtc\":\"2021-11-09T20:12:13Z\",\"lastUpdateRequestUtc\":\"2021-02-24T15:52:09Z\",\"provisioningState\":\"Provisioning\"},\"id\":\"tdbhrbnla\",\"name\":\"kx\",\"type\":\"yskpbhen\"}") + "{\"properties\":{\"deviceId\":\"q\",\"chipSku\":\"bsureximo\",\"lastAvailableOsVersion\":\"ocfs\",\"lastInstalledOsVersion\":\"s\",\"lastOsUpdateUtc\":\"2021-06-13T04:15:30Z\",\"lastUpdateRequestUtc\":\"2021-01-31T18:49:05Z\",\"provisioningState\":\"Accepted\"},\"id\":\"i\",\"name\":\"uxh\",\"type\":\"yudxorrqnbp\"}") .toObject(DeviceInner.class); - Assertions.assertEquals("kpikadrgvt", model.properties().deviceId()); + Assertions.assertEquals("q", model.properties().deviceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DeviceInner model = new DeviceInner().withProperties(new DeviceProperties().withDeviceId("kpikadrgvt")); + DeviceInner model = new DeviceInner().withProperties(new DeviceProperties().withDeviceId("q")); model = BinaryData.fromObject(model).toObject(DeviceInner.class); - Assertions.assertEquals("kpikadrgvt", model.properties().deviceId()); + Assertions.assertEquals("q", model.properties().deviceId()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceInsightInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceInsightInnerTests.java index 8a6379ca87687..ea4303e392b6d 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceInsightInnerTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceInsightInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -13,36 +13,15 @@ public final class DeviceInsightInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DeviceInsightInner model = BinaryData.fromString( - "{\"deviceId\":\"ntypmrbpizcdrqj\",\"description\":\"dpydn\",\"startTimestampUtc\":\"2021-02-06T09:08:09Z\",\"endTimestampUtc\":\"2021-07-10T19:26:28Z\",\"eventCategory\":\"xdeoejzic\",\"eventClass\":\"ifsjttgzfbishcb\",\"eventType\":\"hajdeyeamdpha\",\"eventCount\":1536073800}") + "{\"deviceId\":\"enjbdlwtgrhp\",\"description\":\"jp\",\"startTimestampUtc\":\"2021-05-17T12:08:11Z\",\"endTimestampUtc\":\"2021-07-10T04:01:24Z\",\"eventCategory\":\"asxazjpqyegualhb\",\"eventClass\":\"xhejjzzvdud\",\"eventType\":\"wdslfhotwmcy\",\"eventCount\":1913635803}") .toObject(DeviceInsightInner.class); - Assertions.assertEquals("ntypmrbpizcdrqj", model.deviceId()); - Assertions.assertEquals("dpydn", model.description()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-06T09:08:09Z"), model.startTimestampUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-10T19:26:28Z"), model.endTimestampUtc()); - Assertions.assertEquals("xdeoejzic", model.eventCategory()); - Assertions.assertEquals("ifsjttgzfbishcb", model.eventClass()); - Assertions.assertEquals("hajdeyeamdpha", model.eventType()); - Assertions.assertEquals(1536073800, model.eventCount()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeviceInsightInner model = new DeviceInsightInner().withDeviceId("ntypmrbpizcdrqj") - .withDescription("dpydn") - .withStartTimestampUtc(OffsetDateTime.parse("2021-02-06T09:08:09Z")) - .withEndTimestampUtc(OffsetDateTime.parse("2021-07-10T19:26:28Z")) - .withEventCategory("xdeoejzic") - .withEventClass("ifsjttgzfbishcb") - .withEventType("hajdeyeamdpha") - .withEventCount(1536073800); - model = BinaryData.fromObject(model).toObject(DeviceInsightInner.class); - Assertions.assertEquals("ntypmrbpizcdrqj", model.deviceId()); - Assertions.assertEquals("dpydn", model.description()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-06T09:08:09Z"), model.startTimestampUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-10T19:26:28Z"), model.endTimestampUtc()); - Assertions.assertEquals("xdeoejzic", model.eventCategory()); - Assertions.assertEquals("ifsjttgzfbishcb", model.eventClass()); - Assertions.assertEquals("hajdeyeamdpha", model.eventType()); - Assertions.assertEquals(1536073800, model.eventCount()); + Assertions.assertEquals("enjbdlwtgrhp", model.deviceId()); + Assertions.assertEquals("jp", model.description()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-17T12:08:11Z"), model.startTimestampUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-10T04:01:24Z"), model.endTimestampUtc()); + Assertions.assertEquals("asxazjpqyegualhb", model.eventCategory()); + Assertions.assertEquals("xhejjzzvdud", model.eventClass()); + Assertions.assertEquals("wdslfhotwmcy", model.eventType()); + Assertions.assertEquals(1913635803, model.eventCount()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceListResultTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceListResultTests.java index 477027ba9fe4a..72230cadf83e9 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceListResultTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceListResultTests.java @@ -1,36 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.DeviceInner; -import com.azure.resourcemanager.sphere.models.DeviceListResult; -import com.azure.resourcemanager.sphere.models.DeviceProperties; -import java.util.Arrays; +import com.azure.resourcemanager.sphere.implementation.models.DeviceListResult; import org.junit.jupiter.api.Assertions; public final class DeviceListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DeviceListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"deviceId\":\"uxwgipwho\",\"chipSku\":\"wkgshwa\",\"lastAvailableOsVersion\":\"ixzbinjeputtmryw\",\"lastInstalledOsVersion\":\"zoqftiyqzrnkcqvy\",\"lastOsUpdateUtc\":\"2021-11-01T04:15:41Z\",\"lastUpdateRequestUtc\":\"2021-04-08T10:43:47Z\",\"provisioningState\":\"Provisioning\"},\"id\":\"cohoq\",\"name\":\"nwvlryavwhheunmm\",\"type\":\"hgyxzkonoc\"},{\"properties\":{\"deviceId\":\"klyaxuconu\",\"chipSku\":\"zf\",\"lastAvailableOsVersion\":\"eyp\",\"lastInstalledOsVersion\":\"rmjmwvvjektc\",\"lastOsUpdateUtc\":\"2021-04-14T12:00:30Z\",\"lastUpdateRequestUtc\":\"2021-03-21T19:21:01Z\",\"provisioningState\":\"Provisioning\"},\"id\":\"s\",\"name\":\"frzpwvlqdqgb\",\"type\":\"qylihkaetckt\"},{\"properties\":{\"deviceId\":\"ivfsnk\",\"chipSku\":\"uctqhjfbe\",\"lastAvailableOsVersion\":\"jcxerfuwu\",\"lastInstalledOsVersion\":\"txfvjrbirph\",\"lastOsUpdateUtc\":\"2020-12-25T01:34:04Z\",\"lastUpdateRequestUtc\":\"2021-09-05T13:55:56Z\",\"provisioningState\":\"Provisioning\"},\"id\":\"fnljky\",\"name\":\"xjvuujqgidokg\",\"type\":\"ljyoxgvcltb\"},{\"properties\":{\"deviceId\":\"c\",\"chipSku\":\"kjeszz\",\"lastAvailableOsVersion\":\"ijhtxf\",\"lastInstalledOsVersion\":\"xbf\",\"lastOsUpdateUtc\":\"2021-01-19T10:57:10Z\",\"lastUpdateRequestUtc\":\"2021-05-10T05:23:15Z\",\"provisioningState\":\"Failed\"},\"id\":\"vecxgodebfqkk\",\"name\":\"bmpukgriwflz\",\"type\":\"fbxzpuzycisp\"}],\"nextLink\":\"zahmgkbrpyydhibn\"}") + "{\"value\":[{\"properties\":{\"deviceId\":\"jnpg\",\"chipSku\":\"ftadehxnltyfs\",\"lastAvailableOsVersion\":\"pusuesn\",\"lastInstalledOsVersion\":\"dejbavo\",\"lastOsUpdateUtc\":\"2021-09-27T19:00:57Z\",\"lastUpdateRequestUtc\":\"2021-03-31T13:31:51Z\",\"provisioningState\":\"Provisioning\"},\"id\":\"tbqvudw\",\"name\":\"dndnvow\",\"type\":\"ujjugwdkcglh\"},{\"properties\":{\"deviceId\":\"zj\",\"chipSku\":\"ggd\",\"lastAvailableOsVersion\":\"ixhbkuofqweykhm\",\"lastInstalledOsVersion\":\"evfyexfwhybcib\",\"lastOsUpdateUtc\":\"2021-05-14T16:24:46Z\",\"lastUpdateRequestUtc\":\"2021-01-31T06:13:45Z\",\"provisioningState\":\"Provisioning\"},\"id\":\"ynnaam\",\"name\":\"ectehf\",\"type\":\"qsc\"},{\"properties\":{\"deviceId\":\"pvhez\",\"chipSku\":\"gqhcjrefovg\",\"lastAvailableOsVersion\":\"qsl\",\"lastInstalledOsVersion\":\"yvxyqjp\",\"lastOsUpdateUtc\":\"2021-02-23T18:47:42Z\",\"lastUpdateRequestUtc\":\"2021-11-05T17:27:55Z\",\"provisioningState\":\"Succeeded\"},\"id\":\"jcrcczsqpjhvmda\",\"name\":\"v\",\"type\":\"ysou\"},{\"properties\":{\"deviceId\":\"canoaeupf\",\"chipSku\":\"hltrpmopjmcmatuo\",\"lastAvailableOsVersion\":\"hfuiuaodsfc\",\"lastInstalledOsVersion\":\"vxodpu\",\"lastOsUpdateUtc\":\"2021-05-26T02:59:13Z\",\"lastUpdateRequestUtc\":\"2021-02-09T15:41:34Z\",\"provisioningState\":\"Updating\"},\"id\":\"gf\",\"name\":\"axbezyiuo\",\"type\":\"ktwh\"}],\"nextLink\":\"xw\"}") .toObject(DeviceListResult.class); - Assertions.assertEquals("uxwgipwho", model.value().get(0).properties().deviceId()); - Assertions.assertEquals("zahmgkbrpyydhibn", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeviceListResult model = new DeviceListResult() - .withValue(Arrays.asList(new DeviceInner().withProperties(new DeviceProperties().withDeviceId("uxwgipwho")), - new DeviceInner().withProperties(new DeviceProperties().withDeviceId("klyaxuconu")), - new DeviceInner().withProperties(new DeviceProperties().withDeviceId("ivfsnk")), - new DeviceInner().withProperties(new DeviceProperties().withDeviceId("c")))) - .withNextLink("zahmgkbrpyydhibn"); - model = BinaryData.fromObject(model).toObject(DeviceListResult.class); - Assertions.assertEquals("uxwgipwho", model.value().get(0).properties().deviceId()); - Assertions.assertEquals("zahmgkbrpyydhibn", model.nextLink()); + Assertions.assertEquals("jnpg", model.value().get(0).properties().deviceId()); + Assertions.assertEquals("xw", model.nextLink()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicePropertiesTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicePropertiesTests.java index 76907e2d7e3cf..00fa522f4b6aa 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicePropertiesTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -12,15 +12,15 @@ public final class DevicePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DeviceProperties model = BinaryData.fromString( - "{\"deviceId\":\"kcxywnyt\",\"chipSku\":\"synlqidybyxczfc\",\"lastAvailableOsVersion\":\"aaxdbabphlwrq\",\"lastInstalledOsVersion\":\"ktsthsucocmny\",\"lastOsUpdateUtc\":\"2021-08-16T03:52:30Z\",\"lastUpdateRequestUtc\":\"2021-08-27T13:10:53Z\",\"provisioningState\":\"Accepted\"}") + "{\"deviceId\":\"zvyifqrvkdvj\",\"chipSku\":\"lrmv\",\"lastAvailableOsVersion\":\"f\",\"lastInstalledOsVersion\":\"t\",\"lastOsUpdateUtc\":\"2021-05-03T17:45:11Z\",\"lastUpdateRequestUtc\":\"2021-11-08T07:16:59Z\",\"provisioningState\":\"Failed\"}") .toObject(DeviceProperties.class); - Assertions.assertEquals("kcxywnyt", model.deviceId()); + Assertions.assertEquals("zvyifqrvkdvj", model.deviceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DeviceProperties model = new DeviceProperties().withDeviceId("kcxywnyt"); + DeviceProperties model = new DeviceProperties().withDeviceId("zvyifqrvkdvj"); model = BinaryData.fromObject(model).toObject(DeviceProperties.class); - Assertions.assertEquals("kcxywnyt", model.deviceId()); + Assertions.assertEquals("zvyifqrvkdvj", model.deviceId()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceUpdatePropertiesTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceUpdatePropertiesTests.java index 9391bfb2e45d1..08842de240d65 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceUpdatePropertiesTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceUpdatePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -12,14 +12,14 @@ public final class DeviceUpdatePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DeviceUpdateProperties model - = BinaryData.fromString("{\"deviceGroupId\":\"smtxpsieb\"}").toObject(DeviceUpdateProperties.class); - Assertions.assertEquals("smtxpsieb", model.deviceGroupId()); + = BinaryData.fromString("{\"deviceGroupId\":\"oty\"}").toObject(DeviceUpdateProperties.class); + Assertions.assertEquals("oty", model.deviceGroupId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DeviceUpdateProperties model = new DeviceUpdateProperties().withDeviceGroupId("smtxpsieb"); + DeviceUpdateProperties model = new DeviceUpdateProperties().withDeviceGroupId("oty"); model = BinaryData.fromObject(model).toObject(DeviceUpdateProperties.class); - Assertions.assertEquals("smtxpsieb", model.deviceGroupId()); + Assertions.assertEquals("oty", model.deviceGroupId()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceUpdateTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceUpdateTests.java index 6847d428acc5a..57a256a1788b3 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceUpdateTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceUpdateTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -12,16 +12,16 @@ public final class DeviceUpdateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DeviceUpdate model - = BinaryData.fromString("{\"properties\":{\"deviceGroupId\":\"edeojnabc\"}}").toObject(DeviceUpdate.class); - Assertions.assertEquals("edeojnabc", model.properties().deviceGroupId()); + DeviceUpdate model = BinaryData.fromString("{\"properties\":{\"deviceGroupId\":\"micykvceoveilo\"}}") + .toObject(DeviceUpdate.class); + Assertions.assertEquals("micykvceoveilo", model.properties().deviceGroupId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { DeviceUpdate model - = new DeviceUpdate().withProperties(new DeviceUpdateProperties().withDeviceGroupId("edeojnabc")); + = new DeviceUpdate().withProperties(new DeviceUpdateProperties().withDeviceGroupId("micykvceoveilo")); model = BinaryData.fromObject(model).toObject(DeviceUpdate.class); - Assertions.assertEquals("edeojnabc", model.properties().deviceGroupId()); + Assertions.assertEquals("micykvceoveilo", model.properties().deviceGroupId()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesCreateOrUpdateMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesCreateOrUpdateMockTests.java index 87f73be3c1484..088d56f6caefc 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesCreateOrUpdateMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesCreateOrUpdateMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.Device; @@ -22,21 +22,21 @@ public final class DevicesCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"deviceId\":\"lvez\",\"chipSku\":\"pqlmfe\",\"lastAvailableOsVersion\":\"erqwkyhkobopg\",\"lastInstalledOsVersion\":\"dkow\",\"lastOsUpdateUtc\":\"2021-04-05T06:25:25Z\",\"lastUpdateRequestUtc\":\"2021-01-20T13:15:44Z\",\"provisioningState\":\"Succeeded\"},\"id\":\"kbwcc\",\"name\":\"njv\",\"type\":\"dw\"}"; + = "{\"properties\":{\"deviceId\":\"rebqaaysjk\",\"chipSku\":\"qtnqtt\",\"lastAvailableOsVersion\":\"lwfffi\",\"lastInstalledOsVersion\":\"pjpqqmtedltmmji\",\"lastOsUpdateUtc\":\"2021-01-23T06:09:40Z\",\"lastUpdateRequestUtc\":\"2021-09-10T18:44:16Z\",\"provisioningState\":\"Succeeded\"},\"id\":\"wau\",\"name\":\"qncygupkvi\",\"type\":\"mdscwxqupev\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Device response = manager.devices() - .define("vtbvkayh") - .withExistingDeviceGroup("whbotzingamv", "phoszqz", "dphqamv", "kfwynw") - .withProperties(new DeviceProperties().withDeviceId("vyqia")) + .define("gplcrpwjxeznoigb") + .withExistingDeviceGroup("afxtsgum", "jglikkxwslolb", "pvuzlmv", "elfk") + .withProperties(new DeviceProperties().withDeviceId("w")) .create(); - Assertions.assertEquals("lvez", response.properties().deviceId()); + Assertions.assertEquals("rebqaaysjk", response.properties().deviceId()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesDeleteMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesDeleteMockTests.java index d09cd94451ca2..b0751c4e1e8aa 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesDeleteMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesDeleteMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDelete() throws Exception { AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.devices() - .delete("dhszfjv", "bgofeljag", "qmqhldvriii", "jnalghf", "vtvsexsowueluq", + .delete("nrvgoupmfiibfgg", "ioolvrwxkvtkkgll", "wjygvjayvblmhvk", "uhbxvvy", "gsopbyrqufegxu", com.azure.core.util.Context.NONE); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesGenerateCapabilityImageMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesGenerateCapabilityImageMockTests.java index b04108336d862..e0dded898b82a 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesGenerateCapabilityImageMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesGenerateCapabilityImageMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.CapabilityType; @@ -22,19 +22,18 @@ public final class DevicesGenerateCapabilityImageMockTests { @Test public void testGenerateCapabilityImage() throws Exception { - String responseStr = "{\"image\":\"fi\"}"; + String responseStr = "{\"image\":\"mcwaekrrjr\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); SignedCapabilityImageResponse response = manager.devices() - .generateCapabilityImage("hahhxvrhmzkwpj", "wws", "ughftqsx", "qxujxukndxd", "grjguufzd", - new GenerateCapabilityImageRequest().withCapabilities( - Arrays.asList(CapabilityType.APPLICATION_DEVELOPMENT, CapabilityType.FIELD_SERVICING)), + .generateCapabilityImage("mtg", "qp", "y", "s", "ronzmyhgfip", + new GenerateCapabilityImageRequest().withCapabilities(Arrays.asList(CapabilityType.FIELD_SERVICING)), com.azure.core.util.Context.NONE); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesGetWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesGetWithResponseMockTests.java index 1c76342946ff9..01d9b202de71c 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesGetWithResponseMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.Device; @@ -21,20 +21,19 @@ public final class DevicesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"deviceId\":\"ikpzimejza\",\"chipSku\":\"fzxiavrmb\",\"lastAvailableOsVersion\":\"nokixrjqcirgz\",\"lastInstalledOsVersion\":\"rlazszrnw\",\"lastOsUpdateUtc\":\"2021-07-10T05:57:56Z\",\"lastUpdateRequestUtc\":\"2021-03-11T03:05:15Z\",\"provisioningState\":\"Accepted\"},\"id\":\"pj\",\"name\":\"lwbtlhf\",\"type\":\"sj\"}"; + = "{\"properties\":{\"deviceId\":\"xedk\",\"chipSku\":\"epbqpcrfkbw\",\"lastAvailableOsVersion\":\"snjvcdwxlpqekftn\",\"lastInstalledOsVersion\":\"tjsyin\",\"lastOsUpdateUtc\":\"2021-09-11T08:24:22Z\",\"lastUpdateRequestUtc\":\"2021-02-20T13:18:06Z\",\"provisioningState\":\"Canceled\"},\"id\":\"dhtmdvypgikd\",\"name\":\"szywkbirryu\",\"type\":\"hlhkjoqrvqqaatj\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Device response = manager.devices() - .getWithResponse("slthaq", "x", "smwutwbdsrezpd", "hneuyowqkd", "ytisibir", - com.azure.core.util.Context.NONE) + .getWithResponse("qxqvpsvuoymgc", "elvezrypq", "mfe", "kerqwkyh", "ob", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("ikpzimejza", response.properties().deviceId()); + Assertions.assertEquals("xedk", response.properties().deviceId()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesListByDeviceGroupMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesListByDeviceGroupMockTests.java index de256b25fb6d2..23ef3096d8e4a 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesListByDeviceGroupMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesListByDeviceGroupMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.Device; @@ -22,19 +22,18 @@ public final class DevicesListByDeviceGroupMockTests { @Test public void testListByDeviceGroup() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"deviceId\":\"o\",\"chipSku\":\"hjjklff\",\"lastAvailableOsVersion\":\"ouw\",\"lastInstalledOsVersion\":\"gzrf\",\"lastOsUpdateUtc\":\"2021-01-08T15:42:56Z\",\"lastUpdateRequestUtc\":\"2021-04-04T13:09:14Z\",\"provisioningState\":\"Canceled\"},\"id\":\"ikayuhqlbjbsybb\",\"name\":\"wrv\",\"type\":\"ldgmfpgvmpip\"}]}"; + = "{\"value\":[{\"properties\":{\"deviceId\":\"vgbmhr\",\"chipSku\":\"kw\",\"lastAvailableOsVersion\":\"ijejvegrhbpn\",\"lastInstalledOsVersion\":\"xexccbdreaxhcexd\",\"lastOsUpdateUtc\":\"2021-05-26T13:45:49Z\",\"lastUpdateRequestUtc\":\"2021-02-20T02:30:52Z\",\"provisioningState\":\"Deleting\"},\"id\":\"ghtpw\",\"name\":\"jnhyjsvf\",\"type\":\"cxzbfvoowvr\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.devices() - .listByDeviceGroup("sjabibs", "stawfsdjpvkv", "bjxbkzbzk", "vncjabudurgk", - com.azure.core.util.Context.NONE); + PagedIterable response + = manager.devices().listByDeviceGroup("wz", "bnhlmc", "l", "dn", com.azure.core.util.Context.NONE); - Assertions.assertEquals("o", response.iterator().next().properties().deviceId()); + Assertions.assertEquals("vgbmhr", response.iterator().next().properties().deviceId()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/GenerateCapabilityImageRequestTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/GenerateCapabilityImageRequestTests.java index 53e36e9b5bea8..54bb19eac3990 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/GenerateCapabilityImageRequestTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/GenerateCapabilityImageRequestTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -13,17 +13,16 @@ public final class GenerateCapabilityImageRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - GenerateCapabilityImageRequest model - = BinaryData.fromString("{\"capabilities\":[\"FieldServicing\",\"FieldServicing\",\"FieldServicing\"]}") - .toObject(GenerateCapabilityImageRequest.class); - Assertions.assertEquals(CapabilityType.FIELD_SERVICING, model.capabilities().get(0)); + GenerateCapabilityImageRequest model = BinaryData.fromString("{\"capabilities\":[\"ApplicationDevelopment\"]}") + .toObject(GenerateCapabilityImageRequest.class); + Assertions.assertEquals(CapabilityType.APPLICATION_DEVELOPMENT, model.capabilities().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - GenerateCapabilityImageRequest model = new GenerateCapabilityImageRequest().withCapabilities(Arrays - .asList(CapabilityType.FIELD_SERVICING, CapabilityType.FIELD_SERVICING, CapabilityType.FIELD_SERVICING)); + GenerateCapabilityImageRequest model = new GenerateCapabilityImageRequest() + .withCapabilities(Arrays.asList(CapabilityType.APPLICATION_DEVELOPMENT)); model = BinaryData.fromObject(model).toObject(GenerateCapabilityImageRequest.class); - Assertions.assertEquals(CapabilityType.FIELD_SERVICING, model.capabilities().get(0)); + Assertions.assertEquals(CapabilityType.APPLICATION_DEVELOPMENT, model.capabilities().get(0)); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImageInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImageInnerTests.java index 3d0046ed41537..09810f6451da2 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImageInnerTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImageInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -14,21 +14,21 @@ public final class ImageInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ImageInner model = BinaryData.fromString( - "{\"properties\":{\"image\":\"ymwisdkft\",\"imageId\":\"xmnteiwaop\",\"imageName\":\"mijcmmxdcufufs\",\"regionalDataBoundary\":\"None\",\"uri\":\"zidnsezcxtbzsgfy\",\"description\":\"sne\",\"componentId\":\"dwzjeiach\",\"imageType\":\"CustomerBoardConfig\",\"provisioningState\":\"Failed\"},\"id\":\"nrosfqpte\",\"name\":\"hzzvypyq\",\"type\":\"i\"}") + "{\"properties\":{\"image\":\"zafb\",\"imageId\":\"j\",\"imageName\":\"btoqcjmkljavbqid\",\"regionalDataBoundary\":\"None\",\"uri\":\"zyulp\",\"description\":\"dj\",\"componentId\":\"lkhbz\",\"imageType\":\"NormalWorldLoader\",\"provisioningState\":\"Failed\"},\"id\":\"gqexzlocxs\",\"name\":\"paierh\",\"type\":\"bcsglumma\"}") .toObject(ImageInner.class); - Assertions.assertEquals("ymwisdkft", model.properties().image()); - Assertions.assertEquals("xmnteiwaop", model.properties().imageId()); + Assertions.assertEquals("zafb", model.properties().image()); + Assertions.assertEquals("j", model.properties().imageId()); Assertions.assertEquals(RegionalDataBoundary.NONE, model.properties().regionalDataBoundary()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ImageInner model = new ImageInner().withProperties(new ImageProperties().withImage("ymwisdkft") - .withImageId("xmnteiwaop") + ImageInner model = new ImageInner().withProperties(new ImageProperties().withImage("zafb") + .withImageId("j") .withRegionalDataBoundary(RegionalDataBoundary.NONE)); model = BinaryData.fromObject(model).toObject(ImageInner.class); - Assertions.assertEquals("ymwisdkft", model.properties().image()); - Assertions.assertEquals("xmnteiwaop", model.properties().imageId()); + Assertions.assertEquals("zafb", model.properties().image()); + Assertions.assertEquals("j", model.properties().imageId()); Assertions.assertEquals(RegionalDataBoundary.NONE, model.properties().regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImageListResultTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImageListResultTests.java index 50675334d6a43..78950de4ddf95 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImageListResultTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImageListResultTests.java @@ -1,43 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.ImageInner; -import com.azure.resourcemanager.sphere.models.ImageListResult; -import com.azure.resourcemanager.sphere.models.ImageProperties; +import com.azure.resourcemanager.sphere.implementation.models.ImageListResult; import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class ImageListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ImageListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"image\":\"fouflmmnkzsmo\",\"imageId\":\"glougpbk\",\"imageName\":\"mutduqktaps\",\"regionalDataBoundary\":\"None\",\"uri\":\"uertumk\",\"description\":\"svqwhbmdgbbjfd\",\"componentId\":\"mbmbexppbh\",\"imageType\":\"SecurityMonitor\",\"provisioningState\":\"Accepted\"},\"id\":\"fpfpsalgbquxigj\",\"name\":\"jgzjaoyfhrtx\",\"type\":\"lnerkujysvleju\"},{\"properties\":{\"image\":\"awrlyx\",\"imageId\":\"kcprbnw\",\"imageName\":\"gjvtbv\",\"regionalDataBoundary\":\"None\",\"uri\":\"zdn\",\"description\":\"jq\",\"componentId\":\"hmuouqfprwzwbn\",\"imageType\":\"Applications\",\"provisioningState\":\"Provisioning\"},\"id\":\"uizga\",\"name\":\"x\",\"type\":\"fizuckyf\"}],\"nextLink\":\"rfidfvzwdz\"}") + "{\"value\":[{\"properties\":{\"image\":\"agalpbuxwgipwhon\",\"imageId\":\"kgshwa\",\"imageName\":\"ixzbinjeputtmryw\",\"regionalDataBoundary\":\"EU\",\"uri\":\"qftiy\",\"description\":\"rnkcqvyxlw\",\"componentId\":\"lsicohoqqnwv\",\"imageType\":\"Policy\",\"provisioningState\":\"Updating\"},\"id\":\"hheunmmqhgyx\",\"name\":\"konocu\",\"type\":\"oklyaxuconuq\"},{\"properties\":{\"image\":\"kbeype\",\"imageId\":\"mjmwvvjektcx\",\"imageName\":\"nhwlrsffrzpwvl\",\"regionalDataBoundary\":\"None\",\"uri\":\"biqylihkaet\",\"description\":\"tvfcivfsn\",\"componentId\":\"m\",\"imageType\":\"Applications\",\"provisioningState\":\"Provisioning\"},\"id\":\"fbebrjcxer\",\"name\":\"uwutttxfvjrbi\",\"type\":\"phxepcyvahf\"},{\"properties\":{\"image\":\"kyqxjvuujqgidokg\",\"imageId\":\"jyoxgvclt\",\"imageName\":\"sncghkjeszz\",\"regionalDataBoundary\":\"None\",\"uri\":\"htxfvgxbfsmxnehm\",\"description\":\"ec\",\"componentId\":\"odebfqkkrbmpu\",\"imageType\":\"BaseSystemUpdateManifest\",\"provisioningState\":\"Deleting\"},\"id\":\"lzlfbxzpuz\",\"name\":\"cispnqzahmgkbr\",\"type\":\"yydhibnuqqk\"},{\"properties\":{\"image\":\"a\",\"imageId\":\"gvtqagnbuynh\",\"imageName\":\"gg\",\"regionalDataBoundary\":\"None\",\"uri\":\"siarbutrcvpn\",\"description\":\"zmhjrunmp\",\"componentId\":\"tdbhrbnla\",\"imageType\":\"NormalWorldDtb\",\"provisioningState\":\"Canceled\"},\"id\":\"k\",\"name\":\"bhenbtkcxywnyt\",\"type\":\"rsyn\"}],\"nextLink\":\"idybyxczf\"}") .toObject(ImageListResult.class); - Assertions.assertEquals("fouflmmnkzsmo", model.value().get(0).properties().image()); - Assertions.assertEquals("glougpbk", model.value().get(0).properties().imageId()); - Assertions.assertEquals(RegionalDataBoundary.NONE, model.value().get(0).properties().regionalDataBoundary()); - Assertions.assertEquals("rfidfvzwdz", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageListResult model = new ImageListResult().withValue(Arrays.asList( - new ImageInner().withProperties(new ImageProperties().withImage("fouflmmnkzsmo") - .withImageId("glougpbk") - .withRegionalDataBoundary(RegionalDataBoundary.NONE)), - new ImageInner().withProperties(new ImageProperties().withImage("awrlyx") - .withImageId("kcprbnw") - .withRegionalDataBoundary(RegionalDataBoundary.NONE)))) - .withNextLink("rfidfvzwdz"); - model = BinaryData.fromObject(model).toObject(ImageListResult.class); - Assertions.assertEquals("fouflmmnkzsmo", model.value().get(0).properties().image()); - Assertions.assertEquals("glougpbk", model.value().get(0).properties().imageId()); - Assertions.assertEquals(RegionalDataBoundary.NONE, model.value().get(0).properties().regionalDataBoundary()); - Assertions.assertEquals("rfidfvzwdz", model.nextLink()); + Assertions.assertEquals("agalpbuxwgipwhon", model.value().get(0).properties().image()); + Assertions.assertEquals("kgshwa", model.value().get(0).properties().imageId()); + Assertions.assertEquals(RegionalDataBoundary.EU, model.value().get(0).properties().regionalDataBoundary()); + Assertions.assertEquals("idybyxczf", model.nextLink()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagePropertiesTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagePropertiesTests.java index c35e07df119e3..688573ded932b 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagePropertiesTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -13,21 +13,21 @@ public final class ImagePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ImageProperties model = BinaryData.fromString( - "{\"image\":\"inpvswjdkirsoodq\",\"imageId\":\"crmnohjtckwhds\",\"imageName\":\"fiyipjxsqwpgrj\",\"regionalDataBoundary\":\"EU\",\"uri\":\"rcjxvsnbyxqabn\",\"description\":\"cpc\",\"componentId\":\"hurzafblj\",\"imageType\":\"InvalidImageType\",\"provisioningState\":\"Provisioning\"}") + "{\"image\":\"j\",\"imageId\":\"dxob\",\"imageName\":\"dxkqpx\",\"regionalDataBoundary\":\"EU\",\"uri\":\"ionpimexg\",\"description\":\"xgcp\",\"componentId\":\"gmaajrm\",\"imageType\":\"NormalWorldKernel\",\"provisioningState\":\"Accepted\"}") .toObject(ImageProperties.class); - Assertions.assertEquals("inpvswjdkirsoodq", model.image()); - Assertions.assertEquals("crmnohjtckwhds", model.imageId()); + Assertions.assertEquals("j", model.image()); + Assertions.assertEquals("dxob", model.imageId()); Assertions.assertEquals(RegionalDataBoundary.EU, model.regionalDataBoundary()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ImageProperties model = new ImageProperties().withImage("inpvswjdkirsoodq") - .withImageId("crmnohjtckwhds") + ImageProperties model = new ImageProperties().withImage("j") + .withImageId("dxob") .withRegionalDataBoundary(RegionalDataBoundary.EU); model = BinaryData.fromObject(model).toObject(ImageProperties.class); - Assertions.assertEquals("inpvswjdkirsoodq", model.image()); - Assertions.assertEquals("crmnohjtckwhds", model.imageId()); + Assertions.assertEquals("j", model.image()); + Assertions.assertEquals("dxob", model.imageId()); Assertions.assertEquals(RegionalDataBoundary.EU, model.regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesCreateOrUpdateMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesCreateOrUpdateMockTests.java index e0f8ba1019062..c1a0fffa79804 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesCreateOrUpdateMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesCreateOrUpdateMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.Image; @@ -23,25 +23,25 @@ public final class ImagesCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"image\":\"vqtmnub\",\"imageId\":\"kpzksmondjmq\",\"imageName\":\"vypomgkopkwho\",\"regionalDataBoundary\":\"EU\",\"uri\":\"jqg\",\"description\":\"smocmbq\",\"componentId\":\"vmkcx\",\"imageType\":\"Nwfs\",\"provisioningState\":\"Succeeded\"},\"id\":\"elxprglyatddck\",\"name\":\"bcuejrjxgci\",\"type\":\"ibrhosxsdqr\"}"; + = "{\"properties\":{\"image\":\"kcdyhbpk\",\"imageId\":\"wdreqnovvqfovl\",\"imageName\":\"ywsuwsy\",\"regionalDataBoundary\":\"EU\",\"uri\":\"sytgadgvraea\",\"description\":\"e\",\"componentId\":\"zar\",\"imageType\":\"InvalidImageType\",\"provisioningState\":\"Succeeded\"},\"id\":\"ijfqkacewiipfp\",\"name\":\"bjibwwiftohq\",\"type\":\"vpuvks\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Image response = manager.images() - .define("apnedgfbcvkc") - .withExistingCatalog("hdlxyjrxsagafcn", "hgw") - .withProperties(new ImageProperties().withImage("pkeqdcvdrhvoo") - .withImageId("otbobzdopcj") + .define("piexpbtgiw") + .withExistingCatalog("szdtmhrkwof", "yvoqa") + .withProperties(new ImageProperties().withImage("enwash") + .withImageId("dtkcnqxwbpokulp") .withRegionalDataBoundary(RegionalDataBoundary.EU)) .create(); - Assertions.assertEquals("vqtmnub", response.properties().image()); - Assertions.assertEquals("kpzksmondjmq", response.properties().imageId()); + Assertions.assertEquals("kcdyhbpk", response.properties().image()); + Assertions.assertEquals("wdreqnovvqfovl", response.properties().imageId()); Assertions.assertEquals(RegionalDataBoundary.EU, response.properties().regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesDeleteMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesDeleteMockTests.java index bb01645aae5d7..5cb89fbfabddd 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesDeleteMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesDeleteMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDelete() throws Exception { AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.images().delete("a", "lvpnpp", "uflrwd", com.azure.core.util.Context.NONE); + manager.images().delete("mutwuoe", "rpkhjwn", "yqsluic", com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesGetWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesGetWithResponseMockTests.java index 256df3400fb01..518be204b2183 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesGetWithResponseMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.Image; @@ -22,21 +22,21 @@ public final class ImagesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"image\":\"lkfg\",\"imageId\":\"dneu\",\"imageName\":\"fphsdyhtozfikdow\",\"regionalDataBoundary\":\"None\",\"uri\":\"v\",\"description\":\"xclvit\",\"componentId\":\"qzonosggbhcohf\",\"imageType\":\"OneBl\",\"provisioningState\":\"Accepted\"},\"id\":\"aljutiiswac\",\"name\":\"fgdkzzew\",\"type\":\"fvhqc\"}"; + = "{\"properties\":{\"image\":\"swacffgdkzz\",\"imageId\":\"kfvhqcrailvpn\",\"imageName\":\"fuflrwdmhdlx\",\"regionalDataBoundary\":\"EU\",\"uri\":\"sag\",\"description\":\"cnihgwqapnedgfbc\",\"componentId\":\"cvqvpkeqdcv\",\"imageType\":\"FwConfig\",\"provisioningState\":\"Provisioning\"},\"id\":\"dsotbobzd\",\"name\":\"pcjwv\",\"type\":\"hdldwmgxcxrsl\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Image response = manager.images() - .getWithResponse("mpgcjefuzmuvpbt", "d", "morppxebmnzbtbh", com.azure.core.util.Context.NONE) + .getWithResponse("xclvit", "hqzonosggbhcoh", "wdsjnkalju", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("lkfg", response.properties().image()); - Assertions.assertEquals("dneu", response.properties().imageId()); - Assertions.assertEquals(RegionalDataBoundary.NONE, response.properties().regionalDataBoundary()); + Assertions.assertEquals("swacffgdkzz", response.properties().image()); + Assertions.assertEquals("kfvhqcrailvpn", response.properties().imageId()); + Assertions.assertEquals(RegionalDataBoundary.EU, response.properties().regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesListByCatalogMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesListByCatalogMockTests.java index 788492f7d2a0a..6a2b920b03958 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesListByCatalogMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesListByCatalogMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.Image; @@ -23,22 +23,22 @@ public final class ImagesListByCatalogMockTests { @Test public void testListByCatalog() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"image\":\"tfz\",\"imageId\":\"hhvh\",\"imageName\":\"r\",\"regionalDataBoundary\":\"EU\",\"uri\":\"wobdagxtibqdx\",\"description\":\"wakbogqxndl\",\"componentId\":\"gxhuriplbp\",\"imageType\":\"Services\",\"provisioningState\":\"Deleting\"},\"id\":\"bebxmubyyntwl\",\"name\":\"bqtkoievseotgqr\",\"type\":\"ltmuwlauwzizx\"}]}"; + = "{\"value\":[{\"properties\":{\"image\":\"mnubexkpzksmond\",\"imageId\":\"quxvypomgkop\",\"imageName\":\"hojvpajqgxysmocm\",\"regionalDataBoundary\":\"None\",\"uri\":\"vmkcx\",\"description\":\"apvhelxprgly\",\"componentId\":\"dd\",\"imageType\":\"InvalidImageType\",\"provisioningState\":\"Provisioning\"},\"id\":\"ejrjxgciqibrho\",\"name\":\"xsdqrhzoymibmrqy\",\"type\":\"bahwfl\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.images() - .listByCatalog("mwmbes", "dnkwwtppjflcxog", "okonzmnsikvmkqz", 1984679669, 1625673068, 1138945921, + .listByCatalog("dggkzzlvmbmpa", "modfvuefywsbpfvm", "yhrfouyftaakcpw", 1209208693, 1040923285, 1777343462, com.azure.core.util.Context.NONE); - Assertions.assertEquals("tfz", response.iterator().next().properties().image()); - Assertions.assertEquals("hhvh", response.iterator().next().properties().imageId()); - Assertions.assertEquals(RegionalDataBoundary.EU, + Assertions.assertEquals("mnubexkpzksmond", response.iterator().next().properties().image()); + Assertions.assertEquals("quxvypomgkop", response.iterator().next().properties().imageId()); + Assertions.assertEquals(RegionalDataBoundary.NONE, response.iterator().next().properties().regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ListDeviceGroupsRequestTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ListDeviceGroupsRequestTests.java index 70968a65ae0eb..940752f0e474f 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ListDeviceGroupsRequestTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ListDeviceGroupsRequestTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -12,14 +12,14 @@ public final class ListDeviceGroupsRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ListDeviceGroupsRequest model - = BinaryData.fromString("{\"deviceGroupName\":\"q\"}").toObject(ListDeviceGroupsRequest.class); - Assertions.assertEquals("q", model.deviceGroupName()); + = BinaryData.fromString("{\"deviceGroupName\":\"lovmclwhijcoe\"}").toObject(ListDeviceGroupsRequest.class); + Assertions.assertEquals("lovmclwhijcoe", model.deviceGroupName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ListDeviceGroupsRequest model = new ListDeviceGroupsRequest().withDeviceGroupName("q"); + ListDeviceGroupsRequest model = new ListDeviceGroupsRequest().withDeviceGroupName("lovmclwhijcoe"); model = BinaryData.fromObject(model).toObject(ListDeviceGroupsRequest.class); - Assertions.assertEquals("q", model.deviceGroupName()); + Assertions.assertEquals("lovmclwhijcoe", model.deviceGroupName()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationDisplayTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationDisplayTests.java index 919921646ba46..35b34dfdc6972 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationDisplayTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationDisplayTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -11,13 +11,7 @@ public final class OperationDisplayTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"yrtih\",\"resource\":\"tijbpzvgnwzsymgl\",\"operation\":\"fcyzkohdbihanufh\",\"description\":\"bj\"}") + "{\"provider\":\"cdm\",\"resource\":\"rcryuanzwuxzdxta\",\"operation\":\"lhmwhfpmrqobm\",\"description\":\"kknryrtihf\"}") .toObject(OperationDisplay.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationInnerTests.java index f30b7af5fbae9..24d12ba7a3bfe 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationInnerTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationInnerTests.java @@ -1,24 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.sphere.fluent.models.OperationInner; -import com.azure.resourcemanager.sphere.models.OperationDisplay; public final class OperationInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationInner model = BinaryData.fromString( - "{\"name\":\"usarhmofc\",\"isDataAction\":false,\"display\":{\"provider\":\"urkdtmlx\",\"resource\":\"kuksjtxukcdm\",\"operation\":\"rcryuanzwuxzdxta\",\"description\":\"lhmwhfpmrqobm\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") + "{\"name\":\"nygj\",\"isDataAction\":true,\"display\":{\"provider\":\"eqsrdeupewnwreit\",\"resource\":\"yflusarhmofc\",\"operation\":\"smy\",\"description\":\"kdtmlxhekuk\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") .toObject(OperationInner.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationListResultTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationListResultTests.java index da51bda792f98..220aa17b24fa0 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationListResultTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationListResultTests.java @@ -1,23 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.models.OperationListResult; +import com.azure.resourcemanager.sphere.implementation.models.OperationListResult; +import org.junit.jupiter.api.Assertions; public final class OperationListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"quvgjxpybczme\",\"isDataAction\":true,\"display\":{\"provider\":\"pbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"izhwlrxy\",\"isDataAction\":false,\"display\":{\"provider\":\"ijgkdm\",\"resource\":\"azlobcufpdznrbt\",\"operation\":\"qjnqglhqgnufoooj\",\"description\":\"ifsqesaagdfmg\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"rifkwm\",\"isDataAction\":true,\"display\":{\"provider\":\"izntocipao\",\"resource\":\"jpsq\",\"operation\":\"mpoyfd\",\"description\":\"ogknygjofjdd\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"upewnwreitjzy\"}") + "{\"value\":[{\"name\":\"hq\",\"isDataAction\":true,\"display\":{\"provider\":\"pybczmehmtzopb\",\"resource\":\"h\",\"operation\":\"pidgsybbejhphoyc\",\"description\":\"xaobhdxbmtqioqjz\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"fpownoizhwlr\",\"isDataAction\":false,\"display\":{\"provider\":\"oqijgkdmbpaz\",\"resource\":\"bc\",\"operation\":\"pdznrbtcqqjnqgl\",\"description\":\"gnufoooj\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"esaagdfm\",\"isDataAction\":true,\"display\":{\"provider\":\"j\",\"resource\":\"ifkwmrvktsizntoc\",\"operation\":\"a\",\"description\":\"ajpsquc\"},\"origin\":\"system\",\"actionType\":\"Internal\"}],\"nextLink\":\"kfo\"}") .toObject(OperationListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); + Assertions.assertEquals("kfo", model.nextLink()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationsListMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationsListMockTests.java index e11459dbf5ef3..ea9962e16c9e7 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationsListMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.Operation; @@ -21,14 +21,14 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"hjjdhtldwkyzxuut\",\"isDataAction\":true,\"display\":{\"provider\":\"cwsvlxotog\",\"resource\":\"rupqsxvnmicy\",\"operation\":\"ceoveilovno\",\"description\":\"fj\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}"; + = "{\"value\":[{\"name\":\"pnvjtoqnermclf\",\"isDataAction\":false,\"display\":{\"provider\":\"xus\",\"resource\":\"pabgyeps\",\"operation\":\"tazqugxywpmueefj\",\"description\":\"fqkquj\"},\"origin\":\"user\",\"actionType\":\"Internal\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/PagedDeviceInsightTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/PagedDeviceInsightTests.java index 0928aecbdd13c..95c65693e4573 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/PagedDeviceInsightTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/PagedDeviceInsightTests.java @@ -1,70 +1,28 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.DeviceInsightInner; -import com.azure.resourcemanager.sphere.models.PagedDeviceInsight; +import com.azure.resourcemanager.sphere.implementation.models.PagedDeviceInsight; import java.time.OffsetDateTime; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class PagedDeviceInsightTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PagedDeviceInsight model = BinaryData.fromString( - "{\"value\":[{\"deviceId\":\"rsa\",\"description\":\"iwkuofos\",\"startTimestampUtc\":\"2021-06-28T14:02:06Z\",\"endTimestampUtc\":\"2021-03-08T03:12:48Z\",\"eventCategory\":\"sauuimj\",\"eventClass\":\"vxieduugidyj\",\"eventType\":\"rfbyaosvexcso\",\"eventCount\":771742090},{\"deviceId\":\"clhocohsl\",\"description\":\"ev\",\"startTimestampUtc\":\"2021-02-15T02:43:43Z\",\"endTimestampUtc\":\"2021-07-27T15:45:18Z\",\"eventCategory\":\"gz\",\"eventClass\":\"buhfmvfaxkffeiit\",\"eventType\":\"lvmezyvshxmzsbbz\",\"eventCount\":681165656},{\"deviceId\":\"gigr\",\"description\":\"wburvjxxjnspydpt\",\"startTimestampUtc\":\"2021-07-25T09:18:50Z\",\"endTimestampUtc\":\"2021-09-24T03:08Z\",\"eventCategory\":\"nkoukn\",\"eventClass\":\"udwtiukbl\",\"eventType\":\"ngkpocipazy\",\"eventCount\":212177726}],\"nextLink\":\"gukgjnpiucgygevq\"}") + "{\"value\":[{\"deviceId\":\"h\",\"description\":\"qfbow\",\"startTimestampUtc\":\"2021-05-06T05:02:34Z\",\"endTimestampUtc\":\"2021-05-19T19:15:18Z\",\"eventCategory\":\"nyktzlcuiy\",\"eventClass\":\"gqywgndrv\",\"eventType\":\"nhzgpphrcgyn\",\"eventCount\":776269865},{\"deviceId\":\"cpecfvmmcoofs\",\"description\":\"lzevgbmqjqab\",\"startTimestampUtc\":\"2021-05-28T08:17:24Z\",\"endTimestampUtc\":\"2021-02-17T22:01:44Z\",\"eventCategory\":\"mivkwlzuvcc\",\"eventClass\":\"wnfnbacf\",\"eventType\":\"onlebxetqgtzxdpn\",\"eventCount\":1802954017},{\"deviceId\":\"qqwx\",\"description\":\"jfeallnwsub\",\"startTimestampUtc\":\"2021-03-05T06:08:28Z\",\"endTimestampUtc\":\"2021-08-13T08:02:10Z\",\"eventCategory\":\"jampmngnzscxaqw\",\"eventClass\":\"ochcbonqvpkvl\",\"eventType\":\"xnj\",\"eventCount\":635672501}],\"nextLink\":\"eipheoflokeyy\"}") .toObject(PagedDeviceInsight.class); - Assertions.assertEquals("rsa", model.value().get(0).deviceId()); - Assertions.assertEquals("iwkuofos", model.value().get(0).description()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-28T14:02:06Z"), model.value().get(0).startTimestampUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-08T03:12:48Z"), model.value().get(0).endTimestampUtc()); - Assertions.assertEquals("sauuimj", model.value().get(0).eventCategory()); - Assertions.assertEquals("vxieduugidyj", model.value().get(0).eventClass()); - Assertions.assertEquals("rfbyaosvexcso", model.value().get(0).eventType()); - Assertions.assertEquals(771742090, model.value().get(0).eventCount()); - Assertions.assertEquals("gukgjnpiucgygevq", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PagedDeviceInsight model = new PagedDeviceInsight().withValue(Arrays.asList( - new DeviceInsightInner().withDeviceId("rsa") - .withDescription("iwkuofos") - .withStartTimestampUtc(OffsetDateTime.parse("2021-06-28T14:02:06Z")) - .withEndTimestampUtc(OffsetDateTime.parse("2021-03-08T03:12:48Z")) - .withEventCategory("sauuimj") - .withEventClass("vxieduugidyj") - .withEventType("rfbyaosvexcso") - .withEventCount(771742090), - new DeviceInsightInner().withDeviceId("clhocohsl") - .withDescription("ev") - .withStartTimestampUtc(OffsetDateTime.parse("2021-02-15T02:43:43Z")) - .withEndTimestampUtc(OffsetDateTime.parse("2021-07-27T15:45:18Z")) - .withEventCategory("gz") - .withEventClass("buhfmvfaxkffeiit") - .withEventType("lvmezyvshxmzsbbz") - .withEventCount(681165656), - new DeviceInsightInner().withDeviceId("gigr") - .withDescription("wburvjxxjnspydpt") - .withStartTimestampUtc(OffsetDateTime.parse("2021-07-25T09:18:50Z")) - .withEndTimestampUtc(OffsetDateTime.parse("2021-09-24T03:08Z")) - .withEventCategory("nkoukn") - .withEventClass("udwtiukbl") - .withEventType("ngkpocipazy") - .withEventCount(212177726))) - .withNextLink("gukgjnpiucgygevq"); - model = BinaryData.fromObject(model).toObject(PagedDeviceInsight.class); - Assertions.assertEquals("rsa", model.value().get(0).deviceId()); - Assertions.assertEquals("iwkuofos", model.value().get(0).description()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-28T14:02:06Z"), model.value().get(0).startTimestampUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-08T03:12:48Z"), model.value().get(0).endTimestampUtc()); - Assertions.assertEquals("sauuimj", model.value().get(0).eventCategory()); - Assertions.assertEquals("vxieduugidyj", model.value().get(0).eventClass()); - Assertions.assertEquals("rfbyaosvexcso", model.value().get(0).eventType()); - Assertions.assertEquals(771742090, model.value().get(0).eventCount()); - Assertions.assertEquals("gukgjnpiucgygevq", model.nextLink()); + Assertions.assertEquals("h", model.value().get(0).deviceId()); + Assertions.assertEquals("qfbow", model.value().get(0).description()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-06T05:02:34Z"), model.value().get(0).startTimestampUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-19T19:15:18Z"), model.value().get(0).endTimestampUtc()); + Assertions.assertEquals("nyktzlcuiy", model.value().get(0).eventCategory()); + Assertions.assertEquals("gqywgndrv", model.value().get(0).eventClass()); + Assertions.assertEquals("nhzgpphrcgyn", model.value().get(0).eventType()); + Assertions.assertEquals(776269865, model.value().get(0).eventCount()); + Assertions.assertEquals("eipheoflokeyy", model.nextLink()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductInnerTests.java index aff0397719aaf..e5e7da16532e2 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductInnerTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -13,15 +13,16 @@ public final class ProductInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ProductInner model = BinaryData.fromString( - "{\"properties\":{\"description\":\"s\",\"provisioningState\":\"Provisioning\"},\"id\":\"nxytxh\",\"name\":\"zxbzpfzabglc\",\"type\":\"hxw\"}") + "{\"properties\":{\"description\":\"aaxdbabphlwrq\",\"provisioningState\":\"Succeeded\"},\"id\":\"sthsu\",\"name\":\"ocmnyyazttbtwwrq\",\"type\":\"uedck\"}") .toObject(ProductInner.class); - Assertions.assertEquals("s", model.properties().description()); + Assertions.assertEquals("aaxdbabphlwrq", model.properties().description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ProductInner model = new ProductInner().withProperties(new ProductProperties().withDescription("s")); + ProductInner model + = new ProductInner().withProperties(new ProductProperties().withDescription("aaxdbabphlwrq")); model = BinaryData.fromObject(model).toObject(ProductInner.class); - Assertions.assertEquals("s", model.properties().description()); + Assertions.assertEquals("aaxdbabphlwrq", model.properties().description()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductListResultTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductListResultTests.java index 5c8e716550e92..2431459257ee1 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductListResultTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductListResultTests.java @@ -1,34 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.ProductInner; -import com.azure.resourcemanager.sphere.models.ProductListResult; -import com.azure.resourcemanager.sphere.models.ProductProperties; -import java.util.Arrays; +import com.azure.resourcemanager.sphere.implementation.models.ProductListResult; import org.junit.jupiter.api.Assertions; public final class ProductListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ProductListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"description\":\"qpuedckzywbiex\",\"provisioningState\":\"Provisioning\"},\"id\":\"ue\",\"name\":\"xibxujwbhqwalm\",\"type\":\"zyoxaepdkzjan\"}],\"nextLink\":\"xrhdwbavxbniwdjs\"}") + "{\"value\":[{\"properties\":{\"description\":\"zjancuxr\",\"provisioningState\":\"Provisioning\"},\"id\":\"avxbniwdjswztsdb\",\"name\":\"gnxytxhpzxbz\",\"type\":\"fzab\"},{\"properties\":{\"description\":\"uhxwtctyqiklbbov\",\"provisioningState\":\"Canceled\"},\"id\":\"bhvgy\",\"name\":\"gu\",\"type\":\"svmkfssxquk\"},{\"properties\":{\"description\":\"l\",\"provisioningState\":\"Succeeded\"},\"id\":\"xnkjzkdesl\",\"name\":\"vlopwiyighx\",\"type\":\"kdwzbaiuebbaumny\"}],\"nextLink\":\"ped\"}") .toObject(ProductListResult.class); - Assertions.assertEquals("qpuedckzywbiex", model.value().get(0).properties().description()); - Assertions.assertEquals("xrhdwbavxbniwdjs", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProductListResult model = new ProductListResult() - .withValue(Arrays - .asList(new ProductInner().withProperties(new ProductProperties().withDescription("qpuedckzywbiex")))) - .withNextLink("xrhdwbavxbniwdjs"); - model = BinaryData.fromObject(model).toObject(ProductListResult.class); - Assertions.assertEquals("qpuedckzywbiex", model.value().get(0).properties().description()); - Assertions.assertEquals("xrhdwbavxbniwdjs", model.nextLink()); + Assertions.assertEquals("zjancuxr", model.value().get(0).properties().description()); + Assertions.assertEquals("ped", model.nextLink()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductPropertiesTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductPropertiesTests.java index 29d43cc532ecc..d8da9c71f4072 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductPropertiesTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -11,15 +11,16 @@ public final class ProductPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ProductProperties model = BinaryData.fromString("{\"description\":\"tyq\",\"provisioningState\":\"Failed\"}") - .toObject(ProductProperties.class); - Assertions.assertEquals("tyq", model.description()); + ProductProperties model + = BinaryData.fromString("{\"description\":\"wbiexzfey\",\"provisioningState\":\"Updating\"}") + .toObject(ProductProperties.class); + Assertions.assertEquals("wbiexzfey", model.description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ProductProperties model = new ProductProperties().withDescription("tyq"); + ProductProperties model = new ProductProperties().withDescription("wbiexzfey"); model = BinaryData.fromObject(model).toObject(ProductProperties.class); - Assertions.assertEquals("tyq", model.description()); + Assertions.assertEquals("wbiexzfey", model.description()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductUpdatePropertiesTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductUpdatePropertiesTests.java index 6078ea595687b..84cdc2dd272c5 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductUpdatePropertiesTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductUpdatePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -12,14 +12,14 @@ public final class ProductUpdatePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ProductUpdateProperties model - = BinaryData.fromString("{\"description\":\"hvgyuguosvmk\"}").toObject(ProductUpdateProperties.class); - Assertions.assertEquals("hvgyuguosvmk", model.description()); + = BinaryData.fromString("{\"description\":\"bhqwalmuzyoxa\"}").toObject(ProductUpdateProperties.class); + Assertions.assertEquals("bhqwalmuzyoxa", model.description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ProductUpdateProperties model = new ProductUpdateProperties().withDescription("hvgyuguosvmk"); + ProductUpdateProperties model = new ProductUpdateProperties().withDescription("bhqwalmuzyoxa"); model = BinaryData.fromObject(model).toObject(ProductUpdateProperties.class); - Assertions.assertEquals("hvgyuguosvmk", model.description()); + Assertions.assertEquals("bhqwalmuzyoxa", model.description()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductUpdateTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductUpdateTests.java index 8ca49441ba247..ac1b951905238 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductUpdateTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductUpdateTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -13,15 +13,14 @@ public final class ProductUpdateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ProductUpdate model - = BinaryData.fromString("{\"properties\":{\"description\":\"ovplw\"}}").toObject(ProductUpdate.class); - Assertions.assertEquals("ovplw", model.properties().description()); + = BinaryData.fromString("{\"properties\":{\"description\":\"bxu\"}}").toObject(ProductUpdate.class); + Assertions.assertEquals("bxu", model.properties().description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ProductUpdate model - = new ProductUpdate().withProperties(new ProductUpdateProperties().withDescription("ovplw")); + ProductUpdate model = new ProductUpdate().withProperties(new ProductUpdateProperties().withDescription("bxu")); model = BinaryData.fromObject(model).toObject(ProductUpdate.class); - Assertions.assertEquals("ovplw", model.properties().description()); + Assertions.assertEquals("bxu", model.properties().description()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsCountDevicesWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsCountDevicesWithResponseMockTests.java index 24a5f7c7c0461..bf2d785c50fbf 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsCountDevicesWithResponseMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsCountDevicesWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.CountDevicesResponse; @@ -20,19 +20,19 @@ public final class ProductsCountDevicesWithResponseMockTests { @Test public void testCountDevicesWithResponse() throws Exception { - String responseStr = "{\"value\":890415173}"; + String responseStr = "{\"value\":191460496}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); CountDevicesResponse response = manager.products() - .countDevicesWithResponse("reqnovvqfov", "jxywsuws", "rsndsytgadgvra", com.azure.core.util.Context.NONE) + .countDevicesWithResponse("tdtbnnhadooc", "kvci", "hnvpamqgxq", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(890415173, response.value()); + Assertions.assertEquals(191460496, response.value()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsCreateOrUpdateMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsCreateOrUpdateMockTests.java index 6e39695f3a608..209bdff058851 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsCreateOrUpdateMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsCreateOrUpdateMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.Product; @@ -22,21 +22,21 @@ public final class ProductsCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"description\":\"g\",\"provisioningState\":\"Succeeded\"},\"id\":\"mabiknsorgjhxb\",\"name\":\"dtlwwrlkd\",\"type\":\"tncvokot\"}"; + = "{\"properties\":{\"description\":\"pcirelsfeaen\",\"provisioningState\":\"Succeeded\"},\"id\":\"atklddxbjhwuaa\",\"name\":\"oz\",\"type\":\"osphyoul\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Product response = manager.products() - .define("slyzrpzbchckqq") - .withExistingCatalog("jphuopxodlqi", "ntorzihleosjswsr") - .withProperties(new ProductProperties().withDescription("ox")) + .define("vmnpkukghimdblx") + .withExistingCatalog("vgpiohgwxrt", "udxepxgyqagv") + .withProperties(new ProductProperties().withDescription("mfnjh")) .create(); - Assertions.assertEquals("g", response.properties().description()); + Assertions.assertEquals("pcirelsfeaen", response.properties().description()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsDeleteMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsDeleteMockTests.java index 0896714a1a08b..3aa787f0a2a66 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsDeleteMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsDeleteMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDelete() throws Exception { AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.products().delete("joxafnndlpi", "hkoymkcdyhbp", "kpw", com.azure.core.util.Context.NONE); + manager.products().delete("atrwyhqmibzyh", "itsmypyyn", "cdpu", com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsGenerateDefaultDeviceGroupsMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsGenerateDefaultDeviceGroupsMockTests.java index c69d0df3a5b2e..c4661a35097a2 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsGenerateDefaultDeviceGroupsMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsGenerateDefaultDeviceGroupsMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.AllowCrashDumpCollection; @@ -26,25 +26,26 @@ public final class ProductsGenerateDefaultDeviceGroupsMockTests { @Test public void testGenerateDefaultDeviceGroups() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"description\":\"qkacewii\",\"osFeedType\":\"Retail\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Disabled\",\"regionalDataBoundary\":\"EU\",\"hasDeployment\":true,\"provisioningState\":\"Updating\"},\"id\":\"hqkvpuvksgplsak\",\"name\":\"ynfs\",\"type\":\"n\"}]}"; + = "{\"value\":[{\"properties\":{\"description\":\"yrnxxmueedn\",\"osFeedType\":\"Retail\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Disabled\",\"regionalDataBoundary\":\"None\",\"hasDeployment\":false,\"provisioningState\":\"Updating\"},\"id\":\"alm\",\"name\":\"mtdaa\",\"type\":\"gdv\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response - = manager.products().generateDefaultDeviceGroups("en", "qnzarrwl", "uu", com.azure.core.util.Context.NONE); + PagedIterable response = manager.products() + .generateDefaultDeviceGroups("ezikywggxkal", "atmelwui", "iccjzkzivgvvcna", + com.azure.core.util.Context.NONE); - Assertions.assertEquals("qkacewii", response.iterator().next().properties().description()); + Assertions.assertEquals("yrnxxmueedn", response.iterator().next().properties().description()); Assertions.assertEquals(OSFeedType.RETAIL, response.iterator().next().properties().osFeedType()); Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, response.iterator().next().properties().updatePolicy()); Assertions.assertEquals(AllowCrashDumpCollection.DISABLED, response.iterator().next().properties().allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.EU, + Assertions.assertEquals(RegionalDataBoundary.NONE, response.iterator().next().properties().regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsGetWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsGetWithResponseMockTests.java index 9a2f3a39ed8dc..d1d9489b933ce 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsGetWithResponseMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.Product; @@ -21,19 +21,19 @@ public final class ProductsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"description\":\"yuq\",\"provisioningState\":\"Provisioning\"},\"id\":\"lp\",\"name\":\"wcciuqgbdbu\",\"type\":\"auvfbtkuwhhmhyk\"}"; + = "{\"properties\":{\"description\":\"leosjswsrms\",\"provisioningState\":\"Failed\"},\"id\":\"pzbchck\",\"name\":\"qzqioxiysuiizy\",\"type\":\"ked\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Product response = manager.products() - .getWithResponse("kcnqxwbpo", "ulpiuj", "aasipqi", com.azure.core.util.Context.NONE) + .getWithResponse("plsaknynfsynljph", "op", "odlqiyntor", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("yuq", response.properties().description()); + Assertions.assertEquals("leosjswsrms", response.properties().description()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsListByCatalogMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsListByCatalogMockTests.java index 61a6cdbb582a5..8203dea8723fd 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsListByCatalogMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsListByCatalogMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.Product; @@ -22,18 +22,18 @@ public final class ProductsListByCatalogMockTests { @Test public void testListByCatalog() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"description\":\"oqac\",\"provisioningState\":\"Accepted\"},\"id\":\"pbtg\",\"name\":\"wbwo\",\"type\":\"nwashrtd\"}]}"; + = "{\"value\":[{\"properties\":{\"description\":\"ldtlwwr\",\"provisioningState\":\"Accepted\"},\"id\":\"tncvokot\",\"name\":\"lxdy\",\"type\":\"gsyocogj\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureSphereManager manager = AzureSphereManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.products().listByCatalog("zoymibmrqyibahw", "luszdtmhrkwof", com.azure.core.util.Context.NONE); + = manager.products().listByCatalog("nzgmwznmabik", "sorgj", com.azure.core.util.Context.NONE); - Assertions.assertEquals("oqac", response.iterator().next().properties().description()); + Assertions.assertEquals("ldtlwwr", response.iterator().next().properties().description()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProofOfPossessionNonceRequestTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProofOfPossessionNonceRequestTests.java index 34e5a6fe072f9..a60c2b71068d7 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProofOfPossessionNonceRequestTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProofOfPossessionNonceRequestTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -11,15 +11,16 @@ public final class ProofOfPossessionNonceRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ProofOfPossessionNonceRequest model = BinaryData.fromString("{\"proofOfPossessionNonce\":\"jkot\"}") + ProofOfPossessionNonceRequest model = BinaryData.fromString("{\"proofOfPossessionNonce\":\"ydnfyhxdeoejz\"}") .toObject(ProofOfPossessionNonceRequest.class); - Assertions.assertEquals("jkot", model.proofOfPossessionNonce()); + Assertions.assertEquals("ydnfyhxdeoejz", model.proofOfPossessionNonce()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ProofOfPossessionNonceRequest model = new ProofOfPossessionNonceRequest().withProofOfPossessionNonce("jkot"); + ProofOfPossessionNonceRequest model + = new ProofOfPossessionNonceRequest().withProofOfPossessionNonce("ydnfyhxdeoejz"); model = BinaryData.fromObject(model).toObject(ProofOfPossessionNonceRequest.class); - Assertions.assertEquals("jkot", model.proofOfPossessionNonce()); + Assertions.assertEquals("ydnfyhxdeoejz", model.proofOfPossessionNonce()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProofOfPossessionNonceResponseInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProofOfPossessionNonceResponseInnerTests.java index a27a3f0b1011f..8153c9a5af226 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProofOfPossessionNonceResponseInnerTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProofOfPossessionNonceResponseInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -11,13 +11,7 @@ public final class ProofOfPossessionNonceResponseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ProofOfPossessionNonceResponseInner model = BinaryData.fromString( - "{\"certificate\":\"qgoulznd\",\"status\":\"Active\",\"subject\":\"yqkgfg\",\"thumbprint\":\"madgakeqsrxyb\",\"expiryUtc\":\"2021-03-26T22:16:08Z\",\"notBeforeUtc\":\"2021-02-21T09:55:36Z\",\"provisioningState\":\"Deleting\"}") + "{\"certificate\":\"w\",\"status\":\"Expired\",\"subject\":\"ttgzfbis\",\"thumbprint\":\"bkh\",\"expiryUtc\":\"2021-05-05T10:08:59Z\",\"notBeforeUtc\":\"2020-12-31T23:44:32Z\",\"provisioningState\":\"Canceled\"}") .toObject(ProofOfPossessionNonceResponseInner.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProofOfPossessionNonceResponseInner model = new ProofOfPossessionNonceResponseInner(); - model = BinaryData.fromObject(model).toObject(ProofOfPossessionNonceResponseInner.class); - } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/SignedCapabilityImageResponseInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/SignedCapabilityImageResponseInnerTests.java index eadaa20bd300f..67943555e2f0a 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/SignedCapabilityImageResponseInnerTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/SignedCapabilityImageResponseInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.sphere.generated; @@ -10,13 +10,7 @@ public final class SignedCapabilityImageResponseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SignedCapabilityImageResponseInner model - = BinaryData.fromString("{\"image\":\"sapskr\"}").toObject(SignedCapabilityImageResponseInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SignedCapabilityImageResponseInner model = new SignedCapabilityImageResponseInner(); - model = BinaryData.fromObject(model).toObject(SignedCapabilityImageResponseInner.class); + SignedCapabilityImageResponseInner model = BinaryData.fromString("{\"image\":\"njbkcnxdhbttkph\"}") + .toObject(SignedCapabilityImageResponseInner.class); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/tsp-location.yaml b/sdk/sphere/azure-resourcemanager-sphere/tsp-location.yaml new file mode 100644 index 0000000000000..ab7c58a581a06 --- /dev/null +++ b/sdk/sphere/azure-resourcemanager-sphere/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/sphere/resource-manager/Microsoft.AzureSphere/AzureSphere +commit: dc7218d2648d05079de45c616d940deded784a7d +repo: Azure/azure-rest-api-specs +additionalDirectories: