diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 64e4bb508a77..4996a867a1dd 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -452,7 +452,7 @@ com.azure.resourcemanager:azure-resourcemanager-managednetworkfabric;1.1.0;1.2.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.3.0;1.4.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.1.0;1.2.0-beta.2 diff --git a/sdk/sphere/azure-resourcemanager-sphere/CHANGELOG.md b/sdk/sphere/azure-resourcemanager-sphere/CHANGELOG.md index af53206dfbb3..1a8e6faae31d 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/CHANGELOG.md +++ b/sdk/sphere/azure-resourcemanager-sphere/CHANGELOG.md @@ -1,14 +1,169 @@ # Release History -## 1.2.0-beta.1 (Unreleased) +## 1.2.0 (2026-06-04) -### 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.DeviceUpdateProperties` was removed + +#### `models.DeviceGroupUpdateProperties` was removed + +#### `models.ProductUpdateProperties` 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.DeviceGroup$Update` was modified + +* `withProperties(models.DeviceGroupUpdateProperties)` was removed + +#### `models.ProofOfPossessionNonceRequest` was modified + +* `validate()` was removed + +#### `models.DeviceProperties` was modified + +* `validate()` was removed + +#### `models.CertificateProperties` was modified + +* `validate()` was removed + +#### `models.Product$Update` was modified + +* `withProperties(models.ProductUpdateProperties)` was removed + +#### `models.DeviceUpdate` was modified + +* `properties()` was removed +* `withProperties(models.DeviceUpdateProperties)` was removed +* `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.Device$Update` was modified + +* `withProperties(models.DeviceUpdateProperties)` was removed + +#### `models.CountElementsResponse` was modified + +* `models.CountElementsResponse withValue(int)` -> `models.CountElementsResponse withValue(int)` +* `validate()` was removed + +#### `models.GenerateCapabilityImageRequest` was modified + +* `validate()` was removed + +#### `models.CatalogProperties` was modified + +* `validate()` was removed + +#### `models.ProductUpdate` was modified + +* `withProperties(models.ProductUpdateProperties)` was removed +* `validate()` was removed +* `properties()` was removed + +#### `models.ClaimDevicesRequest` was modified + +* `validate()` was removed + +#### `models.DeviceGroupUpdate` was modified + +* `withProperties(models.DeviceGroupUpdateProperties)` was removed +* `validate()` was removed +* `properties()` was removed + +#### `models.ImageProperties` was modified + +* `validate()` was removed + +#### `models.ProductProperties` was modified + +* `validate()` was removed + +### Features Added + +#### `models.DeviceGroup$Update` was modified + +* `withUpdatePolicy(models.UpdatePolicy)` was added +* `withAllowCrashDumpsCollection(models.AllowCrashDumpCollection)` was added +* `withRegionalDataBoundary(models.RegionalDataBoundary)` was added +* `withDescription(java.lang.String)` was added +* `withOsFeedType(models.OSFeedType)` was added + +#### `models.Product$Update` was modified + +* `withDescription(java.lang.String)` was added + +#### `models.DeviceUpdate` was modified + +* `withDeviceGroupId(java.lang.String)` was added +* `deviceGroupId()` was added + +#### `models.Device$Update` was modified + +* `withDeviceGroupId(java.lang.String)` was added + +#### `models.ProductUpdate` was modified + +* `description()` was added +* `withDescription(java.lang.String)` was added + +#### `models.DeviceGroupUpdate` was modified -### Other Changes +* `allowCrashDumpsCollection()` was added +* `withUpdatePolicy(models.UpdatePolicy)` was added +* `withRegionalDataBoundary(models.RegionalDataBoundary)` was added +* `withOsFeedType(models.OSFeedType)` was added +* `withAllowCrashDumpsCollection(models.AllowCrashDumpCollection)` was added +* `withDescription(java.lang.String)` was added +* `osFeedType()` was added +* `updatePolicy()` was added +* `description()` was added +* `regionalDataBoundary()` was added ## 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 c83cb85ce457..47bc91d2b735 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 7327f883c415..ca7f428e62d3 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 a154480c3b03..a06b23ac001b 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 + false 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 63706a02bbb7..25dfe2ecd15e 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 5a4f1d01f66c..e2540ef76e3f 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 d66f6cffc0bc..3591dbed9e4a 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 b76a551fcd5e..3c160c9e3069 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 c02caa703a71..93961276fcd6 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. @@ -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 5de380b9aaf7..68ea84578b5a 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. @@ -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 9e6322247bf4..cb2c9131dfd5 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. @@ -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 de16245b13d1..d20a734c54b2 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 fa904d197269..34eb24eb061a 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 684c9df9b38b..259fdf97bf3e 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. * @@ -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 298890c77e25..e30bf5729eed 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 8926263a4005..84e5cdb2702e 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 67ceee12ae2c..5dca61cff0c4 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; @@ -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/models/ProductUpdateProperties.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/ProductUpdateProperties.java similarity index 90% rename from sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProductUpdateProperties.java rename to sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/ProductUpdateProperties.java index a17451099416..fa432fc6d857 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/fluent/models/ProductUpdateProperties.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.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; @@ -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/fluent/models/ProofOfPossessionNonceResponseInner.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/ProofOfPossessionNonceResponseInner.java index c995d548b5fa..f376df3307ba 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 5820b3f23246..39b7b24b0e6b 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 44b34f3f416c..e38ee68971d4 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 725f0e0fae44..60e9d763eaa8 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 6ea35a81ce8e..0876f371a71f 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 86% 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 51d87189e728..44e87c0aa407 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,18 @@ 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.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 +45,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 +64,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -88,6 +77,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 +246,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 +310,23 @@ 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); + } + /** * Gets the final result, or an error, based on last async poll response. * @@ -396,5 +416,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 7087cf6a5339..15dc77d0182c 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; @@ -239,6 +239,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 b6dd7624202a..9e8dda773eb0 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,29 +288,66 @@ 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> 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) + 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> listBySubscriptionNext( - @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> listByResourceGroupNext( - @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" }) @@ -223,7 +355,15 @@ Mono> listByResourceGroupNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listDeploymentsNext( - @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 listDeploymentsNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -231,7 +371,15 @@ Mono> listDeploymentsNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listDeviceGroupsNext( - @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 listDeviceGroupsNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -239,7 +387,15 @@ Mono> listDeviceGroupsNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listDeviceInsightsNext( - @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 listDeviceInsightsNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -247,925 +403,678 @@ Mono> listDeviceInsightsNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listDevicesNext(@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 listDevicesNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 a Catalog along with {@link Response} 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.")); - } + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String catalogName) { 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)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * 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 ManagementException 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 a Catalog 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)); + private Mono getByResourceGroupAsync(String resourceGroupName, String catalogName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, catalogName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * 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 ManagementException 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}. + * @return a Catalog along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String catalogName, + Context context) { + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, accept, 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 ManagementException 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. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public CatalogInner getByResourceGroup(String resourceGroupName, String catalogName) { + return getByResourceGroupWithResponse(resourceGroupName, catalogName, Context.NONE).getValue(); } /** - * List Catalog resources by resource group. + * 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 response of a Catalog list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return an Azure Sphere catalog along with {@link Response} 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.")); - } + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String catalogName, CatalogInner resource) { + final String contentType = "application/json"; 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)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, contentType, accept, resource, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List Catalog resources by resource group. + * Create a Catalog. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. + * @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 response of a Catalog list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return an Azure Sphere catalog along with {@link Response}. */ @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.")); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String catalogName, + CatalogInner resource) { + final String contentType = "application/json"; 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)); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, contentType, accept, resource, + Context.NONE); } /** - * 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)); - } - - /** - * List Catalog resources by resource group. + * 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 response of a Catalog list operation as paginated response with {@link PagedFlux}. + * @return an Azure Sphere catalog along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + @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); } /** - * List Catalog resources by resource group. + * 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 response of a Catalog list operation as paginated response with {@link PagedIterable}. + * @return the {@link PollerFlux} for polling of an Azure Sphere catalog. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + @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()); } /** - * List Catalog resources by resource group. + * Create a Catalog. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. + * @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 response of a Catalog list operation as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of an Azure Sphere catalog. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CatalogInner> beginCreateOrUpdate(String resourceGroupName, + String catalogName, CatalogInner resource) { + Response response = createOrUpdateWithResponse(resourceGroupName, catalogName, resource); + return this.client.getLroResult(response, CatalogInner.class, CatalogInner.class, + Context.NONE); } /** - * Get a Catalog. + * 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 a Catalog along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of an Azure Sphere catalog. */ - @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(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CatalogInner> beginCreateOrUpdate(String resourceGroupName, + String catalogName, CatalogInner resource, Context context) { + Response response = createOrUpdateWithResponse(resourceGroupName, catalogName, resource, context); + return this.client.getLroResult(response, CatalogInner.class, CatalogInner.class, + context); } /** - * Get a Catalog. + * Create 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. + * @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 a 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> 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); + private Mono createOrUpdateAsync(String resourceGroupName, String catalogName, + CatalogInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, catalogName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Get a Catalog. + * 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 a Catalog on successful completion of {@link Mono}. + * @return an Azure Sphere catalog. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String catalogName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, catalogName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public CatalogInner createOrUpdate(String resourceGroupName, String catalogName, CatalogInner resource) { + return beginCreateOrUpdate(resourceGroupName, catalogName, resource).getFinalResult(); } /** - * Get a Catalog. + * 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 a Catalog along with {@link Response}. + * @return an Azure Sphere catalog. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, String catalogName, + public CatalogInner createOrUpdate(String resourceGroupName, String catalogName, CatalogInner resource, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, catalogName, context).block(); + return beginCreateOrUpdate(resourceGroupName, catalogName, resource, context).getFinalResult(); } /** - * Get a Catalog. + * Update 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 a Catalog. + * @return an Azure Sphere catalog along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CatalogInner getByResourceGroup(String resourceGroupName, String catalogName) { - return getByResourceGroupWithResponse(resourceGroupName, catalogName, Context.NONE).getValue(); + private Mono> updateWithResponseAsync(String resourceGroupName, String catalogName, + CatalogUpdate properties) { + 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, contentType, accept, properties, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create a Catalog. + * Update 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 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 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>> 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 accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, resource, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + private Mono updateAsync(String resourceGroupName, String catalogName, CatalogUpdate properties) { + return updateWithResponseAsync(resourceGroupName, catalogName, properties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Create a Catalog. + * Update 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 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 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(); - } + public Response updateWithResponse(String resourceGroupName, String catalogName, + CatalogUpdate properties, Context context) { + 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, resource, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, contentType, accept, properties, context); } /** - * Create a Catalog. + * Update 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 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 Azure Sphere catalog. + * @return an Azure Sphere catalog. */ - @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) + public CatalogInner update(String resourceGroupName, String catalogName, CatalogUpdate properties) { + return updateWithResponse(resourceGroupName, catalogName, properties, Context.NONE).getValue(); } /** - * Create a Catalog. + * Delete 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 PollerFlux} for polling of an Azure Sphere catalog. + * @return the {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CatalogInner> beginCreateOrUpdateAsync(String resourceGroupName, - String catalogName, CatalogInner resource, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, catalogName, resource, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - CatalogInner.class, CatalogInner.class, context); + @ServiceMethod(returns = ReturnType.SINGLE) + 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())); } /** - * Create a Catalog. + * Delete 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. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CatalogInner> beginCreateOrUpdate(String resourceGroupName, - String catalogName, CatalogInner resource) { - return this.beginCreateOrUpdateAsync(resourceGroupName, catalogName, resource).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String catalogName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, Context.NONE); } /** - * Create a Catalog. + * Delete 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. - */ - @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(); - } - - /** - * 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 on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String catalogName, - CatalogInner resource) { - return beginCreateOrUpdateAsync(resourceGroupName, catalogName, resource).last() - .flatMap(this.client::getLroFinalResultOrError); + private Response deleteWithResponse(String resourceGroupName, String catalogName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, context); } /** - * Create a Catalog. + * Delete 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}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @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); + @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()); } /** - * Create a Catalog. + * Delete 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. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CatalogInner createOrUpdate(String resourceGroupName, String catalogName, CatalogInner resource) { - return createOrUpdateAsync(resourceGroupName, catalogName, resource).block(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName) { + Response response = deleteWithResponse(resourceGroupName, catalogName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** - * Create a Catalog. + * Delete 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. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CatalogInner createOrUpdate(String resourceGroupName, String catalogName, CatalogInner resource, + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, Context context) { - return createOrUpdateAsync(resourceGroupName, catalogName, resource, context).block(); + Response response = deleteWithResponse(resourceGroupName, catalogName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** - * 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, catalogName, properties, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + * @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 deleteAsync(String resourceGroupName, String catalogName) { + return beginDeleteAsync(resourceGroupName, catalogName).last().flatMap(this.client::getLroFinalResultOrError); } /** - * 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} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(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 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); + public void delete(String resourceGroupName, String catalogName) { + beginDelete(resourceGroupName, catalogName).getFinalResult(); } /** - * 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 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())); + public void delete(String resourceGroupName, String catalogName, Context context) { + beginDelete(resourceGroupName, catalogName, context).getFinalResult(); } /** - * Update 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 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 of a Catalog list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String catalogName, - CatalogUpdate properties, Context context) { - return updateWithResponseAsync(resourceGroupName, catalogName, properties, context).block(); + 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())); } /** - * Update 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 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. + * @return the response of a Catalog list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CatalogInner update(String resourceGroupName, String catalogName, CatalogUpdate properties) { - return updateWithResponse(resourceGroupName, catalogName, properties, Context.NONE).getValue(); + @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 Response} on successful completion of {@link Mono}. + * @return the response of a Catalog list operation along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { 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())); + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * 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 Response} on successful completion of {@link Mono}. + * @return the response of a Catalog list operation along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { 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); + 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); } /** - * 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 as paginated response with {@link PagedIterable}. */ - @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.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 PagedIterable}. */ - @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) + 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 the {@link SyncPoller} 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) - public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName) { - return this.beginDeleteAsync(resourceGroupName, catalogName).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + 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 the {@link SyncPoller} 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) - public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, - Context context) { - return this.beginDeleteAsync(resourceGroupName, catalogName, context).getSyncPoller(); + @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 A {@link Mono} that completes when a successful response is received. + * @return the response of a Catalog list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String catalogName) { - return beginDeleteAsync(resourceGroupName, catalogName).last().flatMap(this.client::getLroFinalResultOrError); + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * 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 along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String catalogName, Context context) { - return beginDeleteAsync(resourceGroupName, catalogName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + 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); } /** - * 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 as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String catalogName) { - deleteAsync(resourceGroupName, catalogName).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listBySubscriptionNextSinglePage(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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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.SINGLE) - public void delete(String resourceGroupName, String catalogName, Context context) { - deleteAsync(resourceGroupName, catalogName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); } /** @@ -1182,21 +1091,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 +1098,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. * @@ -1270,7 +1128,9 @@ private Mono countDevicesAsync(String resourceGroupNa @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); } /** @@ -1306,21 +1166,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 +1176,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. * @@ -1417,6 +1219,31 @@ private PagedFlux listDeploymentsAsync(String resourceGroupName nextLink -> listDeploymentsNextSinglePageAsync(nextLink)); } + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 listDeploymentsSinglePage(String resourceGroupName, String catalogName, + String filter, Integer top, Integer skip, Integer maxpagesize) { + 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.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Lists deployments for catalog. * @@ -1430,13 +1257,17 @@ private PagedFlux listDeploymentsAsync(String resourceGroupName * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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, 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); } /** @@ -1456,7 +1287,8 @@ public PagedIterable listDeployments(String resourceGroupName, final Integer skip = null; final Integer maxpagesize = null; return new PagedIterable<>( - listDeploymentsAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize)); + () -> listDeploymentsSinglePage(resourceGroupName, catalogName, filter, top, skip, maxpagesize), + nextLink -> listDeploymentsNextSinglePage(nextLink)); } /** @@ -1478,7 +1310,8 @@ public PagedIterable listDeployments(String resourceGroupName, 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,32 +1334,11 @@ 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())); @@ -1542,46 +1354,18 @@ private Mono> listDeviceGroupsSinglePageAsync(St * @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}. + * @return the response of a DeviceGroup list operation as paginated response with {@link PagedFlux}. */ - @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)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listDeviceGroupsAsync(String resourceGroupName, String catalogName, + ListDeviceGroupsRequest listDeviceGroupsRequest, String filter, Integer top, Integer skip, + Integer maxpagesize) { + return new PagedFlux<>(() -> listDeviceGroupsSinglePageAsync(resourceGroupName, catalogName, + listDeviceGroupsRequest, filter, top, skip, maxpagesize), + nextLink -> listDeviceGroupsNextSinglePageAsync(nextLink)); } /** @@ -1590,10 +1374,6 @@ private Mono> listDeviceGroupsSinglePageAsync(St * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1601,8 +1381,11 @@ private Mono> listDeviceGroupsSinglePageAsync(St */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listDeviceGroupsAsync(String resourceGroupName, String catalogName, - ListDeviceGroupsRequest listDeviceGroupsRequest, String filter, Integer top, Integer skip, - Integer maxpagesize) { + ListDeviceGroupsRequest listDeviceGroupsRequest) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final Integer maxpagesize = null; return new PagedFlux<>(() -> listDeviceGroupsSinglePageAsync(resourceGroupName, catalogName, listDeviceGroupsRequest, filter, top, skip, maxpagesize), nextLink -> listDeviceGroupsNextSinglePageAsync(nextLink)); @@ -1614,21 +1397,25 @@ 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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) { - final String filter = null; - final Integer top = null; - final Integer skip = null; - final Integer maxpagesize = null; - return new PagedFlux<>(() -> listDeviceGroupsSinglePageAsync(resourceGroupName, catalogName, - listDeviceGroupsRequest, filter, top, skip, maxpagesize), - nextLink -> listDeviceGroupsNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listDeviceGroupsSinglePage(String resourceGroupName, String catalogName, + ListDeviceGroupsRequest listDeviceGroupsRequest, String filter, Integer top, Integer skip, + Integer maxpagesize) { + 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.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1645,15 +1432,18 @@ private PagedFlux listDeviceGroupsAsync(String resourceGroupNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listDeviceGroupsSinglePage(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)); + 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); } /** @@ -1674,8 +1464,9 @@ 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 new PagedIterable<>(() -> listDeviceGroupsSinglePage(resourceGroupName, catalogName, + listDeviceGroupsRequest, filter, top, skip, maxpagesize), + nextLink -> listDeviceGroupsNextSinglePage(nextLink)); } /** @@ -1698,8 +1489,9 @@ public PagedIterable listDeviceGroups(String resourceGroupName 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,21 +1512,6 @@ 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(), @@ -1745,49 +1522,6 @@ private Mono> listDeviceInsightsSinglePageAsyn .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)); - } - /** * Lists device insights for catalog. * @@ -1831,6 +1565,31 @@ private PagedFlux listDeviceInsightsAsync(String resourceGro nextLink -> listDeviceInsightsNextSinglePageAsync(nextLink)); } + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 listDeviceInsightsSinglePage(String resourceGroupName, String catalogName, + String filter, Integer top, Integer skip, Integer maxpagesize) { + 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.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Lists device insights for catalog. * @@ -1844,13 +1603,17 @@ private PagedFlux listDeviceInsightsAsync(String resourceGro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return 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, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listDeviceInsightsSinglePage(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)); + 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); } /** @@ -1870,7 +1633,8 @@ public PagedIterable listDeviceInsights(String resourceGroup final Integer skip = null; final Integer maxpagesize = null; return new PagedIterable<>( - listDeviceInsightsAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize)); + () -> listDeviceInsightsSinglePage(resourceGroupName, catalogName, filter, top, skip, maxpagesize), + nextLink -> listDeviceInsightsNextSinglePage(nextLink)); } /** @@ -1892,7 +1656,8 @@ public PagedIterable listDeviceInsights(String resourceGroup 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 +1678,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 +1688,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. * @@ -2024,6 +1731,31 @@ private PagedFlux listDevicesAsync(String resourceGroupName, String nextLink -> listDevicesNextSinglePageAsync(nextLink)); } + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 listDevicesSinglePage(String resourceGroupName, String catalogName, + String filter, Integer top, Integer skip, Integer maxpagesize) { + 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.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Lists devices for catalog. * @@ -2037,14 +1769,17 @@ private PagedFlux listDevicesAsync(String resourceGroupName, 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 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, 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); } /** @@ -2063,7 +1798,9 @@ public PagedIterable listDevices(String resourceGroupName, String c final Integer top = null; final Integer skip = null; final Integer maxpagesize = null; - return new PagedIterable<>(listDevicesAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize)); + return new PagedIterable<>( + () -> listDevicesSinglePage(resourceGroupName, catalogName, filter, top, skip, maxpagesize), + nextLink -> listDevicesNextSinglePage(nextLink)); } /** @@ -2085,7 +1822,8 @@ public PagedIterable listDevices(String resourceGroupName, String c 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 +1840,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 +1854,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 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) { + final String contentType = "application/json"; + return service.uploadImageSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, contentType, uploadImageRequest, + Context.NONE); } /** @@ -2178,18 +1874,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 +1894,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,12 +1901,11 @@ 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()); } /** @@ -2228,7 +1922,8 @@ private PollerFlux, Void> beginUploadImageAsync(String resource @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginUploadImage(String resourceGroupName, String catalogName, ImageInner uploadImageRequest) { - return this.beginUploadImageAsync(resourceGroupName, catalogName, uploadImageRequest).getSyncPoller(); + Response response = uploadImageWithResponse(resourceGroupName, catalogName, uploadImageRequest); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -2246,7 +1941,9 @@ public SyncPoller, Void> beginUploadImage(String resourceGroupN @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,25 +1963,6 @@ private Mono uploadImageAsync(String resourceGroupName, String catalogName .flatMap(this.client::getLroFinalResultOrError); } - /** - * 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 A {@link Mono} that completes when a successful response is received. - */ - @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); - } - /** * Creates an image. Use this action when the image ID is unknown. * @@ -2297,7 +1975,7 @@ private Mono uploadImageAsync(String resourceGroupName, String catalogName */ @ServiceMethod(returns = ReturnType.SINGLE) public void uploadImage(String resourceGroupName, String catalogName, ImageInner uploadImageRequest) { - uploadImageAsync(resourceGroupName, catalogName, uploadImageRequest).block(); + beginUploadImage(resourceGroupName, catalogName, uploadImageRequest).getFinalResult(); } /** @@ -2314,7 +1992,7 @@ public void uploadImage(String resourceGroupName, String catalogName, ImageInner @ServiceMethod(returns = ReturnType.SINGLE) public void uploadImage(String resourceGroupName, String catalogName, ImageInner uploadImageRequest, Context context) { - uploadImageAsync(resourceGroupName, catalogName, uploadImageRequest, context).block(); + beginUploadImage(resourceGroupName, catalogName, uploadImageRequest, context).getFinalResult(); } /** @@ -2328,23 +2006,34 @@ public void uploadImage(String resourceGroupName, String catalogName, ImageInner * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The 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) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -2353,23 +2042,15 @@ private Mono> listBySubscriptionNextSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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.")); - } + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { 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)); + 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); } /** @@ -2383,23 +2064,34 @@ private Mono> listBySubscriptionNextSinglePageAsync( * {@link Mono}. */ @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 Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The 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) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -2408,23 +2100,15 @@ 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 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, 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 listBySubscriptionNextSinglePage(String nextLink, Context context) { 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)); + 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); } /** @@ -2439,13 +2123,6 @@ private Mono> listByResourceGroupNextSinglePageAsync */ @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)) @@ -2454,6 +2131,24 @@ private Mono> listDeploymentsNextSinglePageAsync( .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 listDeploymentsNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listDeploymentsNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -2462,23 +2157,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 +2180,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 +2188,24 @@ 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) { + final String accept = "application/json"; + Response res + = service.listDeviceGroupsNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -2516,24 +2214,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 +2237,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 +2246,24 @@ 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) { + final String accept = "application/json"; + Response res + = service.listDeviceInsightsNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -2572,24 +2272,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 +2295,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 +2303,24 @@ 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) { + final String accept = "application/json"; + Response res + = service.listDevicesNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -2627,22 +2329,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 ea73ef90c5ea..7cddedbd0a18 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) { @@ -88,16 +64,32 @@ public void delete(String resourceGroupName, String catalogName, Context context this.serviceClient().delete(resourceGroupName, catalogName, context); } + 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 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 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) { 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 42b6500cfaf0..385cb417ce98 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 91f8136a0edd..2b89e6dadf3a 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 8685fddfedeb..122f43535c0c 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) - Mono> get(@HostParam("$host") String endpoint, + 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> 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,138 +120,124 @@ 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())); } /** - * 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 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 the response of a Certificate list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return a Certificate along with {@link Response}. */ @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.")); - } + public Response getWithResponse(String resourceGroupName, String catalogName, String serialNumber, + Context context) { 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 service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, catalogName, serialNumber, accept, 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 as paginated response with {@link PagedFlux}. + * @return a Certificate. */ - @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)); + @ServiceMethod(returns = ReturnType.SINGLE) + public CertificateInner get(String resourceGroupName, String catalogName, String serialNumber) { + return getWithResponse(resourceGroupName, catalogName, serialNumber, Context.NONE).getValue(); } /** @@ -230,20 +245,27 @@ 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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} on successful completion of + * {@link Mono}. */ - @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)); + @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())); } /** @@ -255,7 +277,6 @@ 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. @@ -263,10 +284,10 @@ private PagedFlux listByCatalogAsync(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByCatalogAsync(String resourceGroupName, String catalogName, String filter, - Integer top, Integer skip, Integer maxpagesize, Context context) { + Integer top, Integer skip, Integer maxpagesize) { return new PagedFlux<>( - () -> listByCatalogSinglePageAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context), - nextLink -> listByCatalogNextSinglePageAsync(nextLink, context)); + () -> listByCatalogSinglePageAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize), + nextLink -> listByCatalogNextSinglePageAsync(nextLink)); } /** @@ -277,15 +298,17 @@ private PagedFlux listByCatalogAsync(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByCatalog(String resourceGroupName, String catalogName) { + 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 PagedIterable<>(listByCatalogAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize)); + return new PagedFlux<>( + () -> listByCatalogSinglePageAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize), + nextLink -> listByCatalogNextSinglePageAsync(nextLink)); } /** @@ -297,146 +320,90 @@ public PagedIterable listByCatalog(String resourceGroupName, S * @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}. - */ - @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}. + * @return the response of a Certificate list operation along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listByCatalogSinglePage(String resourceGroupName, String catalogName, + String filter, Integer top, Integer skip, Integer maxpagesize) { 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())); + Response res = service.listByCatalogSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, filter, top, skip, + maxpagesize, catalogName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * 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 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}. + * @return the response of a Certificate list operation along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listByCatalogSinglePage(String resourceGroupName, String catalogName, + String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { 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); + 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); } /** - * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @return the response of a Certificate list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String catalogName, String serialNumber) { - return getWithResponseAsync(resourceGroupName, catalogName, serialNumber) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @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<>( + () -> listByCatalogSinglePage(resourceGroupName, catalogName, filter, top, skip, maxpagesize), + nextLink -> listByCatalogNextSinglePage(nextLink)); } /** - * 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 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. + * @return the response of a Certificate list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CertificateInner get(String resourceGroupName, String catalogName, String serialNumber) { - return getWithResponse(resourceGroupName, catalogName, serialNumber, Context.NONE).getValue(); + @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)); } /** @@ -453,24 +420,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 +427,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. * @@ -550,7 +460,9 @@ private Mono retrieveCertChainAsync(String resour @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); } /** @@ -586,86 +498,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. * @@ -702,8 +543,11 @@ private Mono retrieveProofOfPossessionNonce 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); } /** @@ -737,13 +581,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 +589,24 @@ 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) { + final String accept = "application/json"; + Response res + = service.listByCatalogNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -760,22 +615,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 ecd388b51241..90924575f7f4 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 b27e7d871641..cc3e45280930 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 c2f35a8e2816..6303771bb7b1 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; 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 d6f4cecb3b03..c16c1135a1be 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. @@ -500,8 +241,9 @@ private Mono getAsync(String resourceGroupName, String catalogN @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(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, accept, context); } /** @@ -547,41 +289,12 @@ public DeploymentInner get(String resourceGroupName, String catalogName, String 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 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, resource, accept, context)) + deploymentName, contentType, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -596,52 +309,19 @@ private Mono>> createOrUpdateWithResponseAsync(String * @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}. + * @return an deployment 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 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(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deploymentName, DeploymentInner 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(), + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, - deploymentName, resource, accept, context); + deploymentName, contentType, accept, resource, Context.NONE); } /** @@ -655,19 +335,20 @@ private Mono>> createOrUpdateWithResponseAsync(String * @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()); + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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); } /** @@ -681,7 +362,6 @@ private PollerFlux, DeploymentInner> beginCreateOrUp * @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. @@ -689,13 +369,12 @@ private PollerFlux, DeploymentInner> beginCreateOrUp */ @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); + String catalogName, String productName, String deviceGroupName, String deploymentName, + DeploymentInner resource) { Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, catalogName, - productName, deviceGroupName, deploymentName, resource, context); + productName, deviceGroupName, deploymentName, resource); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - DeploymentInner.class, DeploymentInner.class, context); + DeploymentInner.class, DeploymentInner.class, this.client.getContext()); } /** @@ -718,10 +397,10 @@ private PollerFlux, DeploymentInner> beginCreateOrUp 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(); + Response response = createOrUpdateWithResponse(resourceGroupName, catalogName, productName, + deviceGroupName, deploymentName, resource); + return this.client.getLroResult(response, DeploymentInner.class, + DeploymentInner.class, Context.NONE); } /** @@ -745,10 +424,10 @@ public SyncPoller, DeploymentInner> beginCreateOrUpd 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(); + Response response = createOrUpdateWithResponse(resourceGroupName, catalogName, productName, + deviceGroupName, deploymentName, resource, context); + return this.client.getLroResult(response, DeploymentInner.class, + DeploymentInner.class, context); } /** @@ -774,30 +453,6 @@ private Mono createOrUpdateAsync(String resourceGroupName, Stri resource).last().flatMap(this.client::getLroFinalResultOrError); } - /** - * 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 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, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, - resource, context).last().flatMap(this.client::getLroFinalResultOrError); - } - /** * Create a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. @@ -817,8 +472,8 @@ private Mono createOrUpdateAsync(String resourceGroupName, Stri @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(); + return beginCreateOrUpdate(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, + resource).getFinalResult(); } /** @@ -841,8 +496,8 @@ public DeploymentInner createOrUpdate(String resourceGroupName, String catalogNa @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 beginCreateOrUpdate(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, + resource, context).getFinalResult(); } /** @@ -863,36 +518,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 +535,17 @@ 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 service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, + deploymentName, Context.NONE); } /** @@ -956,18 +558,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 +582,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 +589,11 @@ 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()); } /** @@ -1014,8 +614,9 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup @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(); + Response response + = deleteWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -1037,9 +638,9 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @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(); + Response response + = deleteWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -1074,18 +675,14 @@ private Mono deleteAsync(String resourceGroupName, String catalogName, Str * @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. */ @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); + public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + String deploymentName) { + beginDelete(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName).getFinalResult(); } /** @@ -1098,35 +695,207 @@ private Mono deleteAsync(String resourceGroupName, String catalogName, Str * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, - String deploymentName) { - deleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName).block(); + String deploymentName, Context context) { + beginDelete(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, context) + .getFinalResult(); } /** - * 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} 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) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 listByDeviceGroupSinglePage(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String filter, Integer top, Integer skip, Integer maxpagesize) { + 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.NONE); + return 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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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); + } + + /** + * 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<>(() -> listByDeviceGroupSinglePage(resourceGroupName, catalogName, productName, + deviceGroupName, filter, top, skip, maxpagesize), nextLink -> listByDeviceGroupNextSinglePage(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 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<>(() -> listByDeviceGroupSinglePage(resourceGroupName, catalogName, productName, + deviceGroupName, filter, top, skip, maxpagesize, context), + nextLink -> listByDeviceGroupNextSinglePage(nextLink, context)); } /** @@ -1141,13 +910,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 +918,24 @@ 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) { + final String accept = "application/json"; + Response res + = service.listByDeviceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1164,23 +944,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 e730890de1dc..33fa7b1af854 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, @@ -76,6 +57,21 @@ 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) { 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 742c3affdd60..134789912316 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; @@ -8,12 +8,15 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.sphere.fluent.models.DeviceGroupInner; +import com.azure.resourcemanager.sphere.models.AllowCrashDumpCollection; import com.azure.resourcemanager.sphere.models.ClaimDevicesRequest; import com.azure.resourcemanager.sphere.models.CountDevicesResponse; import com.azure.resourcemanager.sphere.models.DeviceGroup; import com.azure.resourcemanager.sphere.models.DeviceGroupProperties; import com.azure.resourcemanager.sphere.models.DeviceGroupUpdate; -import com.azure.resourcemanager.sphere.models.DeviceGroupUpdateProperties; +import com.azure.resourcemanager.sphere.models.OSFeedType; +import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; +import com.azure.resourcemanager.sphere.models.UpdatePolicy; public final class DeviceGroupImpl implements DeviceGroup, DeviceGroup.Definition, DeviceGroup.Update { private DeviceGroupInner innerObject; @@ -158,8 +161,28 @@ public DeviceGroupImpl withProperties(DeviceGroupProperties properties) { return this; } - public DeviceGroupImpl withProperties(DeviceGroupUpdateProperties properties) { - this.updateProperties.withProperties(properties); + public DeviceGroupImpl withDescription(String description) { + this.updateProperties.withDescription(description); + return this; + } + + public DeviceGroupImpl withOsFeedType(OSFeedType osFeedType) { + this.updateProperties.withOsFeedType(osFeedType); + return this; + } + + public DeviceGroupImpl withUpdatePolicy(UpdatePolicy updatePolicy) { + this.updateProperties.withUpdatePolicy(updatePolicy); + return this; + } + + public DeviceGroupImpl withAllowCrashDumpsCollection(AllowCrashDumpCollection allowCrashDumpsCollection) { + this.updateProperties.withAllowCrashDumpsCollection(allowCrashDumpsCollection); + return this; + } + + public DeviceGroupImpl withRegionalDataBoundary(RegionalDataBoundary regionalDataBoundary) { + this.updateProperties.withRegionalDataBoundary(regionalDataBoundary); return this; } } 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 c1d966d5bebd..25e45c9b8e75 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); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}") + @ExpectedResponses({ 200, 202 }) + @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, + @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({ "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, + 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. @@ -500,7 +298,9 @@ private Mono getAsync(String resourceGroupName, String catalog @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); } /** @@ -540,38 +340,12 @@ public DeviceGroupInner get(String resourceGroupName, String catalogName, String @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 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, resource, - accept, context)) + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, + contentType, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -584,48 +358,19 @@ private Mono>> createOrUpdateWithResponseAsync(String * @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 - * completion of {@link Mono}. + * @return an device group resource belonging to a product resource along with {@link Response}. */ @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(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, 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 service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, contentType, + accept, resource, Context.NONE); } /** @@ -637,19 +382,20 @@ private Mono>> createOrUpdateWithResponseAsync(String * @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 PollerFlux} for polling of an device group resource belonging to a product resource. + * @return an 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, 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); } /** @@ -661,7 +407,6 @@ private PollerFlux, DeviceGroupInner> beginCreateOr * @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. @@ -670,12 +415,11 @@ private PollerFlux, DeviceGroupInner> beginCreateOr @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); + DeviceGroupInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName, resource); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - DeviceGroupInner.class, DeviceGroupInner.class, context); + DeviceGroupInner.class, DeviceGroupInner.class, this.client.getContext()); } /** @@ -695,8 +439,10 @@ private PollerFlux, DeviceGroupInner> beginCreateOr @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(); + Response response + = createOrUpdateWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, resource); + return this.client.getLroResult(response, DeviceGroupInner.class, + DeviceGroupInner.class, Context.NONE); } /** @@ -717,9 +463,10 @@ public SyncPoller, DeviceGroupInner> beginCreateOrU @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); } /** @@ -743,29 +490,6 @@ 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. @@ -783,7 +507,8 @@ private Mono createOrUpdateAsync(String resourceGroupName, Str @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 beginCreateOrUpdate(resourceGroupName, catalogName, productName, deviceGroupName, resource) + .getFinalResult(); } /** @@ -804,8 +529,8 @@ public DeviceGroupInner createOrUpdate(String resourceGroupName, String catalogN @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 beginCreateOrUpdate(resourceGroupName, catalogName, productName, deviceGroupName, resource, context) + .getFinalResult(); } /** @@ -826,38 +551,12 @@ public DeviceGroupInner createOrUpdate(String resourceGroupName, String catalogN @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 +569,19 @@ 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 an 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(); - } + private Response updateWithResponse(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, DeviceGroupUpdate properties) { + 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, productName, deviceGroupName, properties, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, contentType, + accept, properties, Context.NONE); } /** @@ -922,18 +593,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 an 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,7 +618,6 @@ 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. @@ -953,12 +625,11 @@ private PollerFlux, DeviceGroupInner> beginUpdateAs */ @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()); } /** @@ -978,8 +649,10 @@ private PollerFlux, DeviceGroupInner> beginUpdateAs @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(); + Response response + = updateWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, properties); + return this.client.getLroResult(response, DeviceGroupInner.class, + DeviceGroupInner.class, Context.NONE); } /** @@ -1000,8 +673,10 @@ public SyncPoller, DeviceGroupInner> beginUpdate(St @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); } /** @@ -1034,18 +709,15 @@ private Mono updateAsync(String resourceGroupName, String cata * @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}. + * @return an device group resource belonging to a product resource. */ @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); + public DeviceGroupInner update(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, DeviceGroupUpdate properties) { + return beginUpdate(resourceGroupName, catalogName, productName, deviceGroupName, properties).getFinalResult(); } /** @@ -1057,6 +729,7 @@ private Mono updateAsync(String resourceGroupName, String cata * @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. @@ -1064,29 +737,138 @@ private Mono updateAsync(String resourceGroupName, String cata */ @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(); + String deviceGroupName, DeviceGroupUpdate properties, Context context) { + return beginUpdate(resourceGroupName, catalogName, productName, deviceGroupName, properties, context) + .getFinalResult(); } /** - * Update 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, context)) + .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. + * + * @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 body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String catalogName, String productName, + String deviceGroupName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, + Context.NONE); + } + + /** + * 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 ManagementException 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 body along with {@link Response}. + */ + @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); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @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()); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, + String productName, String deviceGroupName) { + Response response + = deleteWithResponse(resourceGroupName, catalogName, productName, deviceGroupName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * 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 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. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @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(); + @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); } /** @@ -1100,39 +882,13 @@ public DeviceGroupInner update(String resourceGroupName, String catalogName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return 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, - 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + private Mono deleteAsync(String resourceGroupName, String catalogName, String productName, + String deviceGroupName) { + return beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName).last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1143,41 +899,13 @@ 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}. */ @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); + public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName) { + beginDelete(resourceGroupName, catalogName, productName, deviceGroupName).getFinalResult(); } /** @@ -1188,159 +916,194 @@ 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. */ - @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) + public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + Context context) { + beginDelete(resourceGroupName, catalogName, productName, deviceGroupName, context).getFinalResult(); } /** - * 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 PollerFlux} 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) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String catalogName, - String productName, String deviceGroupName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + @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 the {@link SyncPoller} for polling of long-running operation. + * @return the response of a DeviceGroup list operation as paginated response with {@link PagedFlux}. */ - @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.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 the {@link SyncPoller} for polling of long-running operation. + * @return the response of a DeviceGroup list operation as paginated response with {@link PagedFlux}. */ - @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.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 A {@link Mono} that completes when a successful response is received. + * @return the response of a DeviceGroup list operation along with {@link PagedResponse}. */ @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); + private PagedResponse listByProductSinglePage(String resourceGroupName, String catalogName, + String productName, String filter, Integer top, Integer skip, Integer maxpagesize) { + 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.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * 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 A {@link Mono} that completes when a successful response is received. + * @return the response of a DeviceGroup list operation along with {@link PagedResponse}. */ @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); + 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); } /** - * 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 ManagementException 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.SINGLE) - public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName) { - deleteAsync(resourceGroupName, catalogName, productName, deviceGroupName).block(); + @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<>( + () -> listByProductSinglePage(resourceGroupName, catalogName, productName, filter, top, skip, maxpagesize), + nextLink -> listByProductNextSinglePage(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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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.SINGLE) - public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, - Context context) { - deleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, context).block(); + @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 +1123,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 +1140,18 @@ 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) { + final String contentType = "application/json"; + return service.claimDevicesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, contentType, + claimDevicesRequest, Context.NONE); } /** @@ -1458,18 +1163,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 +1187,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,12 +1194,11 @@ 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()); } /** @@ -1514,9 +1218,9 @@ private PollerFlux, Void> beginClaimDevicesAsync(String resourc @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(); + Response response = claimDevicesWithResponse(resourceGroupName, catalogName, productName, + deviceGroupName, claimDevicesRequest); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -1537,10 +1241,9 @@ public SyncPoller, Void> beginClaimDevices(String resourceGroup @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,28 +1268,6 @@ 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. @@ -1603,7 +1284,8 @@ private Mono claimDevicesAsync(String resourceGroupName, String catalogNam @ServiceMethod(returns = ReturnType.SINGLE) public void claimDevices(String resourceGroupName, String catalogName, String productName, String deviceGroupName, ClaimDevicesRequest claimDevicesRequest) { - claimDevicesAsync(resourceGroupName, catalogName, productName, deviceGroupName, claimDevicesRequest).block(); + beginClaimDevices(resourceGroupName, catalogName, productName, deviceGroupName, claimDevicesRequest) + .getFinalResult(); } /** @@ -1623,8 +1305,8 @@ public void claimDevices(String resourceGroupName, String catalogName, String pr @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(); + beginClaimDevices(resourceGroupName, catalogName, productName, deviceGroupName, claimDevicesRequest, context) + .getFinalResult(); } /** @@ -1644,28 +1326,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 +1334,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. @@ -1758,8 +1371,10 @@ private Mono countDevicesAsync(String resourceGroupNa @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); } /** @@ -1794,13 +1409,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 +1417,24 @@ 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) { + final String accept = "application/json"; + Response res + = service.listByProductNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1817,22 +1443,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 8adfd5a5fa21..2bb525497ee7 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) { @@ -73,6 +56,19 @@ 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() @@ -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, 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 6ef68f62a7a8..a15caf74dd25 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; @@ -10,7 +10,6 @@ import com.azure.resourcemanager.sphere.models.Device; import com.azure.resourcemanager.sphere.models.DeviceProperties; import com.azure.resourcemanager.sphere.models.DeviceUpdate; -import com.azure.resourcemanager.sphere.models.DeviceUpdateProperties; import com.azure.resourcemanager.sphere.models.GenerateCapabilityImageRequest; import com.azure.resourcemanager.sphere.models.SignedCapabilityImageResponse; @@ -160,8 +159,8 @@ public DeviceImpl withProperties(DeviceProperties properties) { return this; } - public DeviceImpl withProperties(DeviceUpdateProperties properties) { - this.updateProperties.withProperties(properties); + public DeviceImpl withDeviceGroupId(String deviceGroupId) { + this.updateProperties.withDeviceGroupId(deviceGroupId); return this; } } 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 1671950314c7..c751ce501284 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 7e559e5c1b0e..0788c4988c4e 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. @@ -466,8 +282,9 @@ private Mono getAsync(String resourceGroupName, String catalogName, @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); } /** @@ -510,41 +327,12 @@ public DeviceInner get(String resourceGroupName, String catalogName, String prod @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 +346,19 @@ 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 an 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(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deviceName, DeviceInner 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(), + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, deviceName, - resource, accept, context); + contentType, accept, resource, Context.NONE); } /** @@ -616,18 +371,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 an 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,7 +397,6 @@ 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. @@ -648,13 +404,11 @@ private PollerFlux, DeviceInner> beginCreateOrUpdateAsyn */ @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()); } /** @@ -675,10 +429,10 @@ private PollerFlux, DeviceInner> beginCreateOrUpdateAsyn @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(); + Response response = createOrUpdateWithResponse(resourceGroupName, catalogName, productName, + deviceGroupName, deviceName, resource); + return this.client.getLroResult(response, DeviceInner.class, DeviceInner.class, + Context.NONE); } /** @@ -701,10 +455,10 @@ public SyncPoller, DeviceInner> beginCreateOrUpdate(Stri 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); } /** @@ -729,29 +483,6 @@ 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. @@ -770,8 +501,8 @@ private Mono createOrUpdateAsync(String resourceGroupName, String c @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 beginCreateOrUpdate(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, resource) + .getFinalResult(); } /** @@ -793,8 +524,8 @@ public DeviceInner createOrUpdate(String resourceGroupName, String catalogName, @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 beginCreateOrUpdate(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, resource, + context).getFinalResult(); } /** @@ -816,41 +547,12 @@ public DeviceInner createOrUpdate(String resourceGroupName, String catalogName, @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 +566,19 @@ 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 an 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(); - } + private Response updateWithResponse(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deviceName, DeviceUpdate properties) { + 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, productName, deviceGroupName, deviceName, properties, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, deviceName, + contentType, accept, properties, Context.NONE); } /** @@ -920,18 +591,20 @@ private Mono>> updateWithResponseAsync(String resource * @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 PollerFlux} for polling of an 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) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, catalogName, productName, - deviceGroupName, deviceName, properties); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - DeviceInner.class, DeviceInner.class, this.client.getContext()); + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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}. + */ + @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,7 +617,6 @@ 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. @@ -952,13 +624,11 @@ private PollerFlux, DeviceInner> beginUpdateAsync(String */ @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()); } /** @@ -979,9 +649,10 @@ private PollerFlux, DeviceInner> beginUpdateAsync(String @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(); + Response response + = updateWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, properties); + return this.client.getLroResult(response, DeviceInner.class, DeviceInner.class, + Context.NONE); } /** @@ -1003,10 +674,10 @@ public SyncPoller, DeviceInner> beginUpdate(String resou @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); } /** @@ -1032,29 +703,6 @@ 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. @@ -1073,8 +721,8 @@ private Mono updateAsync(String resourceGroupName, String catalogNa @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(); + return beginUpdate(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, properties) + .getFinalResult(); } /** @@ -1096,8 +744,8 @@ public DeviceInner update(String resourceGroupName, String catalogName, String p @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 beginUpdate(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, properties, + context).getFinalResult(); } /** @@ -1116,36 +764,10 @@ public DeviceInner update(String resourceGroupName, String catalogName, String p @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)) + deviceName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1157,44 +779,17 @@ 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. - * @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 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); + private Response deleteWithResponse(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deviceName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, deviceName, + Context.NONE); } /** @@ -1205,18 +800,18 @@ 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. - * @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, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, deviceName, + context); } /** @@ -1227,7 +822,6 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @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. @@ -1235,12 +829,11 @@ 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 deviceName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, catalogName, productName, - deviceGroupName, deviceName, context); + 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, - context); + this.client.getContext()); } /** @@ -1259,8 +852,9 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup @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(); + Response response + = deleteWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deviceName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -1280,8 +874,9 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @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(); + Response response + = deleteWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -1312,18 +907,14 @@ private Mono deleteAsync(String resourceGroupName, String catalogName, Str * @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. */ @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); + public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + String deviceName) { + beginDelete(resourceGroupName, catalogName, productName, deviceGroupName, deviceName).getFinalResult(); } /** @@ -1334,33 +925,155 @@ private Mono deleteAsync(String resourceGroupName, String catalogName, Str * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, - String deviceName) { - deleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName).block(); + String deviceName, Context context) { + beginDelete(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, context).getFinalResult(); } /** - * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 listByDeviceGroupSinglePage(String resourceGroupName, String catalogName, + String productName, String deviceGroupName) { + final String accept = "application/json"; + Response res = service.listByDeviceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, + deviceGroupName, accept, Context.NONE); + return 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. - * @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); + } + + /** + * 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<>( + () -> listByDeviceGroupSinglePage(resourceGroupName, catalogName, productName, deviceGroupName), + nextLink -> listByDeviceGroupNextSinglePage(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 PagedIterable}. + */ + @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 +1096,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 +1116,20 @@ 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(); - } + private Response generateCapabilityImageWithResponse(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deviceName, + GenerateCapabilityImageRequest generateDeviceCapabilityRequest) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.generateCapabilityImage(this.client.getEndpoint(), this.client.getApiVersion(), + return service.generateCapabilityImageSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, deviceName, - generateDeviceCapabilityRequest, accept, context); + contentType, accept, generateDeviceCapabilityRequest, Context.NONE); } /** @@ -1491,20 +1142,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 +1169,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,14 +1177,12 @@ 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()); } /** @@ -1555,10 +1204,10 @@ private Mono>> generateCapabilityImageWithResponseAsyn 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(); + Response response = generateCapabilityImageWithResponse(resourceGroupName, catalogName, productName, + deviceGroupName, deviceName, generateDeviceCapabilityRequest); + return this.client.getLroResult( + response, SignedCapabilityImageResponseInner.class, SignedCapabilityImageResponseInner.class, Context.NONE); } /** @@ -1582,10 +1231,10 @@ private Mono>> generateCapabilityImageWithResponseAsyn 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,30 +1260,6 @@ 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. @@ -1654,8 +1279,8 @@ private Mono generateCapabilityImageAsync(St 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 beginGenerateCapabilityImage(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, + generateDeviceCapabilityRequest).getFinalResult(); } /** @@ -1678,8 +1303,8 @@ public SignedCapabilityImageResponseInner generateCapabilityImage(String resourc 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 beginGenerateCapabilityImage(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, + generateDeviceCapabilityRequest, context).getFinalResult(); } /** @@ -1694,13 +1319,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 +1327,24 @@ 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) { + final String accept = "application/json"; + Response res + = service.listByDeviceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1717,22 +1353,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 e2740cd293e4..64a3e45394be 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, @@ -76,6 +58,20 @@ 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) { + 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 SignedCapabilityImageResponse generateCapabilityImage(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName, GenerateCapabilityImageRequest generateDeviceCapabilityRequest) { 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 53b96a789977..d65d0dd77aa5 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; 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 8861c167c788..e6239850a6a7 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. * @@ -420,7 +215,9 @@ private Mono getAsync(String resourceGroupName, String catalogName, @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); } /** @@ -455,33 +252,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 +268,19 @@ 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(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String catalogName, + String imageName, ImageInner 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, imageName, resource, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, imageName, contentType, accept, resource, + Context.NONE); } /** @@ -538,18 +290,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 +313,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,12 +320,11 @@ 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()); } /** @@ -590,7 +342,9 @@ private PollerFlux, ImageInner> beginCreateOrUpdateAsync( @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(); + Response response = createOrUpdateWithResponse(resourceGroupName, catalogName, imageName, resource); + return this.client.getLroResult(response, ImageInner.class, ImageInner.class, + Context.NONE); } /** @@ -609,8 +363,9 @@ public SyncPoller, ImageInner> beginCreateOrUpdate(String @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,26 +387,6 @@ 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. * @@ -667,7 +402,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, String ca @ServiceMethod(returns = ReturnType.SINGLE) public ImageInner createOrUpdate(String resourceGroupName, String catalogName, String imageName, ImageInner resource) { - return createOrUpdateAsync(resourceGroupName, catalogName, imageName, resource).block(); + return beginCreateOrUpdate(resourceGroupName, catalogName, imageName, resource).getFinalResult(); } /** @@ -686,7 +421,7 @@ public ImageInner createOrUpdate(String resourceGroupName, String catalogName, S @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 beginCreateOrUpdate(resourceGroupName, catalogName, imageName, resource, context).getFinalResult(); } /** @@ -703,28 +438,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 +450,15 @@ 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 service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, imageName, Context.NONE); } /** @@ -773,17 +467,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 +486,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 +493,10 @@ 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()); } /** @@ -822,7 +513,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, String imageName) { - return this.beginDeleteAsync(resourceGroupName, catalogName, imageName).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, catalogName, imageName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -840,7 +532,8 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @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(); + Response response = deleteWithResponse(resourceGroupName, catalogName, imageName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -866,16 +559,13 @@ private Mono deleteAsync(String resourceGroupName, String catalogName, Str * @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. */ @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); + public void delete(String resourceGroupName, String catalogName, String imageName) { + beginDelete(resourceGroupName, catalogName, imageName).getFinalResult(); } /** @@ -884,29 +574,180 @@ private Mono deleteAsync(String resourceGroupName, String catalogName, Str * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String catalogName, String imageName) { - deleteAsync(resourceGroupName, catalogName, imageName).block(); + public void delete(String resourceGroupName, String catalogName, String imageName, Context context) { + beginDelete(resourceGroupName, catalogName, imageName, context).getFinalResult(); } /** - * 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} 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) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 listByCatalogSinglePage(String resourceGroupName, String catalogName, + String filter, Integer top, Integer skip, Integer maxpagesize) { + 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.NONE); + return 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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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); + } + + /** + * 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<>( + () -> listByCatalogSinglePage(resourceGroupName, catalogName, filter, top, skip, maxpagesize), + nextLink -> listByCatalogNextSinglePage(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 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<>( + () -> listByCatalogSinglePage(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context), + nextLink -> listByCatalogNextSinglePage(nextLink, context)); } /** @@ -921,13 +762,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 +770,24 @@ 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) { + final String accept = "application/json"; + Response res + = service.listByCatalogNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -944,22 +796,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 450f24897a16..ab1fd8236de5 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) { @@ -67,6 +51,18 @@ public void delete(String resourceGroupName, String catalogName, String imageNam 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) { 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 eb1c440b1b19..c95d91055474 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 eae41a5cbab2..bc60c42be483 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( @@ -103,24 +113,14 @@ private Mono> listSinglePageAsync() { /** * 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}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. */ - @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)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -128,12 +128,15 @@ private Mono> listSinglePageAsync(Context context) * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return 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() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -143,13 +146,15 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return 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(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); } /** @@ -162,7 +167,7 @@ private PagedFlux listAsync(Context context) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** @@ -177,7 +182,7 @@ public PagedIterable list() { */ @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 +197,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 +204,24 @@ 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) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -214,22 +230,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 c9356b30c78a..41c85ca8cb0f 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; 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 aefce312d2e8..facc428fba38 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; @@ -14,7 +14,6 @@ import com.azure.resourcemanager.sphere.models.Product; import com.azure.resourcemanager.sphere.models.ProductProperties; import com.azure.resourcemanager.sphere.models.ProductUpdate; -import com.azure.resourcemanager.sphere.models.ProductUpdateProperties; public final class ProductImpl implements Product, Product.Definition, Product.Update { private ProductInner innerObject; @@ -152,8 +151,8 @@ public ProductImpl withProperties(ProductProperties properties) { return this; } - public ProductImpl withProperties(ProductUpdateProperties properties) { - this.updateProperties.withProperties(properties); + public ProductImpl withDescription(String description) { + this.updateProperties.withDescription(description); return this; } } 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 05dd6d79d4f5..a4749c9223ff 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("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) - 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, 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. * @@ -408,7 +292,9 @@ private Mono getAsync(String resourceGroupName, String catalogName @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); } /** @@ -443,34 +329,12 @@ public ProductInner get(String resourceGroupName, String catalogName, String pro @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 +345,19 @@ 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 an 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(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String catalogName, + String productName, ProductInner 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, resource, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, contentType, accept, resource, + Context.NONE); } /** @@ -527,18 +367,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 an 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,7 +390,6 @@ 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. @@ -556,12 +397,11 @@ private PollerFlux, ProductInner> beginCreateOrUpdateAs */ @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()); } /** @@ -579,7 +419,10 @@ private PollerFlux, ProductInner> beginCreateOrUpdateAs @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(); + Response response + = createOrUpdateWithResponse(resourceGroupName, catalogName, productName, resource); + return this.client.getLroResult(response, ProductInner.class, ProductInner.class, + Context.NONE); } /** @@ -598,8 +441,10 @@ public SyncPoller, ProductInner> beginCreateOrUpdate(St @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); } /** @@ -621,26 +466,6 @@ 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. * @@ -656,7 +481,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) public ProductInner createOrUpdate(String resourceGroupName, String catalogName, String productName, ProductInner resource) { - return createOrUpdateAsync(resourceGroupName, catalogName, productName, resource).block(); + return beginCreateOrUpdate(resourceGroupName, catalogName, productName, resource).getFinalResult(); } /** @@ -675,7 +500,7 @@ public ProductInner createOrUpdate(String resourceGroupName, String catalogName, @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(); + return beginCreateOrUpdate(resourceGroupName, catalogName, productName, resource, context).getFinalResult(); } /** @@ -694,32 +519,12 @@ public ProductInner createOrUpdate(String resourceGroupName, String catalogName, @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 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, properties, accept, context)) + 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())); } @@ -730,43 +535,19 @@ 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 - * of {@link Mono}. + * @return an product resource belonging to a catalog resource along with {@link Response}. */ @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(); - } + private Response updateWithResponse(String resourceGroupName, String catalogName, String productName, + ProductUpdate properties) { + 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, productName, properties, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, contentType, accept, + properties, Context.NONE); } /** @@ -776,18 +557,20 @@ 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 the {@link PollerFlux} for polling of an product resource belonging to a catalog resource. + * @return an product resource belonging to a catalog resource along with {@link Response}. */ - @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()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String catalogName, String productName, + ProductUpdate 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, contentType, accept, + properties, context); } /** @@ -797,7 +580,6 @@ private PollerFlux, ProductInner> beginUpdateAsync(Stri * @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. @@ -805,12 +587,11 @@ private PollerFlux, ProductInner> beginUpdateAsync(Stri */ @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); + String catalogName, String productName, ProductUpdate properties) { Mono>> mono - = updateWithResponseAsync(resourceGroupName, catalogName, productName, properties, context); + = updateWithResponseAsync(resourceGroupName, catalogName, productName, properties); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ProductInner.class, ProductInner.class, context); + ProductInner.class, ProductInner.class, this.client.getContext()); } /** @@ -828,7 +609,9 @@ private PollerFlux, ProductInner> beginUpdateAsync(Stri @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(); + Response response = updateWithResponse(resourceGroupName, catalogName, productName, properties); + return this.client.getLroResult(response, ProductInner.class, ProductInner.class, + Context.NONE); } /** @@ -847,7 +630,10 @@ public SyncPoller, ProductInner> beginUpdate(String res @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(); + Response response + = updateWithResponse(resourceGroupName, catalogName, productName, properties, context); + return this.client.getLroResult(response, ProductInner.class, ProductInner.class, + context); } /** @@ -869,26 +655,6 @@ private Mono updateAsync(String resourceGroupName, String catalogN .flatMap(this.client::getLroFinalResultOrError); } - /** - * 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 an 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, Context context) { - return beginUpdateAsync(resourceGroupName, catalogName, productName, properties, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Update a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. * @@ -904,7 +670,7 @@ private Mono updateAsync(String resourceGroupName, String catalogN @ServiceMethod(returns = ReturnType.SINGLE) public ProductInner update(String resourceGroupName, String catalogName, String productName, ProductUpdate properties) { - return updateAsync(resourceGroupName, catalogName, productName, properties).block(); + return beginUpdate(resourceGroupName, catalogName, productName, properties).getFinalResult(); } /** @@ -923,7 +689,7 @@ public ProductInner update(String resourceGroupName, String catalogName, String @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 beginUpdate(resourceGroupName, catalogName, productName, properties, context).getFinalResult(); } /** @@ -940,28 +706,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 +718,15 @@ 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 service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, Context.NONE); } /** @@ -1010,17 +735,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 +754,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,12 +761,10 @@ 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()); } /** @@ -1059,7 +781,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, String productName) { - return this.beginDeleteAsync(resourceGroupName, catalogName, productName).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, catalogName, productName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -1077,7 +800,8 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @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); } /** @@ -1103,16 +827,13 @@ private Mono deleteAsync(String resourceGroupName, String catalogName, Str * @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. */ @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); + public void delete(String resourceGroupName, String catalogName, String productName) { + beginDelete(resourceGroupName, catalogName, productName).getFinalResult(); } /** @@ -1121,70 +842,128 @@ private Mono deleteAsync(String resourceGroupName, String catalogName, Str * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String catalogName, String productName) { - deleteAsync(resourceGroupName, catalogName, productName).block(); + public void delete(String resourceGroupName, String catalogName, String productName, Context context) { + beginDelete(resourceGroupName, catalogName, productName, context).getFinalResult(); } /** - * 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} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String catalogName, String productName, Context context) { - deleteAsync(resourceGroupName, catalogName, productName, context).block(); + 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())); } /** - * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 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) { 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.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 listByCatalogSinglePage(String resourceGroupName, String catalogName, + Context context) { + final String accept = "application/json"; + 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); + } + + /** + * 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<>(() -> listByCatalogSinglePage(resourceGroupName, catalogName), + nextLink -> listByCatalogNextSinglePage(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 PagedIterable}. + */ + @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 +973,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 +981,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())); } /** @@ -1263,7 +1024,9 @@ private Mono countDevicesAsync(String resourceGroupNa @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); } /** @@ -1299,24 +1062,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( @@ -1334,41 +1079,17 @@ private Mono> generateDefaultDeviceGroupsSingleP * @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}. + * @return the response of a DeviceGroup list operation as paginated response with {@link PagedFlux}. */ - @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)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux generateDefaultDeviceGroupsAsync(String resourceGroupName, String catalogName, + String productName) { + return new PagedFlux<>( + () -> generateDefaultDeviceGroupsSinglePageAsync(resourceGroupName, catalogName, productName), + nextLink -> generateDefaultDeviceGroupsNextSinglePageAsync(nextLink)); } /** @@ -1381,14 +1102,17 @@ private Mono> generateDefaultDeviceGroupsSingleP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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) { - return new PagedFlux<>( - () -> generateDefaultDeviceGroupsSinglePageAsync(resourceGroupName, catalogName, productName), - nextLink -> generateDefaultDeviceGroupsNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse generateDefaultDeviceGroupsSinglePage(String resourceGroupName, + String catalogName, String productName) { + final String accept = "application/json"; + Response res + = service.generateDefaultDeviceGroupsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1402,14 +1126,17 @@ private PagedFlux generateDefaultDeviceGroupsAsync(String reso * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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, 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); } /** @@ -1427,7 +1154,9 @@ private PagedFlux generateDefaultDeviceGroupsAsync(String reso @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable generateDefaultDeviceGroups(String resourceGroupName, String catalogName, String productName) { - return new PagedIterable<>(generateDefaultDeviceGroupsAsync(resourceGroupName, catalogName, productName)); + return new PagedIterable<>( + () -> generateDefaultDeviceGroupsSinglePage(resourceGroupName, catalogName, productName), + nextLink -> generateDefaultDeviceGroupsNextSinglePage(nextLink)); } /** @@ -1447,7 +1176,8 @@ public PagedIterable generateDefaultDeviceGroups(String resour 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 +1192,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 +1200,24 @@ 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) { + final String accept = "application/json"; + Response res + = service.listByCatalogNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1485,23 +1226,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 +1249,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 +1257,24 @@ 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) { + final String accept = "application/json"; + Response res + = service.generateDefaultDeviceGroupsNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1539,23 +1283,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 4e76a66cc017..8ccca1fa07c1 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) { @@ -70,16 +56,22 @@ public void delete(String resourceGroupName, String catalogName, String productN this.serviceClient().delete(resourceGroupName, catalogName, productName, context); } + 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 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) { 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 431290bc7a55..efb0d5376dfe 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 53ffe8656ceb..38522233fba8 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; 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 d5767277af92..a644041e1232 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 edd39c17852b..f5bd543a34d6 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 ea0be35c6fd8..50688cfe0e38 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 3a8571e60191..f94dface8283 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 ed16acfc1563..f7a746698add 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 762197a61e8e..1da6cbcd3c7e 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 e5d85c33cc35..0dd415c51fb6 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 2c28d34fb2ca..0701fed84410 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 77c8ba0cc0eb..b51cf4bea113 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 7287b239311e..4cb78dfaa290 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 878a1be7d183..e5a590cc4d98 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 66657e6c9262..664ea488b254 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 0381a3385b74..dd6a5ad92430 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 8c60c8b3d3bd..e79461b7209b 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 4cfb60a7b47e..da4f97bc17d7 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 725f7f672a6c..ac0992318a44 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 f66b1c7696cd..2298da7cd349 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 d399d00ab62d..8c94994a5517 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 1aee6fd4d576..dfae27a7b973 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 940f393fa3a8..2ea1f51f6a38 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 72d30e2f96dd..6046006b5677 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 bf130ef1ce0f..ff6119dcc6d9 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 1ded7f11712f..6efb78b491e0 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 e73232bb7791..000000000000 --- 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 61ba11c3736b..99e22345ec4e 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 e6914fe31cd0..d73bcd05dfd3 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 71d8fff814d5..09d0ad9d4da5 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 0228d79e4857..3542dac3b1d6 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; @@ -140,7 +140,7 @@ interface WithProperties { /** * The template for Device update. */ - interface Update extends UpdateStages.WithProperties { + interface Update extends UpdateStages.WithDeviceGroupId { /** * Executes the update request. * @@ -162,16 +162,16 @@ interface Update extends UpdateStages.WithProperties { */ interface UpdateStages { /** - * The stage of the Device update allowing to specify properties. + * The stage of the Device update allowing to specify deviceGroupId. */ - interface WithProperties { + interface WithDeviceGroupId { /** - * Specifies the properties property: The updatable properties of the Device.. + * Specifies the deviceGroupId property: Device group id. * - * @param properties The updatable properties of the Device. + * @param deviceGroupId Device group id. * @return the next definition stage. */ - Update withProperties(DeviceUpdateProperties properties); + Update withDeviceGroupId(String deviceGroupId); } } 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 b94eba078941..178733772c8f 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; @@ -139,7 +139,8 @@ interface WithProperties { /** * The template for DeviceGroup update. */ - interface Update extends UpdateStages.WithProperties { + interface Update extends UpdateStages.WithDescription, UpdateStages.WithOsFeedType, UpdateStages.WithUpdatePolicy, + UpdateStages.WithAllowCrashDumpsCollection, UpdateStages.WithRegionalDataBoundary { /** * Executes the update request. * @@ -161,16 +162,69 @@ interface Update extends UpdateStages.WithProperties { */ interface UpdateStages { /** - * The stage of the DeviceGroup update allowing to specify properties. + * The stage of the DeviceGroup update allowing to specify description. */ - interface WithProperties { + interface WithDescription { + /** + * Specifies the description property: Description of the device group.. + * + * @param description Description of the device group. + * @return the next definition stage. + */ + Update withDescription(String description); + } + + /** + * The stage of the DeviceGroup update allowing to specify osFeedType. + */ + interface WithOsFeedType { + /** + * Specifies the osFeedType property: Operating system feed type of the device group.. + * + * @param osFeedType Operating system feed type of the device group. + * @return the next definition stage. + */ + Update withOsFeedType(OSFeedType osFeedType); + } + + /** + * The stage of the DeviceGroup update allowing to specify updatePolicy. + */ + interface WithUpdatePolicy { + /** + * Specifies the updatePolicy property: Update policy of the device group.. + * + * @param updatePolicy Update policy of the device group. + * @return the next definition stage. + */ + Update withUpdatePolicy(UpdatePolicy updatePolicy); + } + + /** + * The stage of the DeviceGroup update allowing to specify allowCrashDumpsCollection. + */ + interface WithAllowCrashDumpsCollection { + /** + * Specifies the allowCrashDumpsCollection property: Flag to define if the user allows for crash dump + * collection.. + * + * @param allowCrashDumpsCollection Flag to define if the user allows for crash dump collection. + * @return the next definition stage. + */ + Update withAllowCrashDumpsCollection(AllowCrashDumpCollection allowCrashDumpsCollection); + } + + /** + * The stage of the DeviceGroup update allowing to specify regionalDataBoundary. + */ + interface WithRegionalDataBoundary { /** - * Specifies the properties property: The updatable properties of the DeviceGroup.. + * Specifies the regionalDataBoundary property: Regional data boundary for the device group.. * - * @param properties The updatable properties of the DeviceGroup. + * @param regionalDataBoundary Regional data boundary for the device group. * @return the next definition stage. */ - Update withProperties(DeviceGroupUpdateProperties properties); + Update withRegionalDataBoundary(RegionalDataBoundary regionalDataBoundary); } } 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 fb0f97ab0629..4e1b12dc533f 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 9e9762802a5e..32432bdc3e9a 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; @@ -9,6 +9,7 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.sphere.fluent.models.DeviceGroupUpdateProperties; import java.io.IOException; /** @@ -19,7 +20,7 @@ public final class DeviceGroupUpdate implements JsonSerializable 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 1ddc5e3df51f..1dc709f0e398 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 646ce4adc983..8bf9d3651570 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 dbc73c4c7145..0825c130e579 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; @@ -9,6 +9,7 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.sphere.fluent.models.DeviceUpdateProperties; import java.io.IOException; /** @@ -19,7 +20,7 @@ public final class DeviceUpdate implements JsonSerializable { /* * The updatable properties of the Device. */ - private DeviceUpdateProperties properties; + private DeviceUpdateProperties innerProperties; /** * Creates an instance of DeviceUpdate class. @@ -28,34 +29,35 @@ public DeviceUpdate() { } /** - * Get the properties property: The updatable properties of the Device. + * Get the innerProperties property: The updatable properties of the Device. * - * @return the properties value. + * @return the innerProperties value. */ - public DeviceUpdateProperties properties() { - return this.properties; + private DeviceUpdateProperties innerProperties() { + return this.innerProperties; } /** - * Set the properties property: The updatable properties of the Device. + * Get the deviceGroupId property: Device group id. * - * @param properties the properties value to set. - * @return the DeviceUpdate object itself. + * @return the deviceGroupId value. */ - public DeviceUpdate withProperties(DeviceUpdateProperties properties) { - this.properties = properties; - return this; + public String deviceGroupId() { + return this.innerProperties() == null ? null : this.innerProperties().deviceGroupId(); } /** - * Validates the instance. + * Set the deviceGroupId property: Device group id. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @param deviceGroupId the deviceGroupId value to set. + * @return the DeviceUpdate object itself. */ - public void validate() { - if (properties() != null) { - properties().validate(); + public DeviceUpdate withDeviceGroupId(String deviceGroupId) { + if (this.innerProperties() == null) { + this.innerProperties = new DeviceUpdateProperties(); } + this.innerProperties().withDeviceGroupId(deviceGroupId); + return this; } /** @@ -64,7 +66,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -84,7 +86,7 @@ public static DeviceUpdate fromJson(JsonReader jsonReader) throws IOException { reader.nextToken(); if ("properties".equals(fieldName)) { - deserializedDeviceUpdate.properties = DeviceUpdateProperties.fromJson(reader); + deserializedDeviceUpdate.innerProperties = DeviceUpdateProperties.fromJson(reader); } else { reader.skipChildren(); } 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 ef2bd6c513ee..cc17c9b3de10 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 6cf526f2835b..5966d4578fe6 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 8db4189339e1..11ffc5d4b3cb 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 ac015fc79968..eb7389718ccf 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 5394d881b93b..df8e3c7ead15 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 da17aaf6899a..2228eefd6e9d 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 223b17b015bb..acb8767daeb8 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 1f90b1979636..f29dd209ed80 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 f39a2845910d..16b10e737143 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 8855b96adada..519a33f90537 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 e57616eacea6..ea8f8a9cbf92 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; @@ -139,7 +139,7 @@ interface WithProperties { /** * The template for Product update. */ - interface Update extends UpdateStages.WithProperties { + interface Update extends UpdateStages.WithDescription { /** * Executes the update request. * @@ -161,16 +161,16 @@ interface Update extends UpdateStages.WithProperties { */ interface UpdateStages { /** - * The stage of the Product update allowing to specify properties. + * The stage of the Product update allowing to specify description. */ - interface WithProperties { + interface WithDescription { /** - * Specifies the properties property: The updatable properties of the Product.. + * Specifies the description property: Description of the product. * - * @param properties The updatable properties of the Product. + * @param description Description of the product. * @return the next definition stage. */ - Update withProperties(ProductUpdateProperties properties); + Update withDescription(String description); } } 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 680ba11610a2..cd3b62418e84 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 f1514c5d00be..909dd7c9640d 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; @@ -9,6 +9,7 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.sphere.fluent.models.ProductUpdateProperties; import java.io.IOException; /** @@ -19,7 +20,7 @@ public final class ProductUpdate implements JsonSerializable { /* * The updatable properties of the Product. */ - private ProductUpdateProperties properties; + private ProductUpdateProperties innerProperties; /** * Creates an instance of ProductUpdate class. @@ -28,34 +29,35 @@ public ProductUpdate() { } /** - * Get the properties property: The updatable properties of the Product. + * Get the innerProperties property: The updatable properties of the Product. * - * @return the properties value. + * @return the innerProperties value. */ - public ProductUpdateProperties properties() { - return this.properties; + private ProductUpdateProperties innerProperties() { + return this.innerProperties; } /** - * Set the properties property: The updatable properties of the Product. + * Get the description property: Description of the product. * - * @param properties the properties value to set. - * @return the ProductUpdate object itself. + * @return the description value. */ - public ProductUpdate withProperties(ProductUpdateProperties properties) { - this.properties = properties; - return this; + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** - * Validates the instance. + * Set the description property: Description of the product. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @param description the description value to set. + * @return the ProductUpdate object itself. */ - public void validate() { - if (properties() != null) { - properties().validate(); + public ProductUpdate withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductUpdateProperties(); } + this.innerProperties().withDescription(description); + return this; } /** @@ -64,7 +66,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -84,7 +86,7 @@ public static ProductUpdate fromJson(JsonReader jsonReader) throws IOException { reader.nextToken(); if ("properties".equals(fieldName)) { - deserializedProductUpdate.properties = ProductUpdateProperties.fromJson(reader); + deserializedProductUpdate.innerProperties = ProductUpdateProperties.fromJson(reader); } else { reader.skipChildren(); } 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 c6ebe0df8eaf..4e1fd4bc557e 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 0f950c722241..3bea853dc7a7 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 3bcdf8d2100d..b8687a4d3377 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 2a6b59e7fcdd..be4d1e861968 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 a95797549724..ed76ebd11f14 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 d2477da612ae..2b5a43e3a1db 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 6ee016843ca6..2ac6a82a0e09 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 5ee8c5416a24..2e13053320a3 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 229d09be942a..ecd7c7f1ac0b 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 bded277fe62e..87513b7af404 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 000000000000..9d4166fffefd --- /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":"211141228033","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.DeviceGroupUpdateProperties":"Microsoft.AzureSphere.DeviceGroupUpdateProperties","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.DeviceUpdateProperties":"Microsoft.AzureSphere.DeviceUpdateProperties","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.ProductUpdateProperties":"Microsoft.AzureSphere.ProductUpdateProperties","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.DeviceProperties":"Microsoft.AzureSphere.DeviceProperties","com.azure.resourcemanager.sphere.models.DeviceUpdate":"Microsoft.AzureSphere.DeviceUpdate","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.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/DeviceGroupUpdateProperties.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/DeviceUpdateProperties.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/ProductUpdateProperties.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/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/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/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 000000000000..defbd48204e4 --- /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 564480312993..827dce07db0c 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 b92c09270a23..522de0ce12ec 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 c5433706b759..36290157d137 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 2cccdcc18627..b08d153e9b17 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 da2880834e18..476e5e8df6af 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 ba22dc4d5384..76a80507ec26 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 e6ed6ad3be96..7934c3a789f0 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 72a6f96bd876..bedef9175427 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 4a84d8604a29..6616823ff3b1 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 5171e9f9ee64..35f00128745a 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 e22025f5572c..87d7b5f529c5 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 ed56408e6bb3..c3ed93aea0b8 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 5d1f3d779f12..6b7127ee4bb7 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 56a1019b02d4..9287cec96cbc 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 b7bc5ec25bff..9c63f53adbf9 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 b55a4beb50c6..bf65e21de1b2 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 a5e88b3f9dfb..5751b1f5ef65 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 9d7822a83600..b7e6b01c7cb0 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 b0f6ab82acfa..7d7c50d967c8 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 5e52f81fe25b..14709a14d723 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 780631a9b621..cf52a69501b6 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 72f59bb118a6..44ed53e9d521 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 339a50c12575..63cb942c5031 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 68a1ee70783f..6c4d1591297f 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 2f12dff024b3..84e4ad5fa616 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 c0cdfd264c27..4f0e16e906a2 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 3f572ba2a6dc..039086bfa248 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 1ec3bb6cb5ec..63cf7f3090fb 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 bbef55ea2e20..d19ccd671576 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 f5a2bf1255cf..5cd2c77e3cdb 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 775fc01b83c2..20994148f91b 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 de92ff276bf1..6ae4e42fbc53 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 eb97bdd42be2..a331230e1f0c 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 1f91098a4c89..38a5a6de3443 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 dfa862a0c4b8..c18a37664a77 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 6a23a8e19efd..a3ba6d37877e 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 13473dfdec27..1bc6a36e037d 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 a11da63ebadb..45dd79d4eaa6 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 c51e8465508b..4a22924585dd 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 c487141ce71c..60b2c134b7e2 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 b8664ba9eaf4..61ae034848bb 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 279c4b9c221a..aeb1d560752c 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 c355f4377dcb..dc1bf97cb2f1 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 0518ce64f872..9b64e4334e59 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 58b204a76943..a538d87cef72 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 f5860910910d..95c66efb3244 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 65084dba3fe2..75b7d94d48d8 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 6b9c7983e55a..3043d63ee520 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 94d41f62fe14..472aae6c74ee 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 9bf49fb8c0ae..4378894c2206 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 14d5177b2428..5963b9df2475 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 8ffee9ee8833..59b3c4d065ab 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 b85a5ee9d670..cd26e1f5590e 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 3736be42ed41..1d08a28e9002 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 8bfde429b343..46961256728f 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 cdf204ce5d4c..94d58521b02a 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 240c47df09d9..d33a8e4e8f8c 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 a14ed5a866a5..19766d750bd5 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 ee9f7e47fe16..2e2338bbcdca 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 8f4a231aa554..ba9d104a5f66 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 9b8b53b83170..2b90dcf17a2c 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 cf27aed5b76f..3b7f86c751b7 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 c49965d7ba15..9e01c648357a 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 e40b786140b6..277cec81ab53 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 68731c7dd05c..ecf201e12e07 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 dab51d61ec1d..c392c4e1bdb6 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 ad5d4b957261..c46b10939c06 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 157bd75444d1..6396f4ab6069 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 5b91fb03e747..000000000000 --- 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 234ac109554c..0d5eedacb6a8 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 126ce4506c95..6188bddd281f 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 a19370b9228f..8a2529296965 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 697d0c3b2bab..75dc1ac257a7 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 42b3330ba428..ce17abd0ea20 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 5ca9298d2219..0a3aa7e2a4ae 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 9bf65f164599..5ddabd19bf0b 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 4cbfe81adbfa..6198fe733d74 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 f1624f66b4d7..61f71a086226 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 c1e4d8014353..0695b0c3174d 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 5293fa9c4830..a8831902937c 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 1be0bff3bd68..fdbc335710ea 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 90f5251c33cd..a5d00c4e5c3a 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,12 +1,12 @@ // 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.DeviceGroupUpdateProperties; import com.azure.resourcemanager.sphere.models.AllowCrashDumpCollection; -import com.azure.resourcemanager.sphere.models.DeviceGroupUpdateProperties; import com.azure.resourcemanager.sphere.models.OSFeedType; import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; import com.azure.resourcemanager.sphere.models.UpdatePolicy; @@ -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 0ac3daa08c95..8bd096d751bf 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,13 +1,12 @@ // 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.AllowCrashDumpCollection; import com.azure.resourcemanager.sphere.models.DeviceGroupUpdate; -import com.azure.resourcemanager.sphere.models.DeviceGroupUpdateProperties; import com.azure.resourcemanager.sphere.models.OSFeedType; import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; import com.azure.resourcemanager.sphere.models.UpdatePolicy; @@ -17,28 +16,27 @@ 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(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, model.properties().updatePolicy()); - Assertions.assertEquals(AllowCrashDumpCollection.DISABLED, model.properties().allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.EU, model.properties().regionalDataBoundary()); + Assertions.assertEquals("nabckhsmtx", model.description()); + Assertions.assertEquals(OSFeedType.RETAIL, model.osFeedType()); + Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, model.updatePolicy()); + Assertions.assertEquals(AllowCrashDumpCollection.DISABLED, model.allowCrashDumpsCollection()); + Assertions.assertEquals(RegionalDataBoundary.EU, model.regionalDataBoundary()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DeviceGroupUpdate model - = new DeviceGroupUpdate().withProperties(new DeviceGroupUpdateProperties().withDescription("xquk") - .withOsFeedType(OSFeedType.RETAIL_EVAL) - .withUpdatePolicy(UpdatePolicy.NO3RD_PARTY_APP_UPDATES) - .withAllowCrashDumpsCollection(AllowCrashDumpCollection.DISABLED) - .withRegionalDataBoundary(RegionalDataBoundary.EU)); + DeviceGroupUpdate model = new DeviceGroupUpdate().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(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, model.properties().updatePolicy()); - Assertions.assertEquals(AllowCrashDumpCollection.DISABLED, model.properties().allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.EU, model.properties().regionalDataBoundary()); + Assertions.assertEquals("nabckhsmtx", model.description()); + Assertions.assertEquals(OSFeedType.RETAIL, model.osFeedType()); + Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, model.updatePolicy()); + Assertions.assertEquals(AllowCrashDumpCollection.DISABLED, model.allowCrashDumpsCollection()); + Assertions.assertEquals(RegionalDataBoundary.EU, model.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 e5a8901bb86e..fa66a5e8f8bb 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 4d68363ca839..881e6aa31e9e 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 48e5c1ad96e6..314aeac18837 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 f24f7acf9eb2..858732f883ab 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 61de68c3b580..ef228877a503 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 57dbd6f596d0..8b8c5fbaa748 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 8a6379ca8768..ea4303e392b6 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 477027ba9fe4..72230cadf83e 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 76907e2d7e3c..00fa522f4b6a 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 9391bfb2e45d..ab9e28a555fd 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,25 +1,25 @@ // 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.DeviceUpdateProperties; +import com.azure.resourcemanager.sphere.fluent.models.DeviceUpdateProperties; import org.junit.jupiter.api.Assertions; 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 6847d428acc5..1e6bd2782ff9 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,27 +1,25 @@ // 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.DeviceUpdate; -import com.azure.resourcemanager.sphere.models.DeviceUpdateProperties; import org.junit.jupiter.api.Assertions; 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.deviceGroupId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DeviceUpdate model - = new DeviceUpdate().withProperties(new DeviceUpdateProperties().withDeviceGroupId("edeojnabc")); + DeviceUpdate model = new DeviceUpdate().withDeviceGroupId("micykvceoveilo"); model = BinaryData.fromObject(model).toObject(DeviceUpdate.class); - Assertions.assertEquals("edeojnabc", model.properties().deviceGroupId()); + Assertions.assertEquals("micykvceoveilo", model.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 87f73be3c148..088d56f6caef 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 d09cd94451ca..b0751c4e1e8a 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 b04108336d86..e0dded898b82 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 1c76342946ff..01d9b202de71 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 de256b25fb6d..23ef3096d8e4 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 53e36e9b5bea..54bb19eac399 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 3d0046ed4153..09810f6451da 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 50675334d6a4..78950de4ddf9 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 c35e07df119e..688573ded932 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 e0f8ba101906..c1a0fffa7980 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 bb01645aae5d..5cb89fbfabdd 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 256df3400fb0..518be204b218 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 788492f7d2a0..6a2b920b0395 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 70968a65ae0e..940752f0e474 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 919921646ba4..35b34dfdc697 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 f30b7af5fbae..24d12ba7a3bf 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 da51bda792f9..220aa17b24fa 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 e11459dbf5ef..ea9962e16c9e 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 0928aecbdd13..95c65693e457 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 aff0397719aa..e5e7da16532e 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 5c8e716550e9..2431459257ee 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 29d43cc532ec..d8da9c71f407 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 6078ea595687..88880b9a560f 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,25 +1,25 @@ // 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.ProductUpdateProperties; +import com.azure.resourcemanager.sphere.fluent.models.ProductUpdateProperties; import org.junit.jupiter.api.Assertions; 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 8ca49441ba24..e07e4d61c11e 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,27 +1,25 @@ // 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.ProductUpdate; -import com.azure.resourcemanager.sphere.models.ProductUpdateProperties; import org.junit.jupiter.api.Assertions; 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.description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ProductUpdate model - = new ProductUpdate().withProperties(new ProductUpdateProperties().withDescription("ovplw")); + ProductUpdate model = new ProductUpdate().withDescription("bxu"); model = BinaryData.fromObject(model).toObject(ProductUpdate.class); - Assertions.assertEquals("ovplw", model.properties().description()); + Assertions.assertEquals("bxu", model.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 24a5f7c7c046..bf2d785c50fb 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 6e39695f3a60..209bdff05885 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 0896714a1a08..3aa787f0a2a6 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 c69d0df3a5b2..c4661a35097a 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 9a2f3a39ed8d..d1d9489b933c 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 61a6cdbb582a..8203dea8723f 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 34e5a6fe072f..a60c2b71068d 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 a27a3f0b1011..8153c9a5af22 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 eadaa20bd300..67943555e2f0 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 000000000000..87955aa9d0f1 --- /dev/null +++ b/sdk/sphere/azure-resourcemanager-sphere/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/sphere/Sphere.Management +commit: 06082918e361d89424bd970c91a8ce3ecb7e45fa +repo: Azure/azure-rest-api-specs +additionalDirectories: