diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/CHANGELOG.md b/sdk/edgeorder/azure-resourcemanager-edgeorder/CHANGELOG.md index e8e5e3d0ba17..92eff6c7ad0f 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/CHANGELOG.md +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/CHANGELOG.md @@ -1,14 +1,252 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.1.0-beta.1 (2025-05-12) -### Features Added +- Azure Resource Manager edgeorder client library for Java. This package contains Microsoft Azure SDK for edgeorder Management SDK. Edge Order API's. 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 +#### `EdgeOrderManager$Configurable` was removed + +#### `models.OperationListResult` was removed + +#### `models.AddressResourceList` was removed + +#### `models.OrderItemResourceList` was removed + +#### `models.ProductFamiliesMetadata` was removed + +#### `models.ConfigurationFilters` was removed + +#### `EdgeOrderManager` was removed + +#### `models.ResourceProviders` was removed + +#### `models.ProductFamilies` was removed + +#### `models.OrderResourceList` was removed + +#### `models.Configurations` was removed + +#### `models.OrderItemResource$DefinitionStages` was modified + +* `withAddressDetails(models.AddressDetails)` was removed in stage 4 + +#### `models.ProductDetails` was modified + +* `deviceDetails()` was removed +* `count()` was removed + +#### `models.OrderItemDetails` was modified + +* `managementRpDetails()` was removed + +#### `models.OrderItemResource` was modified + +* `cancelOrderItem(models.CancellationReason)` was removed +* `cancelOrderItemWithResponse(models.CancellationReason,com.azure.core.util.Context)` was removed + +#### `models.ConfigurationsRequest` was modified + +* `configurationFilters()` was removed +* `withConfigurationFilters(java.util.List)` was removed + +### Features Added + +* `models.OrderResources` was added + +* `models.OrderItemDetailsUpdateParameter` was added + +* `EdgeorderManager$Configurable` was added + +* `implementation.models.OrderResourceList` was added + +* `models.OrderMode` was added + +* `models.SiteDetails` was added + +* `EdgeorderManager` was added + +* `models.ChildConfigurationType` was added + +* `models.ProductDetailsUpdateParameter` was added + +* `models.ConfigurationFilter` was added + +* `models.DevicePresenceVerificationDetails` was added + +* `models.TermTypeDetails` was added + +* `implementation.models.ProductFamilies` was added + +* `models.ProductsAndConfigurationsOperationGroups` was added + +* `models.AutoProvisioningStatus` was added + +* `models.ProvisioningState` was added + +* `models.ConfigurationDeviceDetails` was added + +* `implementation.models.OrderItemResourceList` was added + +* `models.TermCommitmentType` was added + +* `implementation.models.Configurations` was added + +* `models.DevicePresenceVerificationStatus` was added + +* `models.IdentificationType` was added + +* `models.ProvisioningDetails` was added + +* `models.GroupedChildConfigurations` was added + +* `models.AdditionalConfiguration` was added + +* `models.ProvisioningSupport` was added + +* `models.OrderItemResources` was added + +* `models.Operations` was added + +* `models.UserAssignedIdentity` was added + +* `models.TermCommitmentInformation` was added + +* `models.AddressResources` was added + +* `models.CategoryInformation` was added + +* `models.FulfillmentType` was added + +* `implementation.models.ProductFamiliesMetadata` was added + +* `models.ChildConfigurationFilter` was added + +* `models.ResourceIdentity` was added + +* `models.OrdersOperationGroups` was added + +* `implementation.models.AddressResourceList` was added + +* `models.ChildConfiguration` was added + +* `implementation.models.OperationListResult` was added + +* `models.AddressClassification` was added + +* `models.TermCommitmentPreferences` was added + +#### `models.Configuration` was modified + +* `provisioningSupport()` was added +* `childConfigurationTypes()` was added +* `groupedChildConfigurations()` was added +* `supportedTermCommitmentDurations()` was added +* `fulfilledBy()` was added + +#### `models.ProductDetails` was modified + +* `childConfigurationDeviceDetails()` was added +* `parentDeviceDetails()` was added +* `optInAdditionalConfigurations()` was added +* `withOptInAdditionalConfigurations(java.util.List)` was added +* `identificationType()` was added +* `withParentProvisioningDetails(models.ProvisioningDetails)` was added +* `termCommitmentInformation()` was added +* `parentProvisioningDetails()` was added + +#### `models.HierarchyInformation` was modified + +* `withConfigurationIdDisplayName(java.lang.String)` was added +* `configurationIdDisplayName()` was added + +#### `models.Preferences` was modified + +* `termCommitmentPreferences()` was added +* `withTermCommitmentPreferences(models.TermCommitmentPreferences)` was added + +#### `models.CommonProperties` was modified + +* `fulfilledBy()` was added + +#### `models.Product` was modified + +* `fulfilledBy()` was added + +#### `models.ProductLine` was modified + +* `fulfilledBy()` was added + +#### `models.OrderItemDetails` was modified + +* `withOrderItemMode(models.OrderMode)` was added +* `orderItemMode()` was added +* `withSiteDetails(models.SiteDetails)` was added +* `siteDetails()` was added + +#### `models.OrderItemUpdateParameter` was modified + +* `orderItemDetails()` was added +* `identity()` was added +* `withOrderItemDetails(models.OrderItemDetailsUpdateParameter)` was added +* `withIdentity(models.ResourceIdentity)` was added + +#### `models.ProductFamiliesMetadataDetails` was modified + +* `fulfilledBy()` was added + +#### `models.OrderItemResource` was modified + +* `provisioningState()` was added +* `identity()` was added +* `cancel(models.CancellationReason)` was added +* `cancelWithResponse(models.CancellationReason,com.azure.core.util.Context)` was added + +#### `models.ProductFamily` was modified + +* `fulfilledBy()` was added + +#### `models.OrderResource` was modified + +* `orderMode()` was added + +#### `models.AddressResource` was modified + +* `provisioningState()` was added +* `addressClassification()` was added + +#### `models.ConfigurationsRequest` was modified + +* `configurationFilter()` was added +* `withConfigurationFilter(models.ConfigurationFilter)` was added + +#### `models.BillingMeterDetails` was modified + +* `termTypeDetails()` was added + +#### `models.OrderItemResource$Update` was modified + +* `withOrderItemDetails(models.OrderItemDetailsUpdateParameter)` was added +* `withIdentity(models.ResourceIdentity)` was added + +#### `models.OrderItemResource$Definition` was modified + +* `withIdentity(models.ResourceIdentity)` was added + +#### `models.DeviceDetails` was modified + +* `provisioningDetails()` was added +* `displaySerialNumber()` was added +* `provisioningSupport()` was added + +#### `models.AddressResource$Definition` was modified + +* `withAddressClassification(models.AddressClassification)` was added + +#### `models.BasicInformation` was modified -### Other Changes +* `fulfilledBy()` was added ## 1.0.0 (2025-01-02) diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/README.md b/sdk/edgeorder/azure-resourcemanager-edgeorder/README.md index 84443c722b0d..07586a718cb8 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/README.md +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/README.md @@ -1,8 +1,8 @@ -# Azure Resource Manager EdgeOrder client library for Java +# Azure Resource Manager edgeorder client library for Java -Azure Resource Manager EdgeOrder client library for Java. +Azure Resource Manager edgeorder client library for Java. -This package contains Microsoft Azure SDK for EdgeOrder Management SDK. Edge Order API's. Package tag package-2021-12. 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 edgeorder Management SDK. Edge Order API's. 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 @@ -52,15 +52,15 @@ 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(); -EdgeOrderManager manager = EdgeOrderManager +EdgeorderManager manager = EdgeorderManager .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. @@ -100,5 +100,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/edgeorder/azure-resourcemanager-edgeorder/SAMPLE.md b/sdk/edgeorder/azure-resourcemanager-edgeorder/SAMPLE.md index ec817ea503b8..29e52378957d 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/SAMPLE.md +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/SAMPLE.md @@ -1,85 +1,71 @@ # Code snippets and samples -## ResourceProvider - -- [CancelOrderItem](#resourceprovider_cancelorderitem) -- [CreateAddress](#resourceprovider_createaddress) -- [CreateOrderItem](#resourceprovider_createorderitem) -- [Delete](#resourceprovider_delete) -- [DeleteOrderItemByName](#resourceprovider_deleteorderitembyname) -- [GetByResourceGroup](#resourceprovider_getbyresourcegroup) -- [GetOrderByName](#resourceprovider_getorderbyname) -- [GetOrderItemByName](#resourceprovider_getorderitembyname) -- [List](#resourceprovider_list) -- [ListByResourceGroup](#resourceprovider_listbyresourcegroup) -- [ListConfigurations](#resourceprovider_listconfigurations) -- [ListOperations](#resourceprovider_listoperations) -- [ListOrderAtResourceGroupLevel](#resourceprovider_listorderatresourcegrouplevel) -- [ListOrderAtSubscriptionLevel](#resourceprovider_listorderatsubscriptionlevel) -- [ListOrderItemsAtResourceGroupLevel](#resourceprovider_listorderitemsatresourcegrouplevel) -- [ListOrderItemsAtSubscriptionLevel](#resourceprovider_listorderitemsatsubscriptionlevel) -- [ListProductFamilies](#resourceprovider_listproductfamilies) -- [ListProductFamiliesMetadata](#resourceprovider_listproductfamiliesmetadata) -- [ReturnOrderItem](#resourceprovider_returnorderitem) -- [UpdateAddress](#resourceprovider_updateaddress) -- [UpdateOrderItem](#resourceprovider_updateorderitem) -### ResourceProvider_CancelOrderItem +## AddressResources -```java -import com.azure.resourcemanager.edgeorder.models.CancellationReason; +- [Create](#addressresources_create) +- [Delete](#addressresources_delete) +- [GetByResourceGroup](#addressresources_getbyresourcegroup) +- [List](#addressresources_list) +- [ListByResourceGroup](#addressresources_listbyresourcegroup) +- [Update](#addressresources_update) -/** - * Samples for ResourceProvider CancelOrderItem. - */ -public final class ResourceProviderCancelOrderItemSamples { - /* - * x-ms-original-file: - * specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/CancelOrderItem.json - */ - /** - * Sample code: CancelOrderItem. - * - * @param manager Entry point to EdgeOrderManager. - */ - public static void cancelOrderItem(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders() - .cancelOrderItemWithResponse("TestOrderItemName3", "YourResourceGroupName", - new CancellationReason().withReason("Order cancelled"), com.azure.core.util.Context.NONE); - } -} -``` +## Operations + +- [List](#operations_list) + +## OrderItemResources + +- [Cancel](#orderitemresources_cancel) +- [Create](#orderitemresources_create) +- [Delete](#orderitemresources_delete) +- [GetByResourceGroup](#orderitemresources_getbyresourcegroup) +- [List](#orderitemresources_list) +- [ListByResourceGroup](#orderitemresources_listbyresourcegroup) +- [ReturnOrderItem](#orderitemresources_returnorderitem) +- [Update](#orderitemresources_update) + +## OrderResources + +- [Get](#orderresources_get) + +## OrdersOperationGroup -### ResourceProvider_CreateAddress +- [List](#ordersoperationgroup_list) +- [ListByResourceGroup](#ordersoperationgroup_listbyresourcegroup) + +## ProductsAndConfigurationsOperationGroup + +- [ListConfigurations](#productsandconfigurationsoperationgroup_listconfigurations) +- [ListProductFamilies](#productsandconfigurationsoperationgroup_listproductfamilies) +- [ListProductFamiliesMetadata](#productsandconfigurationsoperationgroup_listproductfamiliesmetadata) +### AddressResources_Create ```java +import com.azure.resourcemanager.edgeorder.models.AddressClassification; import com.azure.resourcemanager.edgeorder.models.AddressType; import com.azure.resourcemanager.edgeorder.models.ContactDetails; import com.azure.resourcemanager.edgeorder.models.ShippingAddress; import java.util.Arrays; /** - * Samples for ResourceProvider CreateAddress. + * Samples for AddressResources Create. */ -public final class ResourceProviderCreateAddressSamples { +public final class AddressResourcesCreateSamples { /* - * x-ms-original-file: - * specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/CreateAddress.json + * x-ms-original-file: 2024-02-01/CreateAddress.json */ /** * Sample code: CreateAddress. * - * @param manager Entry point to EdgeOrderManager. + * @param manager Entry point to EdgeorderManager. */ - public static void createAddress(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders() - .defineAddress("TestAddressName2") + public static void createAddress(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.addressResources() + .define("TestAddressName2") .withRegion("eastus") .withExistingResourceGroup("YourResourceGroupName") - .withContactDetails(new ContactDetails().withContactName("XXXX XXXX") - .withPhone("0000000000") - .withPhoneExtension("") - .withEmailList(Arrays.asList("xxxx@xxxx.xxx"))) + .withAddressClassification(AddressClassification.SHIPPING) .withShippingAddress(new ShippingAddress().withStreetAddress1("16 TOWNSEND ST") .withStreetAddress2("UNIT 1") .withCity("San Francisco") @@ -88,12 +74,84 @@ public final class ResourceProviderCreateAddressSamples { .withPostalCode("fakeTokenPlaceholder") .withCompanyName("Microsoft") .withAddressType(AddressType.NONE)) + .withContactDetails(new ContactDetails().withContactName("XXXX XXXX") + .withPhone("0000000000") + .withPhoneExtension("") + .withEmailList(Arrays.asList("xxxx@xxxx.xxx"))) .create(); } } ``` -### ResourceProvider_CreateOrderItem +### AddressResources_Delete + +```java +/** + * Samples for OrderResources Get. + */ +public final class OrderResourcesGetSamples { + /* + * x-ms-original-file: 2024-02-01/GetOrderByName.json + */ + /** + * Sample code: GetOrderByName. + * + * @param manager Entry point to EdgeorderManager. + */ + public static void getOrderByName(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.orderResources() + .getWithResponse("YourResourceGroupName", "eastus", "TestOrderName3", com.azure.core.util.Context.NONE); + } +} +``` + +### AddressResources_GetByResourceGroup + +```java +/** + * Samples for AddressResources List. + */ +public final class AddressResourcesListSamples { + /* + * x-ms-original-file: 2024-02-01/ListAddressesAtSubscriptionLevel.json + */ + /** + * Sample code: ListAddressesAtSubscriptionLevel. + * + * @param manager Entry point to EdgeorderManager. + */ + public static void listAddressesAtSubscriptionLevel(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.addressResources().list(null, null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### AddressResources_List + +```java +import com.azure.resourcemanager.edgeorder.models.CancellationReason; + +/** + * Samples for OrderItemResources Cancel. + */ +public final class OrderItemResourcesCancelSamples { + /* + * x-ms-original-file: 2024-02-01/CancelOrderItem.json + */ + /** + * Sample code: CancelOrderItem. + * + * @param manager Entry point to EdgeorderManager. + */ + public static void cancelOrderItem(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.orderItemResources() + .cancelWithResponse("YourResourceGroupName", "TestOrderItemName3", + new CancellationReason().withReason("Order cancelled"), com.azure.core.util.Context.NONE); + } +} +``` + +### AddressResources_ListByResourceGroup ```java import com.azure.resourcemanager.edgeorder.fluent.models.AddressProperties; @@ -111,21 +169,20 @@ import com.azure.resourcemanager.edgeorder.models.TransportShipmentTypes; import java.util.Arrays; /** - * Samples for ResourceProvider CreateOrderItem. + * Samples for OrderItemResources Create. */ -public final class ResourceProviderCreateOrderItemSamples { +public final class OrderItemResourcesCreateSamples { /* - * x-ms-original-file: - * specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/CreateOrderItem.json + * x-ms-original-file: 2024-02-01/CreateOrderItem.json */ /** * Sample code: CreateOrderItem. * - * @param manager Entry point to EdgeOrderManager. + * @param manager Entry point to EdgeorderManager. */ - public static void createOrderItem(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders() - .defineOrderItem("TestOrderItemName2") + public static void createOrderItem(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.orderItemResources() + .define("TestOrderItemName2") .withRegion("eastus") .withExistingResourceGroup("YourResourceGroupName") .withOrderItemDetails(new OrderItemDetails() @@ -137,6 +194,8 @@ public final class ResourceProviderCreateOrderItemSamples { .withOrderItemType(OrderItemType.PURCHASE) .withPreferences(new Preferences().withTransportPreferences( new TransportPreferences().withPreferredShipmentType(TransportShipmentTypes.MICROSOFT_MANAGED)))) + .withOrderId( + "/subscriptions/eb5dc900-6186-49d8-b7d7-febd866fdc1d/resourceGroups/YourResourceGroupName/providers/Microsoft.EdgeOrder/locations/eastus/orders/TestOrderName2") .withAddressDetails(new AddressDetails().withForwardAddress(new AddressProperties() .withShippingAddress(new ShippingAddress().withStreetAddress1("16 TOWNSEND ST") .withStreetAddress2("UNIT 1") @@ -150,514 +209,447 @@ public final class ResourceProviderCreateOrderItemSamples { .withPhone("0000000000") .withPhoneExtension("") .withEmailList(Arrays.asList("xxxx@xxxx.xxx"))))) - .withOrderId( - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.EdgeOrder/locations/eastus/orders/TestOrderName2") .create(); } } ``` -### ResourceProvider_Delete +### AddressResources_Update ```java /** - * Samples for ResourceProvider Delete. + * Samples for AddressResources GetByResourceGroup. */ -public final class ResourceProviderDeleteSamples { +public final class AddressResourcesGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/DeleteAddressByName.json + * x-ms-original-file: 2024-02-01/GetAddressByName.json */ /** - * Sample code: DeleteAddressByName. + * Sample code: GetAddressByName. * - * @param manager Entry point to EdgeOrderManager. + * @param manager Entry point to EdgeorderManager. */ - public static void deleteAddressByName(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders() - .delete("YourResourceGroupName", "TestAddressName1", com.azure.core.util.Context.NONE); + public static void getAddressByName(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.addressResources() + .getByResourceGroupWithResponse("YourResourceGroupName", "TestAddressName1", + com.azure.core.util.Context.NONE); } } ``` -### ResourceProvider_DeleteOrderItemByName +### Operations_List ```java /** - * Samples for ResourceProvider DeleteOrderItemByName. + * Samples for AddressResources Delete. */ -public final class ResourceProviderDeleteOrderItemByNameSamples { +public final class AddressResourcesDeleteSamples { /* - * x-ms-original-file: - * specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/DeleteOrderItemByName. - * json + * x-ms-original-file: 2024-02-01/DeleteAddressByName.json */ /** - * Sample code: DeleteOrderItemByName. + * Sample code: DeleteAddressByName. * - * @param manager Entry point to EdgeOrderManager. + * @param manager Entry point to EdgeorderManager. */ - public static void deleteOrderItemByName(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders() - .deleteOrderItemByName("TestOrderItemName3", "YourResourceGroupName", com.azure.core.util.Context.NONE); + public static void deleteAddressByName(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.addressResources() + .delete("YourResourceGroupName", "TestAddressName1", com.azure.core.util.Context.NONE); } } ``` -### ResourceProvider_GetByResourceGroup +### OrderItemResources_Cancel ```java +import com.azure.resourcemanager.edgeorder.models.AddressResource; +import com.azure.resourcemanager.edgeorder.models.AddressType; +import com.azure.resourcemanager.edgeorder.models.ContactDetails; +import com.azure.resourcemanager.edgeorder.models.ShippingAddress; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for ResourceProvider GetByResourceGroup. + * Samples for AddressResources Update. */ -public final class ResourceProviderGetByResourceGroupSamples { +public final class AddressResourcesUpdateSamples { /* - * x-ms-original-file: - * specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/GetAddressByName.json + * x-ms-original-file: 2024-02-01/UpdateAddress.json */ /** - * Sample code: GetAddressByName. + * Sample code: UpdateAddress. * - * @param manager Entry point to EdgeOrderManager. + * @param manager Entry point to EdgeorderManager. */ - public static void getAddressByName(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders() - .getByResourceGroupWithResponse("YourResourceGroupName", "TestAddressName1", - com.azure.core.util.Context.NONE); + public static void updateAddress(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + AddressResource resource = manager.addressResources() + .getByResourceGroupWithResponse("YourResourceGroupName", "TestAddressName2", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withShippingAddress(new ShippingAddress().withStreetAddress1("16 TOWNSEND ST") + .withStreetAddress2("UNIT 1") + .withCity("San Francisco") + .withStateOrProvince("CA") + .withCountry("US") + .withPostalCode("fakeTokenPlaceholder") + .withCompanyName("Microsoft") + .withAddressType(AddressType.NONE)) + .withContactDetails(new ContactDetails().withContactName("YYYY YYYY") + .withPhone("0000000000") + .withPhoneExtension("") + .withEmailList(Arrays.asList("xxxx@xxxx.xxx"))) + .apply(); } -} -``` -### ResourceProvider_GetOrderByName - -```java -/** - * Samples for ResourceProvider GetOrderByName. - */ -public final class ResourceProviderGetOrderByNameSamples { - /* - * x-ms-original-file: - * specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/GetOrderByName.json - */ - /** - * Sample code: GetOrderByName. - * - * @param manager Entry point to EdgeOrderManager. - */ - public static void getOrderByName(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders() - .getOrderByNameWithResponse("TestOrderName3", "YourResourceGroupName", "eastus", - com.azure.core.util.Context.NONE); + // 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; } } ``` -### ResourceProvider_GetOrderItemByName +### OrderItemResources_Create ```java +import com.azure.resourcemanager.edgeorder.models.FilterableProperty; +import com.azure.resourcemanager.edgeorder.models.ProductFamiliesRequest; +import com.azure.resourcemanager.edgeorder.models.SupportedFilterTypes; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for ResourceProvider GetOrderItemByName. + * Samples for ProductsAndConfigurationsOperationGroup ListProductFamilies. */ -public final class ResourceProviderGetOrderItemByNameSamples { +public final class ProductsAndConfigurationsOperationGroupListProductFamiliesSamples { /* - * x-ms-original-file: - * specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/GetOrderItemByName.json + * x-ms-original-file: 2024-02-01/ListProductFamilies.json */ /** - * Sample code: GetOrderItemByName. + * Sample code: ListProductFamilies. * - * @param manager Entry point to EdgeOrderManager. + * @param manager Entry point to EdgeorderManager. */ - public static void getOrderItemByName(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders() - .getOrderItemByNameWithResponse("TestOrderItemName1", "YourResourceGroupName", null, - com.azure.core.util.Context.NONE); + public static void listProductFamilies(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.productsAndConfigurationsOperationGroups() + .listProductFamilies( + new ProductFamiliesRequest().withFilterableProperties(mapOf("azurestackedge", + Arrays.asList(new FilterableProperty().withType(SupportedFilterTypes.SHIP_TO_COUNTRIES) + .withSupportedValues(Arrays.asList("US"))))), + "configurations", null, com.azure.core.util.Context.NONE); } -} -``` -### ResourceProvider_List - -```java -/** - * Samples for ResourceProvider List. - */ -public final class ResourceProviderListSamples { - /* - * x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ - * ListAddressesAtSubscriptionLevel.json - */ - /** - * Sample code: ListAddressesAtSubscriptionLevel. - * - * @param manager Entry point to EdgeOrderManager. - */ - public static void listAddressesAtSubscriptionLevel(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders().list(null, null, com.azure.core.util.Context.NONE); + // 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; } } ``` -### ResourceProvider_ListByResourceGroup +### OrderItemResources_Delete ```java /** - * Samples for ResourceProvider ListByResourceGroup. + * Samples for OrderItemResources ListByResourceGroup. */ -public final class ResourceProviderListByResourceGroupSamples { +public final class OrderItemResourcesListByResourceGroupSamples { /* - * x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ - * ListAddressesAtResourceGroupLevel.json + * x-ms-original-file: 2024-02-01/ListOrderItemsAtResourceGroupLevel.json */ /** - * Sample code: ListAddressesAtResourceGroupLevel. + * Sample code: ListOrderItemsAtResourceGroupLevel. * - * @param manager Entry point to EdgeOrderManager. + * @param manager Entry point to EdgeorderManager. */ - public static void listAddressesAtResourceGroupLevel(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders() - .listByResourceGroup("YourResourceGroupName", null, null, com.azure.core.util.Context.NONE); + public static void + listOrderItemsAtResourceGroupLevel(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.orderItemResources() + .listByResourceGroup("YourResourceGroupName", null, null, null, null, com.azure.core.util.Context.NONE); } } ``` -### ResourceProvider_ListConfigurations +### OrderItemResources_GetByResourceGroup ```java -import com.azure.resourcemanager.edgeorder.models.ConfigurationFilters; -import com.azure.resourcemanager.edgeorder.models.ConfigurationsRequest; -import com.azure.resourcemanager.edgeorder.models.FilterableProperty; -import com.azure.resourcemanager.edgeorder.models.HierarchyInformation; -import com.azure.resourcemanager.edgeorder.models.SupportedFilterTypes; -import java.util.Arrays; - /** - * Samples for ResourceProvider ListConfigurations. + * Samples for OrderItemResources GetByResourceGroup. */ -public final class ResourceProviderListConfigurationsSamples { +public final class OrderItemResourcesGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ListConfigurations.json + * x-ms-original-file: 2024-02-01/GetOrderItemByName.json */ /** - * Sample code: ListConfigurations. + * Sample code: GetOrderItemByName. * - * @param manager Entry point to EdgeOrderManager. + * @param manager Entry point to EdgeorderManager. */ - public static void listConfigurations(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders() - .listConfigurations( - new ConfigurationsRequest().withConfigurationFilters(Arrays.asList(new ConfigurationFilters() - .withHierarchyInformation(new HierarchyInformation().withProductFamilyName("azurestackedge") - .withProductLineName("azurestackedge") - .withProductName("azurestackedgegpu")) - .withFilterableProperty( - Arrays.asList(new FilterableProperty().withType(SupportedFilterTypes.SHIP_TO_COUNTRIES) - .withSupportedValues(Arrays.asList("US")))))), - null, com.azure.core.util.Context.NONE); + public static void getOrderItemByName(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.orderItemResources() + .getByResourceGroupWithResponse("YourResourceGroupName", "TestOrderItemName1", null, + com.azure.core.util.Context.NONE); } } ``` -### ResourceProvider_ListOperations +### OrderItemResources_List ```java +import com.azure.resourcemanager.edgeorder.models.ReturnOrderItemDetails; + /** - * Samples for ResourceProvider ListOperations. + * Samples for OrderItemResources ReturnOrderItem. */ -public final class ResourceProviderListOperationsSamples { +public final class OrderItemResourcesReturnOrderItemSamples { /* - * x-ms-original-file: - * specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ListOperations.json + * x-ms-original-file: 2024-02-01/ReturnOrderItem.json */ /** - * Sample code: ListOperations. + * Sample code: ReturnOrderItem. * - * @param manager Entry point to EdgeOrderManager. + * @param manager Entry point to EdgeorderManager. */ - public static void listOperations(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders().listOperations(com.azure.core.util.Context.NONE); + public static void returnOrderItem(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.orderItemResources() + .returnOrderItem("YourResourceGroupName", "TestOrderName4", + new ReturnOrderItemDetails().withReturnReason("Order returned"), com.azure.core.util.Context.NONE); } } ``` -### ResourceProvider_ListOrderAtResourceGroupLevel +### OrderItemResources_ListByResourceGroup ```java /** - * Samples for ResourceProvider ListOrderAtResourceGroupLevel. + * Samples for ProductsAndConfigurationsOperationGroup ListProductFamiliesMetadata. */ -public final class ResourceProviderListOrderAtResourceGroupLevelSamples { +public final class ProductsAndConfigurationsOperationGroupListProductFamiliesMetadataSamples { /* - * x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ - * ListOrderAtResourceGroupLevel.json + * x-ms-original-file: 2024-02-01/ListProductFamiliesMetadata.json */ /** - * Sample code: ListOrderAtResourceGroupLevel. + * Sample code: ListProductFamiliesMetadata. * - * @param manager Entry point to EdgeOrderManager. + * @param manager Entry point to EdgeorderManager. */ - public static void listOrderAtResourceGroupLevel(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders() - .listOrderAtResourceGroupLevel("YourResourceGroupName", null, com.azure.core.util.Context.NONE); + public static void listProductFamiliesMetadata(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.productsAndConfigurationsOperationGroups() + .listProductFamiliesMetadata(null, com.azure.core.util.Context.NONE); } } ``` -### ResourceProvider_ListOrderAtSubscriptionLevel +### OrderItemResources_ReturnOrderItem ```java +import com.azure.resourcemanager.edgeorder.models.ConfigurationFilter; +import com.azure.resourcemanager.edgeorder.models.ConfigurationsRequest; +import com.azure.resourcemanager.edgeorder.models.FilterableProperty; +import com.azure.resourcemanager.edgeorder.models.HierarchyInformation; +import com.azure.resourcemanager.edgeorder.models.SupportedFilterTypes; +import java.util.Arrays; + /** - * Samples for ResourceProvider ListOrderAtSubscriptionLevel. + * Samples for ProductsAndConfigurationsOperationGroup ListConfigurations. */ -public final class ResourceProviderListOrderAtSubscriptionLevelSamples { +public final class ProductsAndConfigurationsOperationGroupListConfigurationsSamples { /* - * x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ - * ListOrderAtSubscriptionLevel.json + * x-ms-original-file: 2024-02-01/ListConfigurations.json */ /** - * Sample code: ListOrderAtSubscriptionLevel. + * Sample code: ListConfigurations. * - * @param manager Entry point to EdgeOrderManager. - */ - public static void listOrderAtSubscriptionLevel(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders().listOrderAtSubscriptionLevel(null, com.azure.core.util.Context.NONE); + * @param manager Entry point to EdgeorderManager. + */ + public static void listConfigurations(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.productsAndConfigurationsOperationGroups() + .listConfigurations(new ConfigurationsRequest().withConfigurationFilter(new ConfigurationFilter() + .withHierarchyInformation(new HierarchyInformation().withProductFamilyName("azurestackedge") + .withProductLineName("azurestackedge") + .withProductName("azurestackedgegpu")) + .withFilterableProperty( + Arrays.asList(new FilterableProperty().withType(SupportedFilterTypes.SHIP_TO_COUNTRIES) + .withSupportedValues(Arrays.asList("US"))))), + null, com.azure.core.util.Context.NONE); } } ``` -### ResourceProvider_ListOrderItemsAtResourceGroupLevel +### OrderItemResources_Update ```java /** - * Samples for ResourceProvider ListOrderItemsAtResourceGroupLevel. + * Samples for AddressResources ListByResourceGroup. */ -public final class ResourceProviderListOrderItemsAtResourceGroupLevelSamples { +public final class AddressResourcesListByResourceGroupSamples { /* - * x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ - * ListOrderItemsAtResourceGroupLevel.json + * x-ms-original-file: 2024-02-01/ListAddressesAtResourceGroupLevel.json */ /** - * Sample code: ListOrderItemsAtResourceGroupLevel. + * Sample code: ListAddressesAtResourceGroupLevel. * - * @param manager Entry point to EdgeOrderManager. + * @param manager Entry point to EdgeorderManager. */ - public static void - listOrderItemsAtResourceGroupLevel(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders() - .listOrderItemsAtResourceGroupLevel("YourResourceGroupName", null, null, null, - com.azure.core.util.Context.NONE); + public static void listAddressesAtResourceGroupLevel(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.addressResources() + .listByResourceGroup("YourResourceGroupName", null, null, null, com.azure.core.util.Context.NONE); } } ``` -### ResourceProvider_ListOrderItemsAtSubscriptionLevel +### OrderResources_Get ```java /** - * Samples for ResourceProvider ListOrderItemsAtSubscriptionLevel. + * Samples for OrderItemResources List. */ -public final class ResourceProviderListOrderItemsAtSubscriptionLevelSamples { +public final class OrderItemResourcesListSamples { /* - * x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ - * ListOrderItemsAtSubscriptionLevel.json + * x-ms-original-file: 2024-02-01/ListOrderItemsAtSubscriptionLevel.json */ /** * Sample code: ListOrderItemsAtSubscriptionLevel. * - * @param manager Entry point to EdgeOrderManager. + * @param manager Entry point to EdgeorderManager. */ - public static void listOrderItemsAtSubscriptionLevel(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders() - .listOrderItemsAtSubscriptionLevel(null, null, null, com.azure.core.util.Context.NONE); + public static void listOrderItemsAtSubscriptionLevel(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.orderItemResources().list(null, null, null, null, com.azure.core.util.Context.NONE); } } ``` -### ResourceProvider_ListProductFamilies +### OrdersOperationGroup_List ```java -import com.azure.resourcemanager.edgeorder.models.FilterableProperty; -import com.azure.resourcemanager.edgeorder.models.ProductFamiliesRequest; -import com.azure.resourcemanager.edgeorder.models.SupportedFilterTypes; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - /** - * Samples for ResourceProvider ListProductFamilies. + * Samples for OrdersOperationGroup ListByResourceGroup. */ -public final class ResourceProviderListProductFamiliesSamples { +public final class OrdersOperationGroupListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ListProductFamilies.json + * x-ms-original-file: 2024-02-01/ListOrderAtResourceGroupLevel.json */ /** - * Sample code: ListProductFamilies. + * Sample code: ListOrderAtResourceGroupLevel. * - * @param manager Entry point to EdgeOrderManager. + * @param manager Entry point to EdgeorderManager. */ - public static void listProductFamilies(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders() - .listProductFamilies( - new ProductFamiliesRequest().withFilterableProperties(mapOf("azurestackedge", - Arrays.asList(new FilterableProperty().withType(SupportedFilterTypes.SHIP_TO_COUNTRIES) - .withSupportedValues(Arrays.asList("US"))))), - "configurations", null, com.azure.core.util.Context.NONE); - } - - // 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; + public static void listOrderAtResourceGroupLevel(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.ordersOperationGroups() + .listByResourceGroup("YourResourceGroupName", null, null, com.azure.core.util.Context.NONE); } } ``` -### ResourceProvider_ListProductFamiliesMetadata +### OrdersOperationGroup_ListByResourceGroup ```java /** - * Samples for ResourceProvider ListProductFamiliesMetadata. + * Samples for Operations List. */ -public final class ResourceProviderListProductFamiliesMetadataSamples { +public final class OperationsListSamples { /* - * x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ - * ListProductFamiliesMetadata.json + * x-ms-original-file: 2024-02-01/ListOperations.json */ /** - * Sample code: ListProductFamiliesMetadata. + * Sample code: ListOperations. * - * @param manager Entry point to EdgeOrderManager. + * @param manager Entry point to EdgeorderManager. */ - public static void listProductFamiliesMetadata(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders().listProductFamiliesMetadata(null, com.azure.core.util.Context.NONE); + public static void listOperations(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); } } ``` -### ResourceProvider_ReturnOrderItem +### ProductsAndConfigurationsOperationGroup_ListConfigurations ```java -import com.azure.resourcemanager.edgeorder.models.ReturnOrderItemDetails; +import com.azure.resourcemanager.edgeorder.models.OrderItemResource; +import com.azure.resourcemanager.edgeorder.models.Preferences; +import com.azure.resourcemanager.edgeorder.models.TransportPreferences; +import com.azure.resourcemanager.edgeorder.models.TransportShipmentTypes; /** - * Samples for ResourceProvider ReturnOrderItem. + * Samples for OrderItemResources Update. */ -public final class ResourceProviderReturnOrderItemSamples { +public final class OrderItemResourcesUpdateSamples { /* - * x-ms-original-file: - * specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ReturnOrderItem.json + * x-ms-original-file: 2024-02-01/UpdateOrderItem.json */ /** - * Sample code: ReturnOrderItem. + * Sample code: UpdateOrderItem. * - * @param manager Entry point to EdgeOrderManager. + * @param manager Entry point to EdgeorderManager. */ - public static void returnOrderItem(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders() - .returnOrderItem("TestOrderName4", "YourResourceGroupName", - new ReturnOrderItemDetails().withReturnReason("Order returned"), com.azure.core.util.Context.NONE); + public static void updateOrderItem(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + OrderItemResource resource = manager.orderItemResources() + .getByResourceGroupWithResponse("YourResourceGroupName", "TestOrderItemName3", null, + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withPreferences(new Preferences().withTransportPreferences( + new TransportPreferences().withPreferredShipmentType(TransportShipmentTypes.CUSTOMER_MANAGED))) + .apply(); } } ``` -### ResourceProvider_UpdateAddress +### ProductsAndConfigurationsOperationGroup_ListProductFamilies ```java -import com.azure.resourcemanager.edgeorder.models.AddressResource; -import com.azure.resourcemanager.edgeorder.models.AddressType; -import com.azure.resourcemanager.edgeorder.models.ContactDetails; -import com.azure.resourcemanager.edgeorder.models.ShippingAddress; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - /** - * Samples for ResourceProvider UpdateAddress. + * Samples for OrderItemResources Delete. */ -public final class ResourceProviderUpdateAddressSamples { +public final class OrderItemResourcesDeleteSamples { /* - * x-ms-original-file: - * specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/UpdateAddress.json + * x-ms-original-file: 2024-02-01/DeleteOrderItemByName.json */ /** - * Sample code: UpdateAddress. + * Sample code: DeleteOrderItemByName. * - * @param manager Entry point to EdgeOrderManager. + * @param manager Entry point to EdgeorderManager. */ - public static void updateAddress(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - AddressResource resource = manager.resourceProviders() - .getByResourceGroupWithResponse("YourResourceGroupName", "TestAddressName2", - com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withShippingAddress(new ShippingAddress().withStreetAddress1("16 TOWNSEND ST") - .withStreetAddress2("UNIT 1") - .withCity("San Francisco") - .withStateOrProvince("CA") - .withCountry("US") - .withPostalCode("fakeTokenPlaceholder") - .withCompanyName("Microsoft") - .withAddressType(AddressType.NONE)) - .withContactDetails(new ContactDetails().withContactName("YYYY YYYY") - .withPhone("0000000000") - .withPhoneExtension("") - .withEmailList(Arrays.asList("xxxx@xxxx.xxx"))) - .apply(); - } - - // 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; + public static void deleteOrderItemByName(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.orderItemResources() + .delete("YourResourceGroupName", "TestOrderItemName3", com.azure.core.util.Context.NONE); } } ``` -### ResourceProvider_UpdateOrderItem +### ProductsAndConfigurationsOperationGroup_ListProductFamiliesMetadata ```java -import com.azure.resourcemanager.edgeorder.models.OrderItemResource; -import com.azure.resourcemanager.edgeorder.models.Preferences; -import com.azure.resourcemanager.edgeorder.models.TransportPreferences; -import com.azure.resourcemanager.edgeorder.models.TransportShipmentTypes; - /** - * Samples for ResourceProvider UpdateOrderItem. + * Samples for OrdersOperationGroup List. */ -public final class ResourceProviderUpdateOrderItemSamples { +public final class OrdersOperationGroupListSamples { /* - * x-ms-original-file: - * specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/UpdateOrderItem.json + * x-ms-original-file: 2024-02-01/ListOrderAtSubscriptionLevel.json */ /** - * Sample code: UpdateOrderItem. + * Sample code: ListOrderAtSubscriptionLevel. * - * @param manager Entry point to EdgeOrderManager. + * @param manager Entry point to EdgeorderManager. */ - public static void updateOrderItem(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - OrderItemResource resource = manager.resourceProviders() - .getOrderItemByNameWithResponse("TestOrderItemName3", "YourResourceGroupName", null, - com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withPreferences(new Preferences().withTransportPreferences( - new TransportPreferences().withPreferredShipmentType(TransportShipmentTypes.CUSTOMER_MANAGED))) - .apply(); + public static void listOrderAtSubscriptionLevel(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.ordersOperationGroups().list(null, null, com.azure.core.util.Context.NONE); } } ``` diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/pom.xml b/sdk/edgeorder/azure-resourcemanager-edgeorder/pom.xml index dd32055ace3e..83012a2ed3fd 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/pom.xml +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/pom.xml @@ -1,7 +1,7 @@ 4.0.0 @@ -17,8 +17,8 @@ 1.1.0-beta.1 jar - Microsoft Azure SDK for EdgeOrder Management - This package contains Microsoft Azure SDK for EdgeOrder Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Edge Order API's. Package tag package-2021-12. + Microsoft Azure SDK for edgeorder Management + This package contains Microsoft Azure SDK for edgeorder Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Edge Order API's. https://github.com/Azure/azure-sdk-for-java @@ -45,7 +45,7 @@ UTF-8 0 0 - false + true diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/EdgeOrderManager.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/EdgeorderManager.java similarity index 62% rename from sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/EdgeOrderManager.java rename to sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/EdgeorderManager.java index fb3e4d5d8df3..6e829d32d187 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/EdgeOrderManager.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/EdgeorderManager.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder; @@ -22,31 +22,53 @@ 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.edgeorder.fluent.EdgeOrderManagementClient; -import com.azure.resourcemanager.edgeorder.implementation.EdgeOrderManagementClientBuilder; -import com.azure.resourcemanager.edgeorder.implementation.ResourceProvidersImpl; -import com.azure.resourcemanager.edgeorder.models.ResourceProviders; +import com.azure.resourcemanager.edgeorder.fluent.EdgeOrderClient; +import com.azure.resourcemanager.edgeorder.implementation.AddressResourcesImpl; +import com.azure.resourcemanager.edgeorder.implementation.EdgeOrderClientBuilder; +import com.azure.resourcemanager.edgeorder.implementation.OperationsImpl; +import com.azure.resourcemanager.edgeorder.implementation.OrderItemResourcesImpl; +import com.azure.resourcemanager.edgeorder.implementation.OrderResourcesImpl; +import com.azure.resourcemanager.edgeorder.implementation.OrdersOperationGroupsImpl; +import com.azure.resourcemanager.edgeorder.implementation.ProductsAndConfigurationsOperationGroupsImpl; +import com.azure.resourcemanager.edgeorder.models.AddressResources; +import com.azure.resourcemanager.edgeorder.models.Operations; +import com.azure.resourcemanager.edgeorder.models.OrderItemResources; +import com.azure.resourcemanager.edgeorder.models.OrderResources; +import com.azure.resourcemanager.edgeorder.models.OrdersOperationGroups; +import com.azure.resourcemanager.edgeorder.models.ProductsAndConfigurationsOperationGroups; import java.time.Duration; 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; /** - * Entry point to EdgeOrderManager. + * Entry point to EdgeorderManager. * Edge Order API's. */ -public final class EdgeOrderManager { - private ResourceProviders resourceProviders; +public final class EdgeorderManager { + private Operations operations; - private final EdgeOrderManagementClient clientObject; + private AddressResources addressResources; - private EdgeOrderManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + private OrderItemResources orderItemResources; + + private OrderResources orderResources; + + private ProductsAndConfigurationsOperationGroups productsAndConfigurationsOperationGroups; + + private OrdersOperationGroups ordersOperationGroups; + + private final EdgeOrderClient clientObject; + + private EdgeorderManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = new EdgeOrderManagementClientBuilder().pipeline(httpPipeline) + this.clientObject = new EdgeOrderClientBuilder().pipeline(httpPipeline) .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .subscriptionId(profile.getSubscriptionId()) .defaultPollInterval(defaultPollInterval) @@ -54,38 +76,38 @@ private EdgeOrderManager(HttpPipeline httpPipeline, AzureProfile profile, Durati } /** - * Creates an instance of EdgeOrder service API entry point. + * Creates an instance of edgeorder service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the EdgeOrder service API instance. + * @return the edgeorder service API instance. */ - public static EdgeOrderManager authenticate(TokenCredential credential, AzureProfile profile) { + public static EdgeorderManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); return configure().authenticate(credential, profile); } /** - * Creates an instance of EdgeOrder service API entry point. + * Creates an instance of edgeorder service API entry point. * * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. * @param profile the Azure profile for client. - * @return the EdgeOrder service API instance. + * @return the edgeorder service API instance. */ - public static EdgeOrderManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + public static EdgeorderManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); - return new EdgeOrderManager(httpPipeline, profile, null); + return new EdgeorderManager(httpPipeline, profile, null); } /** - * Gets a Configurable instance that can be used to create EdgeOrderManager with optional configuration. + * Gets a Configurable instance that can be used to create EdgeorderManager with optional configuration. * * @return the Configurable instance allowing configurations. */ public static Configurable configure() { - return new EdgeOrderManager.Configurable(); + return new EdgeorderManager.Configurable(); } /** @@ -93,6 +115,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-edgeorder.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -190,22 +215,24 @@ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { } /** - * Creates an instance of EdgeOrder service API entry point. + * Creates an instance of edgeorder service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the EdgeOrder service API instance. + * @return the edgeorder service API instance. */ - public EdgeOrderManager authenticate(TokenCredential credential, AzureProfile profile) { + public EdgeorderManager 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.edgeorder") .append("/") - .append("1.0.0"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -247,29 +274,90 @@ public EdgeOrderManager authenticate(TokenCredential credential, AzureProfile pr HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) .policies(policies.toArray(new HttpPipelinePolicy[0])) .build(); - return new EdgeOrderManager(httpPipeline, profile, defaultPollInterval); + return new EdgeorderManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of AddressResources. It manages AddressResource. + * + * @return Resource collection API of AddressResources. + */ + public AddressResources addressResources() { + if (this.addressResources == null) { + this.addressResources = new AddressResourcesImpl(clientObject.getAddressResources(), this); + } + return addressResources; + } + + /** + * Gets the resource collection API of OrderItemResources. It manages OrderItemResource. + * + * @return Resource collection API of OrderItemResources. + */ + public OrderItemResources orderItemResources() { + if (this.orderItemResources == null) { + this.orderItemResources = new OrderItemResourcesImpl(clientObject.getOrderItemResources(), this); + } + return orderItemResources; + } + + /** + * Gets the resource collection API of OrderResources. + * + * @return Resource collection API of OrderResources. + */ + public OrderResources orderResources() { + if (this.orderResources == null) { + this.orderResources = new OrderResourcesImpl(clientObject.getOrderResources(), this); + } + return orderResources; + } + + /** + * Gets the resource collection API of ProductsAndConfigurationsOperationGroups. + * + * @return Resource collection API of ProductsAndConfigurationsOperationGroups. + */ + public ProductsAndConfigurationsOperationGroups productsAndConfigurationsOperationGroups() { + if (this.productsAndConfigurationsOperationGroups == null) { + this.productsAndConfigurationsOperationGroups = new ProductsAndConfigurationsOperationGroupsImpl( + clientObject.getProductsAndConfigurationsOperationGroups(), this); } + return productsAndConfigurationsOperationGroups; } /** - * Gets the resource collection API of ResourceProviders. It manages AddressResource, OrderItemResource. + * Gets the resource collection API of OrdersOperationGroups. * - * @return Resource collection API of ResourceProviders. + * @return Resource collection API of OrdersOperationGroups. */ - public ResourceProviders resourceProviders() { - if (this.resourceProviders == null) { - this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this); + public OrdersOperationGroups ordersOperationGroups() { + if (this.ordersOperationGroups == null) { + this.ordersOperationGroups = new OrdersOperationGroupsImpl(clientObject.getOrdersOperationGroups(), this); } - return resourceProviders; + return ordersOperationGroups; } /** - * Gets wrapped service client EdgeOrderManagementClient providing direct access to the underlying auto-generated - * API implementation, based on Azure REST API. + * Gets wrapped service client EdgeOrderClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. * - * @return Wrapped service client EdgeOrderManagementClient. + * @return Wrapped service client EdgeOrderClient. */ - public EdgeOrderManagementClient serviceClient() { + public EdgeOrderClient serviceClient() { return this.clientObject; } } diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/AddressResourcesClient.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/AddressResourcesClient.java new file mode 100644 index 000000000000..4dccb8e25582 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/AddressResourcesClient.java @@ -0,0 +1,305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.edgeorder.fluent.models.AddressResourceInner; +import com.azure.resourcemanager.edgeorder.models.AddressUpdateParameter; + +/** + * An instance of this class provides access to all the operations defined in AddressResourcesClient. + */ +public interface AddressResourcesClient { + /** + * Get information about the specified address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @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 information about the specified address along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String addressName, + Context context); + + /** + * Get information about the specified address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified address. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AddressResourceInner getByResourceGroup(String resourceGroupName, String addressName); + + /** + * Create a new address with the specified parameters. Existing address cannot be updated with this API and should + * instead be updated with the Update address API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param addressResource Address details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 address Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AddressResourceInner> beginCreate(String resourceGroupName, + String addressName, AddressResourceInner addressResource); + + /** + * Create a new address with the specified parameters. Existing address cannot be updated with this API and should + * instead be updated with the Update address API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param addressResource Address details from request body. + * @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 {@link SyncPoller} for polling of address Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AddressResourceInner> beginCreate(String resourceGroupName, + String addressName, AddressResourceInner addressResource, Context context); + + /** + * Create a new address with the specified parameters. Existing address cannot be updated with this API and should + * instead be updated with the Update address API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param addressResource Address details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return address Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AddressResourceInner create(String resourceGroupName, String addressName, AddressResourceInner addressResource); + + /** + * Create a new address with the specified parameters. Existing address cannot be updated with this API and should + * instead be updated with the Update address API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param addressResource Address details from request body. + * @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 address Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AddressResourceInner create(String resourceGroupName, String addressName, AddressResourceInner addressResource, + Context context); + + /** + * Update the properties of an existing address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param addressUpdateParameter Address update parameters from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 address Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AddressResourceInner> beginUpdate(String resourceGroupName, + String addressName, AddressUpdateParameter addressUpdateParameter); + + /** + * Update the properties of an existing address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param addressUpdateParameter Address update parameters from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the + * server matches this value. + * @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 {@link SyncPoller} for polling of address Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AddressResourceInner> beginUpdate(String resourceGroupName, + String addressName, AddressUpdateParameter addressUpdateParameter, String ifMatch, Context context); + + /** + * Update the properties of an existing address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param addressUpdateParameter Address update parameters from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return address Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AddressResourceInner update(String resourceGroupName, String addressName, + AddressUpdateParameter addressUpdateParameter); + + /** + * Update the properties of an existing address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param addressUpdateParameter Address update parameters from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the + * server matches this value. + * @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 address Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AddressResourceInner update(String resourceGroupName, String addressName, + AddressUpdateParameter addressUpdateParameter, String ifMatch, Context context); + + /** + * Delete an address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + SyncPoller, Void> beginDelete(String resourceGroupName, String addressName); + + /** + * Delete an address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String addressName, Context context); + + /** + * Delete an address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String addressName); + + /** + * Delete an address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String addressName, Context context); + + /** + * List all the addresses available under the given 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 address Resource Collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List all the addresses available under the given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter $filter is supported to filter based on shipping address properties. Filter supports only equals + * operation. + * @param skipToken $skipToken is supported on Get list of addresses, which provides the next page in the list of + * addresses. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @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 address Resource Collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, String filter, String skipToken, + Integer top, Context context); + + /** + * List all the addresses available under the subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return address Resource Collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List all the addresses available under the subscription. + * + * @param filter $filter is supported to filter based on shipping address properties. Filter supports only equals + * operation. + * @param skipToken $skipToken is supported on Get list of addresses, which provides the next page in the list of + * addresses. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @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 address Resource Collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String filter, String skipToken, Integer top, Context context); +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/EdgeOrderClient.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/EdgeOrderClient.java new file mode 100644 index 000000000000..02bf3cd9b620 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/EdgeOrderClient.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for EdgeOrderClient class. + */ +public interface EdgeOrderClient { + /** + * Gets Service host. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * 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. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the AddressResourcesClient object to access its operations. + * + * @return the AddressResourcesClient object. + */ + AddressResourcesClient getAddressResources(); + + /** + * Gets the OrderItemResourcesClient object to access its operations. + * + * @return the OrderItemResourcesClient object. + */ + OrderItemResourcesClient getOrderItemResources(); + + /** + * Gets the OrderResourcesClient object to access its operations. + * + * @return the OrderResourcesClient object. + */ + OrderResourcesClient getOrderResources(); + + /** + * Gets the ProductsAndConfigurationsOperationGroupsClient object to access its operations. + * + * @return the ProductsAndConfigurationsOperationGroupsClient object. + */ + ProductsAndConfigurationsOperationGroupsClient getProductsAndConfigurationsOperationGroups(); + + /** + * Gets the OrdersOperationGroupsClient object to access its operations. + * + * @return the OrdersOperationGroupsClient object. + */ + OrdersOperationGroupsClient getOrdersOperationGroups(); +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/EdgeOrderManagementClient.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/EdgeOrderManagementClient.java deleted file mode 100644 index 04d2e6bda50e..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/EdgeOrderManagementClient.java +++ /dev/null @@ -1,55 +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.edgeorder.fluent; - -import com.azure.core.http.HttpPipeline; -import java.time.Duration; - -/** - * The interface for EdgeOrderManagementClient class. - */ -public interface EdgeOrderManagementClient { - /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - String getEndpoint(); - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - String getApiVersion(); - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - HttpPipeline getHttpPipeline(); - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - Duration getDefaultPollInterval(); - - /** - * Gets the ResourceProvidersClient object to access its operations. - * - * @return the ResourceProvidersClient object. - */ - ResourceProvidersClient getResourceProviders(); -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/OperationsClient.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/OperationsClient.java new file mode 100644 index 000000000000..c04ad90ea41b --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/OperationsClient.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.edgeorder.fluent.models.OperationInner; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public interface OperationsClient { + /** + * List the operations for the provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List the operations for the provider. + * + * @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 list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/OrderItemResourcesClient.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/OrderItemResourcesClient.java new file mode 100644 index 000000000000..3ca62128eee6 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/OrderItemResourcesClient.java @@ -0,0 +1,402 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.edgeorder.fluent.models.OrderItemResourceInner; +import com.azure.resourcemanager.edgeorder.models.CancellationReason; +import com.azure.resourcemanager.edgeorder.models.OrderItemUpdateParameter; +import com.azure.resourcemanager.edgeorder.models.ReturnOrderItemDetails; + +/** + * An instance of this class provides access to all the operations defined in OrderItemResourcesClient. + */ +public interface OrderItemResourcesClient { + /** + * Get an order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param expand $expand is supported on parent device details, device details, forward shipping details and reverse + * shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for + * order item provides details on the devices of the product, Device Details for order item provides details on the + * devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and + * reverse shipping details respectively. + * @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 an order item along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String orderItemName, + String expand, Context context); + + /** + * Get an order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 order item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrderItemResourceInner getByResourceGroup(String resourceGroupName, String orderItemName); + + /** + * Create an order item. Existing order item cannot be updated with this api and should instead be updated with the + * Update order item + * API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param orderItemResource Order item details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 represents order item resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OrderItemResourceInner> beginCreate(String resourceGroupName, + String orderItemName, OrderItemResourceInner orderItemResource); + + /** + * Create an order item. Existing order item cannot be updated with this api and should instead be updated with the + * Update order item + * API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param orderItemResource Order item details from request body. + * @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 {@link SyncPoller} for polling of represents order item resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OrderItemResourceInner> beginCreate(String resourceGroupName, + String orderItemName, OrderItemResourceInner orderItemResource, Context context); + + /** + * Create an order item. Existing order item cannot be updated with this api and should instead be updated with the + * Update order item + * API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param orderItemResource Order item details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents order item resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrderItemResourceInner create(String resourceGroupName, String orderItemName, + OrderItemResourceInner orderItemResource); + + /** + * Create an order item. Existing order item cannot be updated with this api and should instead be updated with the + * Update order item + * API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param orderItemResource Order item details from request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents order item resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrderItemResourceInner create(String resourceGroupName, String orderItemName, + OrderItemResourceInner orderItemResource, Context context); + + /** + * Update the properties of an existing order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param orderItemUpdateParameter Order item update parameters from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 represents order item resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OrderItemResourceInner> beginUpdate(String resourceGroupName, + String orderItemName, OrderItemUpdateParameter orderItemUpdateParameter); + + /** + * Update the properties of an existing order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param orderItemUpdateParameter Order item update parameters from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the order on the + * server matches this value. + * @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 {@link SyncPoller} for polling of represents order item resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OrderItemResourceInner> beginUpdate(String resourceGroupName, + String orderItemName, OrderItemUpdateParameter orderItemUpdateParameter, String ifMatch, Context context); + + /** + * Update the properties of an existing order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param orderItemUpdateParameter Order item update parameters from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents order item resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrderItemResourceInner update(String resourceGroupName, String orderItemName, + OrderItemUpdateParameter orderItemUpdateParameter); + + /** + * Update the properties of an existing order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param orderItemUpdateParameter Order item update parameters from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the order on the + * server matches this value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents order item resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrderItemResourceInner update(String resourceGroupName, String orderItemName, + OrderItemUpdateParameter orderItemUpdateParameter, String ifMatch, Context context); + + /** + * Delete an order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + SyncPoller, Void> beginDelete(String resourceGroupName, String orderItemName); + + /** + * Delete an order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String orderItemName, Context context); + + /** + * Delete an order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String orderItemName); + + /** + * Delete an order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String orderItemName, Context context); + + /** + * List order items at resource group level. + * + * @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 list of order items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List order items at resource group level. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter $filter is supported to filter based on order id and order Item Type. Filter supports only equals + * operation. + * @param expand $expand is supported on parent device details, device details, forward shipping details and reverse + * shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for + * order item provides details on the devices of the product, Device Details for order item provides details on the + * devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and + * reverse shipping details respectively. + * @param skipToken $skipToken is supported on Get list of order items, which provides the next page in the list of + * order items. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of order items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, String filter, String expand, + String skipToken, Integer top, Context context); + + /** + * List order items at subscription level. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of order items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List order items at subscription level. + * + * @param filter $filter is supported to filter based on order id and order Item Type. Filter supports only equals + * operation. + * @param expand $expand is supported on parent device details, device details, forward shipping details and reverse + * shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for + * order item provides details on the devices of the product, Device Details for order item provides details on the + * devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and + * reverse shipping details respectively. + * @param skipToken $skipToken is supported on Get list of order items, which provides the next page in the list of + * order items. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of order items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String filter, String expand, String skipToken, Integer top, + Context context); + + /** + * Cancel order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param cancellationReason Reason for cancellation. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response cancelWithResponse(String resourceGroupName, String orderItemName, + CancellationReason cancellationReason, Context context); + + /** + * Cancel order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param cancellationReason Reason for cancellation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void cancel(String resourceGroupName, String orderItemName, CancellationReason cancellationReason); + + /** + * Return order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param returnOrderItemDetails Return order item details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginReturnOrderItem(String resourceGroupName, String orderItemName, + ReturnOrderItemDetails returnOrderItemDetails); + + /** + * Return order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param returnOrderItemDetails Return order item details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginReturnOrderItem(String resourceGroupName, String orderItemName, + ReturnOrderItemDetails returnOrderItemDetails, Context context); + + /** + * Return order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param returnOrderItemDetails Return order item details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void returnOrderItem(String resourceGroupName, String orderItemName, ReturnOrderItemDetails returnOrderItemDetails); + + /** + * Return order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param returnOrderItemDetails Return order item details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void returnOrderItem(String resourceGroupName, String orderItemName, ReturnOrderItemDetails returnOrderItemDetails, + Context context); +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/OrderResourcesClient.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/OrderResourcesClient.java new file mode 100644 index 000000000000..09b8769edb04 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/OrderResourcesClient.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.edgeorder.fluent.models.OrderResourceInner; + +/** + * An instance of this class provides access to all the operations defined in OrderResourcesClient. + */ +public interface OrderResourcesClient { + /** + * Get an order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param orderName The name of the order. + * @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 an order along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String location, String orderName, + Context context); + + /** + * Get an order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param orderName The name of the order. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 order. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrderResourceInner get(String resourceGroupName, String location, String orderName); +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/OrdersOperationGroupsClient.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/OrdersOperationGroupsClient.java new file mode 100644 index 000000000000..31b22d095820 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/OrdersOperationGroupsClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.edgeorder.fluent.models.OrderResourceInner; + +/** + * An instance of this class provides access to all the operations defined in OrdersOperationGroupsClient. + */ +public interface OrdersOperationGroupsClient { + /** + * List orders at subscription level. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of orders as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List orders at subscription level. + * + * @param skipToken $skipToken is supported on Get list of orders, which provides the next page in the list of + * orders. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of orders as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String skipToken, Integer top, Context context); + + /** + * List orders at resource group level. + * + * @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 list of orders as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List orders at resource group level. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param skipToken $skipToken is supported on Get list of orders, which provides the next page in the list of + * orders. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of orders as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, String skipToken, Integer top, + Context context); +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/ProductsAndConfigurationsOperationGroupsClient.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/ProductsAndConfigurationsOperationGroupsClient.java new file mode 100644 index 000000000000..7dae81a4ed11 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/ProductsAndConfigurationsOperationGroupsClient.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.edgeorder.fluent.models.ConfigurationInner; +import com.azure.resourcemanager.edgeorder.fluent.models.ProductFamiliesMetadataDetailsInner; +import com.azure.resourcemanager.edgeorder.fluent.models.ProductFamilyInner; +import com.azure.resourcemanager.edgeorder.models.ConfigurationsRequest; +import com.azure.resourcemanager.edgeorder.models.ProductFamiliesRequest; + +/** + * An instance of this class provides access to all the operations defined in + * ProductsAndConfigurationsOperationGroupsClient. + */ +public interface ProductsAndConfigurationsOperationGroupsClient { + /** + * List configurations for the given product family, product line and product for the given subscription. + * + * @param configurationsRequest Filters for showing the configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of configurations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listConfigurations(ConfigurationsRequest configurationsRequest); + + /** + * List configurations for the given product family, product line and product for the given subscription. + * + * @param configurationsRequest Filters for showing the configurations. + * @param skipToken $skipToken is supported on list of configurations, which provides the next page in the list of + * configurations. + * @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 list of configurations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listConfigurations(ConfigurationsRequest configurationsRequest, String skipToken, + Context context); + + /** + * List product families for the given subscription. + * + * @param productFamiliesRequest Filters for showing the product families. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of product families as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listProductFamilies(ProductFamiliesRequest productFamiliesRequest); + + /** + * List product families for the given subscription. + * + * @param productFamiliesRequest Filters for showing the product families. + * @param expand $expand is supported on configurations parameter for product, which provides details on the + * configurations for the product. + * @param skipToken $skipToken is supported on list of product families, which provides the next page in the list of + * product families. + * @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 list of product families as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listProductFamilies(ProductFamiliesRequest productFamiliesRequest, String expand, + String skipToken, Context context); + + /** + * List product families metadata for the given subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds details about product family metadata as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listProductFamiliesMetadata(); + + /** + * List product families metadata for the given subscription. + * + * @param skipToken $skipToken is supported on list of product families metadata, which provides the next page in + * the list of product families metadata. + * @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 holds details about product family metadata as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listProductFamiliesMetadata(String skipToken, Context context); +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/ResourceProvidersClient.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/ResourceProvidersClient.java deleted file mode 100644 index d07f5a844c7e..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/ResourceProvidersClient.java +++ /dev/null @@ -1,865 +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.edgeorder.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.edgeorder.fluent.models.AddressResourceInner; -import com.azure.resourcemanager.edgeorder.fluent.models.ConfigurationInner; -import com.azure.resourcemanager.edgeorder.fluent.models.OperationInner; -import com.azure.resourcemanager.edgeorder.fluent.models.OrderItemResourceInner; -import com.azure.resourcemanager.edgeorder.fluent.models.OrderResourceInner; -import com.azure.resourcemanager.edgeorder.fluent.models.ProductFamiliesMetadataDetailsInner; -import com.azure.resourcemanager.edgeorder.fluent.models.ProductFamilyInner; -import com.azure.resourcemanager.edgeorder.models.AddressUpdateParameter; -import com.azure.resourcemanager.edgeorder.models.CancellationReason; -import com.azure.resourcemanager.edgeorder.models.ConfigurationsRequest; -import com.azure.resourcemanager.edgeorder.models.OrderItemUpdateParameter; -import com.azure.resourcemanager.edgeorder.models.ProductFamiliesRequest; -import com.azure.resourcemanager.edgeorder.models.ReturnOrderItemDetails; - -/** - * An instance of this class provides access to all the operations defined in ResourceProvidersClient. - */ -public interface ResourceProvidersClient { - /** - * This method gets all the operations that are exposed for customer. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listOperations(); - - /** - * This method gets all the operations that are exposed for customer. - * - * @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 list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listOperations(Context context); - - /** - * Lists all the addresses available under the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return address Resource Collection as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all the addresses available under the subscription. - * - * @param filter $filter is supported to filter based on shipping address properties. Filter supports only equals - * operation. - * @param skipToken $skipToken is supported on Get list of addresses, which provides the next page in the list of - * addresses. - * @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 address Resource Collection as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, String skipToken, Context context); - - /** - * This method provides the list of product families for the given subscription. - * - * @param productFamiliesRequest Filters for showing the product families. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of product families as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listProductFamilies(ProductFamiliesRequest productFamiliesRequest); - - /** - * This method provides the list of product families for the given subscription. - * - * @param productFamiliesRequest Filters for showing the product families. - * @param expand $expand is supported on configurations parameter for product, which provides details on the - * configurations for the product. - * @param skipToken $skipToken is supported on list of product families, which provides the next page in the list of - * product families. - * @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 list of product families as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listProductFamilies(ProductFamiliesRequest productFamiliesRequest, String expand, - String skipToken, Context context); - - /** - * This method provides the list of configurations for the given product family, product line and product under - * subscription. - * - * @param configurationsRequest Filters for showing the configurations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of configurations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listConfigurations(ConfigurationsRequest configurationsRequest); - - /** - * This method provides the list of configurations for the given product family, product line and product under - * subscription. - * - * @param configurationsRequest Filters for showing the configurations. - * @param skipToken $skipToken is supported on list of configurations, which provides the next page in the list of - * configurations. - * @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 list of configurations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listConfigurations(ConfigurationsRequest configurationsRequest, String skipToken, - Context context); - - /** - * This method provides the list of product families metadata for the given subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return holds details about product family metadata as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listProductFamiliesMetadata(); - - /** - * This method provides the list of product families metadata for the given subscription. - * - * @param skipToken $skipToken is supported on list of product families metadata, which provides the next page in - * the list of product families metadata. - * @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 holds details about product family metadata as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listProductFamiliesMetadata(String skipToken, Context context); - - /** - * Lists order at subscription level. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orders as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listOrderAtSubscriptionLevel(); - - /** - * Lists order at subscription level. - * - * @param skipToken $skipToken is supported on Get list of order, which provides the next page in the list of order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orders as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listOrderAtSubscriptionLevel(String skipToken, Context context); - - /** - * Lists order item at subscription level. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orderItems as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listOrderItemsAtSubscriptionLevel(); - - /** - * Lists order item at subscription level. - * - * @param filter $filter is supported to filter based on order id. Filter supports only equals operation. - * @param expand $expand is supported on device details, forward shipping details and reverse shipping details - * parameters. Each of these can be provided as a comma separated list. Device Details for order item provides - * details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping - * details respectively. - * @param skipToken $skipToken is supported on Get list of order items, which provides the next page in the list of - * order items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orderItems as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listOrderItemsAtSubscriptionLevel(String filter, String expand, - String skipToken, Context context); - - /** - * Lists all the addresses available under the given 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 address Resource Collection as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists all the addresses available under the given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter $filter is supported to filter based on shipping address properties. Filter supports only equals - * operation. - * @param skipToken $skipToken is supported on Get list of addresses, which provides the next page in the list of - * address. - * @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 address Resource Collection as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, String filter, String skipToken, - Context context); - - /** - * Gets information about the specified address. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @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 information about the specified address along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String addressName, - Context context); - - /** - * Gets information about the specified address. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified address. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AddressResourceInner getByResourceGroup(String resourceGroupName, String addressName); - - /** - * Creates a new address with the specified parameters. Existing address can be updated with this API. - * - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressResource Address details from request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 address Resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AddressResourceInner> beginCreateAddress(String addressName, - String resourceGroupName, AddressResourceInner addressResource); - - /** - * Creates a new address with the specified parameters. Existing address can be updated with this API. - * - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressResource Address details from request body. - * @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 {@link SyncPoller} for polling of address Resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AddressResourceInner> beginCreateAddress(String addressName, - String resourceGroupName, AddressResourceInner addressResource, Context context); - - /** - * Creates a new address with the specified parameters. Existing address can be updated with this API. - * - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressResource Address details from request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return address Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AddressResourceInner createAddress(String addressName, String resourceGroupName, - AddressResourceInner addressResource); - - /** - * Creates a new address with the specified parameters. Existing address can be updated with this API. - * - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressResource Address details from request body. - * @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 address Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AddressResourceInner createAddress(String addressName, String resourceGroupName, - AddressResourceInner addressResource, Context context); - - /** - * Deletes an address. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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) - SyncPoller, Void> beginDelete(String resourceGroupName, String addressName); - - /** - * Deletes an address. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String addressName, Context context); - - /** - * Deletes an address. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String addressName); - - /** - * Deletes an address. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String addressName, Context context); - - /** - * Updates the properties of an existing address. - * - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressUpdateParameter Address update parameters from request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 address Resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AddressResourceInner> beginUpdateAddress(String addressName, - String resourceGroupName, AddressUpdateParameter addressUpdateParameter); - - /** - * Updates the properties of an existing address. - * - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressUpdateParameter Address update parameters from request body. - * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the - * server matches this value. - * @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 {@link SyncPoller} for polling of address Resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AddressResourceInner> beginUpdateAddress(String addressName, - String resourceGroupName, AddressUpdateParameter addressUpdateParameter, String ifMatch, Context context); - - /** - * Updates the properties of an existing address. - * - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressUpdateParameter Address update parameters from request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return address Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AddressResourceInner updateAddress(String addressName, String resourceGroupName, - AddressUpdateParameter addressUpdateParameter); - - /** - * Updates the properties of an existing address. - * - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressUpdateParameter Address update parameters from request body. - * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the - * server matches this value. - * @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 address Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AddressResourceInner updateAddress(String addressName, String resourceGroupName, - AddressUpdateParameter addressUpdateParameter, String ifMatch, Context context); - - /** - * Lists order at resource group level. - * - * @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 list of orders as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listOrderAtResourceGroupLevel(String resourceGroupName); - - /** - * Lists order at resource group level. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param skipToken $skipToken is supported on Get list of order, which provides the next page in the list of order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orders as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listOrderAtResourceGroupLevel(String resourceGroupName, String skipToken, - Context context); - - /** - * Gets an order. - * - * @param orderName The name of the order. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param location The name of Azure region. - * @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 an order along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getOrderByNameWithResponse(String orderName, String resourceGroupName, String location, - Context context); - - /** - * Gets an order. - * - * @param orderName The name of the order. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param location The name of Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OrderResourceInner getOrderByName(String orderName, String resourceGroupName, String location); - - /** - * Lists order item at resource group level. - * - * @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 list of orderItems as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listOrderItemsAtResourceGroupLevel(String resourceGroupName); - - /** - * Lists order item at resource group level. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter $filter is supported to filter based on order id. Filter supports only equals operation. - * @param expand $expand is supported on device details, forward shipping details and reverse shipping details - * parameters. Each of these can be provided as a comma separated list. Device Details for order item provides - * details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping - * details respectively. - * @param skipToken $skipToken is supported on Get list of order items, which provides the next page in the list of - * order items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orderItems as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listOrderItemsAtResourceGroupLevel(String resourceGroupName, String filter, - String expand, String skipToken, Context context); - - /** - * Gets an order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param expand $expand is supported on device details, forward shipping details and reverse shipping details - * parameters. Each of these can be provided as a comma separated list. Device Details for order item provides - * details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping - * details respectively. - * @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 an order item along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getOrderItemByNameWithResponse(String orderItemName, String resourceGroupName, - String expand, Context context); - - /** - * Gets an order item. - * - * @param orderItemName The name of the order item. - * @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 an order item. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OrderItemResourceInner getOrderItemByName(String orderItemName, String resourceGroupName); - - /** - * Creates an order item. Existing order item cannot be updated with this api and should instead be updated with the - * Update order item API. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param orderItemResource Order item details from request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 represents order item contract. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OrderItemResourceInner> beginCreateOrderItem(String orderItemName, - String resourceGroupName, OrderItemResourceInner orderItemResource); - - /** - * Creates an order item. Existing order item cannot be updated with this api and should instead be updated with the - * Update order item API. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param orderItemResource Order item details from request body. - * @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 {@link SyncPoller} for polling of represents order item contract. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OrderItemResourceInner> beginCreateOrderItem(String orderItemName, - String resourceGroupName, OrderItemResourceInner orderItemResource, Context context); - - /** - * Creates an order item. Existing order item cannot be updated with this api and should instead be updated with the - * Update order item API. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param orderItemResource Order item details from request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents order item contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OrderItemResourceInner createOrderItem(String orderItemName, String resourceGroupName, - OrderItemResourceInner orderItemResource); - - /** - * Creates an order item. Existing order item cannot be updated with this api and should instead be updated with the - * Update order item API. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param orderItemResource Order item details from request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents order item contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OrderItemResourceInner createOrderItem(String orderItemName, String resourceGroupName, - OrderItemResourceInner orderItemResource, Context context); - - /** - * Deletes an order item. - * - * @param orderItemName The name of the order item. - * @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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDeleteOrderItemByName(String orderItemName, String resourceGroupName); - - /** - * Deletes an order item. - * - * @param orderItemName The name of the order item. - * @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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDeleteOrderItemByName(String orderItemName, String resourceGroupName, - Context context); - - /** - * Deletes an order item. - * - * @param orderItemName The name of the order item. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteOrderItemByName(String orderItemName, String resourceGroupName); - - /** - * Deletes an order item. - * - * @param orderItemName The name of the order item. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteOrderItemByName(String orderItemName, String resourceGroupName, Context context); - - /** - * Updates the properties of an existing order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param orderItemUpdateParameter order item update parameters from request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 represents order item contract. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OrderItemResourceInner> beginUpdateOrderItem(String orderItemName, - String resourceGroupName, OrderItemUpdateParameter orderItemUpdateParameter); - - /** - * Updates the properties of an existing order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param orderItemUpdateParameter order item update parameters from request body. - * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the order on the - * server matches this value. - * @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 {@link SyncPoller} for polling of represents order item contract. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OrderItemResourceInner> beginUpdateOrderItem(String orderItemName, - String resourceGroupName, OrderItemUpdateParameter orderItemUpdateParameter, String ifMatch, Context context); - - /** - * Updates the properties of an existing order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param orderItemUpdateParameter order item update parameters from request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents order item contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OrderItemResourceInner updateOrderItem(String orderItemName, String resourceGroupName, - OrderItemUpdateParameter orderItemUpdateParameter); - - /** - * Updates the properties of an existing order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param orderItemUpdateParameter order item update parameters from request body. - * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the order on the - * server matches this value. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents order item contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OrderItemResourceInner updateOrderItem(String orderItemName, String resourceGroupName, - OrderItemUpdateParameter orderItemUpdateParameter, String ifMatch, Context context); - - /** - * Cancel order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cancellationReason Reason for cancellation. - * @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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response cancelOrderItemWithResponse(String orderItemName, String resourceGroupName, - CancellationReason cancellationReason, Context context); - - /** - * Cancel order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cancellationReason Reason for cancellation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void cancelOrderItem(String orderItemName, String resourceGroupName, CancellationReason cancellationReason); - - /** - * Return order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param returnOrderItemDetails Return order item CurrentStatus. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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) - SyncPoller, Void> beginReturnOrderItem(String orderItemName, String resourceGroupName, - ReturnOrderItemDetails returnOrderItemDetails); - - /** - * Return order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param returnOrderItemDetails Return order item CurrentStatus. - * @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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginReturnOrderItem(String orderItemName, String resourceGroupName, - ReturnOrderItemDetails returnOrderItemDetails, Context context); - - /** - * Return order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param returnOrderItemDetails Return order item CurrentStatus. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void returnOrderItem(String orderItemName, String resourceGroupName, ReturnOrderItemDetails returnOrderItemDetails); - - /** - * Return order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param returnOrderItemDetails Return order item CurrentStatus. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void returnOrderItem(String orderItemName, String resourceGroupName, ReturnOrderItemDetails returnOrderItemDetails, - Context context); -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/AddressProperties.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/AddressProperties.java index 5f592075ff81..652ebe009bf4 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/AddressProperties.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/AddressProperties.java @@ -1,17 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.fluent.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; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.edgeorder.models.AddressClassification; import com.azure.resourcemanager.edgeorder.models.AddressValidationStatus; import com.azure.resourcemanager.edgeorder.models.ContactDetails; +import com.azure.resourcemanager.edgeorder.models.ProvisioningState; import com.azure.resourcemanager.edgeorder.models.ShippingAddress; import java.io.IOException; @@ -21,26 +22,56 @@ @Fluent public final class AddressProperties implements JsonSerializable { /* - * Shipping details for the address + * Type of address based on its usage context. + */ + private AddressClassification addressClassification; + + /* + * Shipping details for the address. */ private ShippingAddress shippingAddress; /* - * Contact details for the address + * Contact details for the address. */ private ContactDetails contactDetails; /* - * Status of address validation + * Status of address validation. */ private AddressValidationStatus addressValidationStatus; + /* + * Provisioning state + */ + private ProvisioningState provisioningState; + /** * Creates an instance of AddressProperties class. */ public AddressProperties() { } + /** + * Get the addressClassification property: Type of address based on its usage context. + * + * @return the addressClassification value. + */ + public AddressClassification addressClassification() { + return this.addressClassification; + } + + /** + * Set the addressClassification property: Type of address based on its usage context. + * + * @param addressClassification the addressClassification value to set. + * @return the AddressProperties object itself. + */ + public AddressProperties withAddressClassification(AddressClassification addressClassification) { + this.addressClassification = addressClassification; + return this; + } + /** * Get the shippingAddress property: Shipping details for the address. * @@ -90,6 +121,15 @@ public AddressValidationStatus addressValidationStatus() { return this.addressValidationStatus; } + /** + * Get the provisioningState property: Provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + /** * Validates the instance. * @@ -99,25 +139,21 @@ public void validate() { if (shippingAddress() != null) { shippingAddress().validate(); } - if (contactDetails() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property contactDetails in model AddressProperties")); - } else { + if (contactDetails() != null) { contactDetails().validate(); } } - private static final ClientLogger LOGGER = new ClientLogger(AddressProperties.class); - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("contactDetails", this.contactDetails); + jsonWriter.writeStringField("addressClassification", + this.addressClassification == null ? null : this.addressClassification.toString()); jsonWriter.writeJsonField("shippingAddress", this.shippingAddress); + jsonWriter.writeJsonField("contactDetails", this.contactDetails); return jsonWriter.writeEndObject(); } @@ -127,7 +163,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of AddressProperties 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 AddressProperties. */ public static AddressProperties fromJson(JsonReader jsonReader) throws IOException { @@ -137,13 +172,18 @@ public static AddressProperties fromJson(JsonReader jsonReader) throws IOExcepti String fieldName = reader.getFieldName(); reader.nextToken(); - if ("contactDetails".equals(fieldName)) { - deserializedAddressProperties.contactDetails = ContactDetails.fromJson(reader); + if ("addressClassification".equals(fieldName)) { + deserializedAddressProperties.addressClassification + = AddressClassification.fromString(reader.getString()); } else if ("shippingAddress".equals(fieldName)) { deserializedAddressProperties.shippingAddress = ShippingAddress.fromJson(reader); + } else if ("contactDetails".equals(fieldName)) { + deserializedAddressProperties.contactDetails = ContactDetails.fromJson(reader); } else if ("addressValidationStatus".equals(fieldName)) { deserializedAddressProperties.addressValidationStatus = AddressValidationStatus.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedAddressProperties.provisioningState = ProvisioningState.fromString(reader.getString()); } else { reader.skipChildren(); } diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/AddressResourceInner.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/AddressResourceInner.java index 415469b86a2e..7e7ac64a5126 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/AddressResourceInner.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/AddressResourceInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.fluent.models; @@ -11,8 +11,10 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.edgeorder.models.AddressClassification; import com.azure.resourcemanager.edgeorder.models.AddressValidationStatus; import com.azure.resourcemanager.edgeorder.models.ContactDetails; +import com.azure.resourcemanager.edgeorder.models.ProvisioningState; import com.azure.resourcemanager.edgeorder.models.ShippingAddress; import java.io.IOException; import java.util.Map; @@ -28,7 +30,7 @@ public final class AddressResourceInner extends Resource { private AddressProperties innerProperties = new AddressProperties(); /* - * Represents resource creation and update time + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ private SystemData systemData; @@ -63,7 +65,7 @@ private AddressProperties innerProperties() { } /** - * Get the systemData property: Represents resource creation and update time. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -119,6 +121,29 @@ public AddressResourceInner withTags(Map tags) { return this; } + /** + * Get the addressClassification property: Type of address based on its usage context. + * + * @return the addressClassification value. + */ + public AddressClassification addressClassification() { + return this.innerProperties() == null ? null : this.innerProperties().addressClassification(); + } + + /** + * Set the addressClassification property: Type of address based on its usage context. + * + * @param addressClassification the addressClassification value to set. + * @return the AddressResourceInner object itself. + */ + public AddressResourceInner withAddressClassification(AddressClassification addressClassification) { + if (this.innerProperties() == null) { + this.innerProperties = new AddressProperties(); + } + this.innerProperties().withAddressClassification(addressClassification); + return this; + } + /** * Get the shippingAddress property: Shipping details for the address. * @@ -174,6 +199,15 @@ public AddressValidationStatus addressValidationStatus() { return this.innerProperties() == null ? null : this.innerProperties().addressValidationStatus(); } + /** + * Get the provisioningState property: Provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + /** * Validates the instance. * diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/AddressUpdateProperties.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/AddressUpdateProperties.java index ccf7f3bea102..8bd2700a8fa0 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/AddressUpdateProperties.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/AddressUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.fluent.models; @@ -14,17 +14,17 @@ import java.io.IOException; /** - * Address Properties. + * Address Update Properties. */ @Fluent public final class AddressUpdateProperties implements JsonSerializable { /* - * Shipping details for the address + * Shipping details for the address. */ private ShippingAddress shippingAddress; /* - * Contact details for the address + * Contact details for the address. */ private ContactDetails contactDetails; diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/ChildConfigurationProperties.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/ChildConfigurationProperties.java new file mode 100644 index 000000000000..6b0cf6b8f22c --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/ChildConfigurationProperties.java @@ -0,0 +1,420 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.edgeorder.models.AvailabilityInformation; +import com.azure.resourcemanager.edgeorder.models.ChildConfigurationType; +import com.azure.resourcemanager.edgeorder.models.CostInformation; +import com.azure.resourcemanager.edgeorder.models.Description; +import com.azure.resourcemanager.edgeorder.models.Dimensions; +import com.azure.resourcemanager.edgeorder.models.FilterableProperty; +import com.azure.resourcemanager.edgeorder.models.FulfillmentType; +import com.azure.resourcemanager.edgeorder.models.GroupedChildConfigurations; +import com.azure.resourcemanager.edgeorder.models.HierarchyInformation; +import com.azure.resourcemanager.edgeorder.models.ImageInformation; +import com.azure.resourcemanager.edgeorder.models.ProvisioningSupport; +import com.azure.resourcemanager.edgeorder.models.Specification; +import java.io.IOException; +import java.time.Duration; +import java.util.List; + +/** + * Properties of child configuration. + */ +@Immutable +public final class ChildConfigurationProperties implements JsonSerializable { + /* + * Child configuration type. + */ + private ChildConfigurationType childConfigurationType; + + /* + * Flag to indicate if the child configuration is part of the base configuration, which means the customer need not + * pass this configuration in OptInAdditionalConfigurations while placing an order, it will be shipped by default. + */ + private Boolean isPartOfBaseConfiguration; + + /* + * Minimum quantity a customer can order while choosing this configuration. + */ + private Integer minimumQuantity; + + /* + * Maximum quantity a customer can order while choosing this configuration. + */ + private Integer maximumQuantity; + + /* + * Specifications of the configuration. + */ + private List specifications; + + /* + * Dimensions of the configuration. + */ + private Dimensions dimensions; + + /* + * Determining nature of provisioning that the configuration supports. + */ + private ProvisioningSupport provisioningSupport; + + /* + * Different types of child configurations which exist for this configuration, these can be used to populate the + * child configuration filter. + */ + private List childConfigurationTypes; + + /* + * Child configurations present for the configuration after applying child configuration filter, grouped by the + * category name of the child configuration. + */ + private List groupedChildConfigurations; + + /* + * The Term Commitment Durations that are supported for a configuration. + */ + private List supportedTermCommitmentDurations; + + /* + * List of filters supported for a product. + */ + private List filterableProperties; + + /* + * Display Name for the product system. + */ + private String displayName; + + /* + * Description related to the product system. + */ + private Description description; + + /* + * Image information for the product system. + */ + private List imageInformation; + + /* + * Cost information for the product system. + */ + private CostInformation costInformation; + + /* + * Availability information of the product system. + */ + private AvailabilityInformation availabilityInformation; + + /* + * Hierarchy information of a product. + */ + private HierarchyInformation hierarchyInformation; + + /* + * The entity responsible for fulfillment of the item at the given hierarchy level. + */ + private FulfillmentType fulfilledBy; + + /** + * Creates an instance of ChildConfigurationProperties class. + */ + private ChildConfigurationProperties() { + } + + /** + * Get the childConfigurationType property: Child configuration type. + * + * @return the childConfigurationType value. + */ + public ChildConfigurationType childConfigurationType() { + return this.childConfigurationType; + } + + /** + * Get the isPartOfBaseConfiguration property: Flag to indicate if the child configuration is part of the base + * configuration, which means the customer need not pass this configuration in OptInAdditionalConfigurations while + * placing an order, it will be shipped by default. + * + * @return the isPartOfBaseConfiguration value. + */ + public Boolean isPartOfBaseConfiguration() { + return this.isPartOfBaseConfiguration; + } + + /** + * Get the minimumQuantity property: Minimum quantity a customer can order while choosing this configuration. + * + * @return the minimumQuantity value. + */ + public Integer minimumQuantity() { + return this.minimumQuantity; + } + + /** + * Get the maximumQuantity property: Maximum quantity a customer can order while choosing this configuration. + * + * @return the maximumQuantity value. + */ + public Integer maximumQuantity() { + return this.maximumQuantity; + } + + /** + * Get the specifications property: Specifications of the configuration. + * + * @return the specifications value. + */ + public List specifications() { + return this.specifications; + } + + /** + * Get the dimensions property: Dimensions of the configuration. + * + * @return the dimensions value. + */ + public Dimensions dimensions() { + return this.dimensions; + } + + /** + * Get the provisioningSupport property: Determining nature of provisioning that the configuration supports. + * + * @return the provisioningSupport value. + */ + public ProvisioningSupport provisioningSupport() { + return this.provisioningSupport; + } + + /** + * Get the childConfigurationTypes property: Different types of child configurations which exist for this + * configuration, these can be used to populate the child configuration filter. + * + * @return the childConfigurationTypes value. + */ + public List childConfigurationTypes() { + return this.childConfigurationTypes; + } + + /** + * Get the groupedChildConfigurations property: Child configurations present for the configuration after applying + * child configuration filter, grouped by the category name of the child configuration. + * + * @return the groupedChildConfigurations value. + */ + public List groupedChildConfigurations() { + return this.groupedChildConfigurations; + } + + /** + * Get the supportedTermCommitmentDurations property: The Term Commitment Durations that are supported for a + * configuration. + * + * @return the supportedTermCommitmentDurations value. + */ + public List supportedTermCommitmentDurations() { + return this.supportedTermCommitmentDurations; + } + + /** + * Get the filterableProperties property: List of filters supported for a product. + * + * @return the filterableProperties value. + */ + public List filterableProperties() { + return this.filterableProperties; + } + + /** + * Get the displayName property: Display Name for the product system. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the description property: Description related to the product system. + * + * @return the description value. + */ + public Description description() { + return this.description; + } + + /** + * Get the imageInformation property: Image information for the product system. + * + * @return the imageInformation value. + */ + public List imageInformation() { + return this.imageInformation; + } + + /** + * Get the costInformation property: Cost information for the product system. + * + * @return the costInformation value. + */ + public CostInformation costInformation() { + return this.costInformation; + } + + /** + * Get the availabilityInformation property: Availability information of the product system. + * + * @return the availabilityInformation value. + */ + public AvailabilityInformation availabilityInformation() { + return this.availabilityInformation; + } + + /** + * Get the hierarchyInformation property: Hierarchy information of a product. + * + * @return the hierarchyInformation value. + */ + public HierarchyInformation hierarchyInformation() { + return this.hierarchyInformation; + } + + /** + * Get the fulfilledBy property: The entity responsible for fulfillment of the item at the given hierarchy level. + * + * @return the fulfilledBy value. + */ + public FulfillmentType fulfilledBy() { + return this.fulfilledBy; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (specifications() != null) { + specifications().forEach(e -> e.validate()); + } + if (dimensions() != null) { + dimensions().validate(); + } + if (groupedChildConfigurations() != null) { + groupedChildConfigurations().forEach(e -> e.validate()); + } + if (filterableProperties() != null) { + filterableProperties().forEach(e -> e.validate()); + } + if (description() != null) { + description().validate(); + } + if (imageInformation() != null) { + imageInformation().forEach(e -> e.validate()); + } + if (costInformation() != null) { + costInformation().validate(); + } + if (availabilityInformation() != null) { + availabilityInformation().validate(); + } + if (hierarchyInformation() != null) { + hierarchyInformation().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChildConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChildConfigurationProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ChildConfigurationProperties. + */ + public static ChildConfigurationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ChildConfigurationProperties deserializedChildConfigurationProperties = new ChildConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("childConfigurationType".equals(fieldName)) { + deserializedChildConfigurationProperties.childConfigurationType + = ChildConfigurationType.fromString(reader.getString()); + } else if ("isPartOfBaseConfiguration".equals(fieldName)) { + deserializedChildConfigurationProperties.isPartOfBaseConfiguration + = reader.getNullable(JsonReader::getBoolean); + } else if ("minimumQuantity".equals(fieldName)) { + deserializedChildConfigurationProperties.minimumQuantity = reader.getNullable(JsonReader::getInt); + } else if ("maximumQuantity".equals(fieldName)) { + deserializedChildConfigurationProperties.maximumQuantity = reader.getNullable(JsonReader::getInt); + } else if ("specifications".equals(fieldName)) { + List specifications = reader.readArray(reader1 -> Specification.fromJson(reader1)); + deserializedChildConfigurationProperties.specifications = specifications; + } else if ("dimensions".equals(fieldName)) { + deserializedChildConfigurationProperties.dimensions = Dimensions.fromJson(reader); + } else if ("provisioningSupport".equals(fieldName)) { + deserializedChildConfigurationProperties.provisioningSupport + = ProvisioningSupport.fromString(reader.getString()); + } else if ("childConfigurationTypes".equals(fieldName)) { + List childConfigurationTypes + = reader.readArray(reader1 -> ChildConfigurationType.fromString(reader1.getString())); + deserializedChildConfigurationProperties.childConfigurationTypes = childConfigurationTypes; + } else if ("groupedChildConfigurations".equals(fieldName)) { + List groupedChildConfigurations + = reader.readArray(reader1 -> GroupedChildConfigurations.fromJson(reader1)); + deserializedChildConfigurationProperties.groupedChildConfigurations = groupedChildConfigurations; + } else if ("supportedTermCommitmentDurations".equals(fieldName)) { + List supportedTermCommitmentDurations = reader.readArray( + reader1 -> reader1.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString()))); + deserializedChildConfigurationProperties.supportedTermCommitmentDurations + = supportedTermCommitmentDurations; + } else if ("filterableProperties".equals(fieldName)) { + List filterableProperties + = reader.readArray(reader1 -> FilterableProperty.fromJson(reader1)); + deserializedChildConfigurationProperties.filterableProperties = filterableProperties; + } else if ("displayName".equals(fieldName)) { + deserializedChildConfigurationProperties.displayName = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedChildConfigurationProperties.description = Description.fromJson(reader); + } else if ("imageInformation".equals(fieldName)) { + List imageInformation + = reader.readArray(reader1 -> ImageInformation.fromJson(reader1)); + deserializedChildConfigurationProperties.imageInformation = imageInformation; + } else if ("costInformation".equals(fieldName)) { + deserializedChildConfigurationProperties.costInformation = CostInformation.fromJson(reader); + } else if ("availabilityInformation".equals(fieldName)) { + deserializedChildConfigurationProperties.availabilityInformation + = AvailabilityInformation.fromJson(reader); + } else if ("hierarchyInformation".equals(fieldName)) { + deserializedChildConfigurationProperties.hierarchyInformation + = HierarchyInformation.fromJson(reader); + } else if ("fulfilledBy".equals(fieldName)) { + deserializedChildConfigurationProperties.fulfilledBy + = FulfillmentType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedChildConfigurationProperties; + }); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/ConfigurationInner.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/ConfigurationInner.java index 768e89f59b36..6814fb47e47a 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/ConfigurationInner.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/ConfigurationInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.fluent.models; @@ -10,14 +10,19 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.edgeorder.models.AvailabilityInformation; +import com.azure.resourcemanager.edgeorder.models.ChildConfigurationType; import com.azure.resourcemanager.edgeorder.models.CostInformation; import com.azure.resourcemanager.edgeorder.models.Description; import com.azure.resourcemanager.edgeorder.models.Dimensions; import com.azure.resourcemanager.edgeorder.models.FilterableProperty; +import com.azure.resourcemanager.edgeorder.models.FulfillmentType; +import com.azure.resourcemanager.edgeorder.models.GroupedChildConfigurations; import com.azure.resourcemanager.edgeorder.models.HierarchyInformation; import com.azure.resourcemanager.edgeorder.models.ImageInformation; +import com.azure.resourcemanager.edgeorder.models.ProvisioningSupport; import com.azure.resourcemanager.edgeorder.models.Specification; import java.io.IOException; +import java.time.Duration; import java.util.List; /** @@ -26,14 +31,14 @@ @Immutable public final class ConfigurationInner implements JsonSerializable { /* - * Properties of configuration + * Properties of configuration. */ private ConfigurationProperties innerProperties; /** * Creates an instance of ConfigurationInner class. */ - public ConfigurationInner() { + private ConfigurationInner() { } /** @@ -64,7 +69,46 @@ public Dimensions dimensions() { } /** - * Get the filterableProperties property: list of filters supported for a product. + * Get the provisioningSupport property: Determining nature of provisioning that the configuration supports. + * + * @return the provisioningSupport value. + */ + public ProvisioningSupport provisioningSupport() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningSupport(); + } + + /** + * Get the childConfigurationTypes property: Different types of child configurations which exist for this + * configuration, these can be used to populate the child configuration filter. + * + * @return the childConfigurationTypes value. + */ + public List childConfigurationTypes() { + return this.innerProperties() == null ? null : this.innerProperties().childConfigurationTypes(); + } + + /** + * Get the groupedChildConfigurations property: Child configurations present for the configuration after applying + * child configuration filter, grouped by the category name of the child configuration. + * + * @return the groupedChildConfigurations value. + */ + public List groupedChildConfigurations() { + return this.innerProperties() == null ? null : this.innerProperties().groupedChildConfigurations(); + } + + /** + * Get the supportedTermCommitmentDurations property: The Term Commitment Durations that are supported for a + * configuration. + * + * @return the supportedTermCommitmentDurations value. + */ + public List supportedTermCommitmentDurations() { + return this.innerProperties() == null ? null : this.innerProperties().supportedTermCommitmentDurations(); + } + + /** + * Get the filterableProperties property: List of filters supported for a product. * * @return the filterableProperties value. */ @@ -126,6 +170,15 @@ public HierarchyInformation hierarchyInformation() { return this.innerProperties() == null ? null : this.innerProperties().hierarchyInformation(); } + /** + * Get the fulfilledBy property: The entity responsible for fulfillment of the item at the given hierarchy level. + * + * @return the fulfilledBy value. + */ + public FulfillmentType fulfilledBy() { + return this.innerProperties() == null ? null : this.innerProperties().fulfilledBy(); + } + /** * Validates the instance. * diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/ConfigurationProperties.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/ConfigurationProperties.java index 64d4fff6571f..393b58438cc4 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/ConfigurationProperties.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/ConfigurationProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.fluent.models; @@ -9,15 +9,20 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.edgeorder.models.AvailabilityInformation; +import com.azure.resourcemanager.edgeorder.models.ChildConfigurationType; import com.azure.resourcemanager.edgeorder.models.CommonProperties; import com.azure.resourcemanager.edgeorder.models.CostInformation; import com.azure.resourcemanager.edgeorder.models.Description; import com.azure.resourcemanager.edgeorder.models.Dimensions; import com.azure.resourcemanager.edgeorder.models.FilterableProperty; +import com.azure.resourcemanager.edgeorder.models.FulfillmentType; +import com.azure.resourcemanager.edgeorder.models.GroupedChildConfigurations; import com.azure.resourcemanager.edgeorder.models.HierarchyInformation; import com.azure.resourcemanager.edgeorder.models.ImageInformation; +import com.azure.resourcemanager.edgeorder.models.ProvisioningSupport; import com.azure.resourcemanager.edgeorder.models.Specification; import java.io.IOException; +import java.time.Duration; import java.util.List; /** @@ -26,20 +31,47 @@ @Immutable public final class ConfigurationProperties extends CommonProperties { /* - * Specifications of the configuration + * Specifications of the configuration. */ private List specifications; /* - * Dimensions of the configuration + * Dimensions of the configuration. */ private Dimensions dimensions; /* - * list of filters supported for a product + * Determining nature of provisioning that the configuration supports. + */ + private ProvisioningSupport provisioningSupport; + + /* + * Different types of child configurations which exist for this configuration, these can be used to populate the + * child configuration filter. + */ + private List childConfigurationTypes; + + /* + * Child configurations present for the configuration after applying child configuration filter, grouped by the + * category name of the child configuration. + */ + private List groupedChildConfigurations; + + /* + * The Term Commitment Durations that are supported for a configuration. + */ + private List supportedTermCommitmentDurations; + + /* + * List of filters supported for a product. */ private List filterableProperties; + /* + * The entity responsible for fulfillment of the item at the given hierarchy level. + */ + private FulfillmentType fulfilledBy; + /* * Hierarchy information of a product. */ @@ -73,7 +105,7 @@ public final class ConfigurationProperties extends CommonProperties { /** * Creates an instance of ConfigurationProperties class. */ - public ConfigurationProperties() { + private ConfigurationProperties() { } /** @@ -95,7 +127,46 @@ public Dimensions dimensions() { } /** - * Get the filterableProperties property: list of filters supported for a product. + * Get the provisioningSupport property: Determining nature of provisioning that the configuration supports. + * + * @return the provisioningSupport value. + */ + public ProvisioningSupport provisioningSupport() { + return this.provisioningSupport; + } + + /** + * Get the childConfigurationTypes property: Different types of child configurations which exist for this + * configuration, these can be used to populate the child configuration filter. + * + * @return the childConfigurationTypes value. + */ + public List childConfigurationTypes() { + return this.childConfigurationTypes; + } + + /** + * Get the groupedChildConfigurations property: Child configurations present for the configuration after applying + * child configuration filter, grouped by the category name of the child configuration. + * + * @return the groupedChildConfigurations value. + */ + public List groupedChildConfigurations() { + return this.groupedChildConfigurations; + } + + /** + * Get the supportedTermCommitmentDurations property: The Term Commitment Durations that are supported for a + * configuration. + * + * @return the supportedTermCommitmentDurations value. + */ + public List supportedTermCommitmentDurations() { + return this.supportedTermCommitmentDurations; + } + + /** + * Get the filterableProperties property: List of filters supported for a product. * * @return the filterableProperties value. */ @@ -104,6 +175,16 @@ public List filterableProperties() { return this.filterableProperties; } + /** + * Get the fulfilledBy property: The entity responsible for fulfillment of the item at the given hierarchy level. + * + * @return the fulfilledBy value. + */ + @Override + public FulfillmentType fulfilledBy() { + return this.fulfilledBy; + } + /** * Get the hierarchyInformation property: Hierarchy information of a product. * @@ -177,6 +258,9 @@ public void validate() { if (dimensions() != null) { dimensions().validate(); } + if (groupedChildConfigurations() != null) { + groupedChildConfigurations().forEach(e -> e.validate()); + } if (description() != null) { description().validate(); } @@ -236,6 +320,8 @@ public static ConfigurationProperties fromJson(JsonReader jsonReader) throws IOE = AvailabilityInformation.fromJson(reader); } else if ("hierarchyInformation".equals(fieldName)) { deserializedConfigurationProperties.hierarchyInformation = HierarchyInformation.fromJson(reader); + } else if ("fulfilledBy".equals(fieldName)) { + deserializedConfigurationProperties.fulfilledBy = FulfillmentType.fromString(reader.getString()); } else if ("filterableProperties".equals(fieldName)) { List filterableProperties = reader.readArray(reader1 -> FilterableProperty.fromJson(reader1)); @@ -245,6 +331,22 @@ public static ConfigurationProperties fromJson(JsonReader jsonReader) throws IOE deserializedConfigurationProperties.specifications = specifications; } else if ("dimensions".equals(fieldName)) { deserializedConfigurationProperties.dimensions = Dimensions.fromJson(reader); + } else if ("provisioningSupport".equals(fieldName)) { + deserializedConfigurationProperties.provisioningSupport + = ProvisioningSupport.fromString(reader.getString()); + } else if ("childConfigurationTypes".equals(fieldName)) { + List childConfigurationTypes + = reader.readArray(reader1 -> ChildConfigurationType.fromString(reader1.getString())); + deserializedConfigurationProperties.childConfigurationTypes = childConfigurationTypes; + } else if ("groupedChildConfigurations".equals(fieldName)) { + List groupedChildConfigurations + = reader.readArray(reader1 -> GroupedChildConfigurations.fromJson(reader1)); + deserializedConfigurationProperties.groupedChildConfigurations = groupedChildConfigurations; + } else if ("supportedTermCommitmentDurations".equals(fieldName)) { + List supportedTermCommitmentDurations = reader.readArray( + reader1 -> reader1.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString()))); + deserializedConfigurationProperties.supportedTermCommitmentDurations + = supportedTermCommitmentDurations; } else { reader.skipChildren(); } diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/OperationInner.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/OperationInner.java index 02eba3c200d3..b31031ae4307 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/OperationInner.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/OperationInner.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.edgeorder.fluent.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; @@ -19,7 +19,7 @@ * * Details of a REST API operation, returned from the Resource Provider Operations API. */ -@Fluent +@Immutable public final class OperationInner 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. */ diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/OrderItemProperties.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/OrderItemProperties.java index 3acb1e0c46fc..a3ba03817409 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/OrderItemProperties.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/OrderItemProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.fluent.models; @@ -13,11 +13,12 @@ import com.azure.json.JsonWriter; import com.azure.resourcemanager.edgeorder.models.AddressDetails; import com.azure.resourcemanager.edgeorder.models.OrderItemDetails; +import com.azure.resourcemanager.edgeorder.models.ProvisioningState; import java.io.IOException; import java.time.OffsetDateTime; /** - * Represents order item details. + * Represents order item properties. */ @Fluent public final class OrderItemProperties implements JsonSerializable { @@ -27,20 +28,25 @@ public final class OrderItemProperties implements JsonSerializable CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("provisioningState".equals(fieldName)) { + deserializedOrderItemProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); } else { reader.skipChildren(); } diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/OrderItemResourceInner.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/OrderItemResourceInner.java index 7a48836ff9f3..3ee46105476f 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/OrderItemResourceInner.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/OrderItemResourceInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.fluent.models; @@ -13,22 +13,29 @@ import com.azure.json.JsonWriter; import com.azure.resourcemanager.edgeorder.models.AddressDetails; import com.azure.resourcemanager.edgeorder.models.OrderItemDetails; +import com.azure.resourcemanager.edgeorder.models.ProvisioningState; +import com.azure.resourcemanager.edgeorder.models.ResourceIdentity; import java.io.IOException; import java.time.OffsetDateTime; import java.util.Map; /** - * Represents order item contract. + * Represents order item resource. */ @Fluent public final class OrderItemResourceInner extends Resource { /* - * Order item properties + * Order item properties. */ private OrderItemProperties innerProperties = new OrderItemProperties(); /* - * Represents resource creation and update time + * Msi identity of the resource + */ + private ResourceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ private SystemData systemData; @@ -63,7 +70,27 @@ private OrderItemProperties innerProperties() { } /** - * Get the systemData property: Represents resource creation and update time. + * Get the identity property: Msi identity of the resource. + * + * @return the identity value. + */ + public ResourceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Msi identity of the resource. + * + * @param identity the identity value to set. + * @return the OrderItemResourceInner object itself. + */ + public OrderItemResourceInner withIdentity(ResourceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -197,6 +224,15 @@ public OrderItemResourceInner withOrderId(String orderId) { return this; } + /** + * Get the provisioningState property: Provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + /** * Validates the instance. * @@ -210,6 +246,9 @@ public void validate() { } else { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(OrderItemResourceInner.class); @@ -223,6 +262,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -255,6 +295,8 @@ public static OrderItemResourceInner fromJson(JsonReader jsonReader) throws IOEx deserializedOrderItemResourceInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedOrderItemResourceInner.innerProperties = OrderItemProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedOrderItemResourceInner.identity = ResourceIdentity.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedOrderItemResourceInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/OrderItemUpdateProperties.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/OrderItemUpdateProperties.java index db15c6b9ad5e..61f799aa5822 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/OrderItemUpdateProperties.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/OrderItemUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.fluent.models; @@ -9,6 +9,7 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.edgeorder.models.OrderItemDetailsUpdateParameter; import com.azure.resourcemanager.edgeorder.models.Preferences; import java.io.IOException; import java.util.List; @@ -33,6 +34,11 @@ public final class OrderItemUpdateProperties implements JsonSerializable notificationEmailList; + /* + * Represents order item details. + */ + private OrderItemDetailsUpdateParameter orderItemDetails; + /** * Creates an instance of OrderItemUpdateProperties class. */ @@ -99,6 +105,26 @@ public OrderItemUpdateProperties withNotificationEmailList(List notifica return this; } + /** + * Get the orderItemDetails property: Represents order item details. + * + * @return the orderItemDetails value. + */ + public OrderItemDetailsUpdateParameter orderItemDetails() { + return this.orderItemDetails; + } + + /** + * Set the orderItemDetails property: Represents order item details. + * + * @param orderItemDetails the orderItemDetails value to set. + * @return the OrderItemUpdateProperties object itself. + */ + public OrderItemUpdateProperties withOrderItemDetails(OrderItemDetailsUpdateParameter orderItemDetails) { + this.orderItemDetails = orderItemDetails; + return this; + } + /** * Validates the instance. * @@ -111,6 +137,9 @@ public void validate() { if (preferences() != null) { preferences().validate(); } + if (orderItemDetails() != null) { + orderItemDetails().validate(); + } } /** @@ -123,6 +152,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("preferences", this.preferences); jsonWriter.writeArrayField("notificationEmailList", this.notificationEmailList, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("orderItemDetails", this.orderItemDetails); return jsonWriter.writeEndObject(); } @@ -148,6 +178,9 @@ public static OrderItemUpdateProperties fromJson(JsonReader jsonReader) throws I } else if ("notificationEmailList".equals(fieldName)) { List notificationEmailList = reader.readArray(reader1 -> reader1.getString()); deserializedOrderItemUpdateProperties.notificationEmailList = notificationEmailList; + } else if ("orderItemDetails".equals(fieldName)) { + deserializedOrderItemUpdateProperties.orderItemDetails + = OrderItemDetailsUpdateParameter.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/OrderProperties.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/OrderProperties.java index 076f8b5f618e..8a054bb71cbb 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/OrderProperties.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/OrderProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.fluent.models; @@ -9,6 +9,7 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.edgeorder.models.OrderMode; import com.azure.resourcemanager.edgeorder.models.StageDetails; import java.io.IOException; import java.util.List; @@ -33,10 +34,15 @@ public final class OrderProperties implements JsonSerializable */ private List orderStageHistory; + /* + * Order mode. + */ + private OrderMode orderMode; + /** * Creates an instance of OrderProperties class. */ - public OrderProperties() { + private OrderProperties() { } /** @@ -66,6 +72,15 @@ public List orderStageHistory() { return this.orderStageHistory; } + /** + * Get the orderMode property: Order mode. + * + * @return the orderMode value. + */ + public OrderMode orderMode() { + return this.orderMode; + } + /** * Validates the instance. * @@ -112,6 +127,8 @@ public static OrderProperties fromJson(JsonReader jsonReader) throws IOException } else if ("orderStageHistory".equals(fieldName)) { List orderStageHistory = reader.readArray(reader1 -> StageDetails.fromJson(reader1)); deserializedOrderProperties.orderStageHistory = orderStageHistory; + } else if ("orderMode".equals(fieldName)) { + deserializedOrderProperties.orderMode = OrderMode.fromString(reader.getString()); } else { reader.skipChildren(); } diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/OrderResourceInner.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/OrderResourceInner.java index 866d97ed57a9..b755b3a31eab 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/OrderResourceInner.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/OrderResourceInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.fluent.models; @@ -11,6 +11,7 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.edgeorder.models.OrderMode; import com.azure.resourcemanager.edgeorder.models.StageDetails; import java.io.IOException; import java.util.List; @@ -21,12 +22,12 @@ @Immutable public final class OrderResourceInner extends ProxyResource { /* - * Order properties + * Order properties. */ - private OrderProperties innerProperties = new OrderProperties(); + private OrderProperties innerProperties; /* - * Represents resource creation and update time + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ private SystemData systemData; @@ -48,7 +49,7 @@ public final class OrderResourceInner extends ProxyResource { /** * Creates an instance of OrderResourceInner class. */ - public OrderResourceInner() { + private OrderResourceInner() { } /** @@ -61,7 +62,7 @@ private OrderProperties innerProperties() { } /** - * Get the systemData property: Represents resource creation and update time. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -126,6 +127,15 @@ public List orderStageHistory() { return this.innerProperties() == null ? null : this.innerProperties().orderStageHistory(); } + /** + * Get the orderMode property: Order mode. + * + * @return the orderMode value. + */ + public OrderMode orderMode() { + return this.innerProperties() == null ? null : this.innerProperties().orderMode(); + } + /** * Validates the instance. * diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/ProductFamiliesMetadataDetailsInner.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/ProductFamiliesMetadataDetailsInner.java index 1474ba68818b..82f3e97445fc 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/ProductFamiliesMetadataDetailsInner.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/ProductFamiliesMetadataDetailsInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.fluent.models; @@ -13,6 +13,7 @@ import com.azure.resourcemanager.edgeorder.models.CostInformation; import com.azure.resourcemanager.edgeorder.models.Description; import com.azure.resourcemanager.edgeorder.models.FilterableProperty; +import com.azure.resourcemanager.edgeorder.models.FulfillmentType; import com.azure.resourcemanager.edgeorder.models.HierarchyInformation; import com.azure.resourcemanager.edgeorder.models.ImageInformation; import com.azure.resourcemanager.edgeorder.models.ProductLine; @@ -27,14 +28,14 @@ public final class ProductFamiliesMetadataDetailsInner implements JsonSerializable { /* - * Product family properties + * Product family properties. */ private ProductFamilyProperties innerProperties; /** * Creates an instance of ProductFamiliesMetadataDetailsInner class. */ - public ProductFamiliesMetadataDetailsInner() { + private ProductFamiliesMetadataDetailsInner() { } /** @@ -65,22 +66,7 @@ public List resourceProviderDetails() { } /** - * Set the resourceProviderDetails property: Contains details related to resource provider. - * - * @param resourceProviderDetails the resourceProviderDetails value to set. - * @return the ProductFamiliesMetadataDetailsInner object itself. - */ - public ProductFamiliesMetadataDetailsInner - withResourceProviderDetails(List resourceProviderDetails) { - if (this.innerProperties() == null) { - this.innerProperties = new ProductFamilyProperties(); - } - this.innerProperties().withResourceProviderDetails(resourceProviderDetails); - return this; - } - - /** - * Get the filterableProperties property: list of filters supported for a product. + * Get the filterableProperties property: List of filters supported for a product. * * @return the filterableProperties value. */ @@ -142,6 +128,15 @@ public HierarchyInformation hierarchyInformation() { return this.innerProperties() == null ? null : this.innerProperties().hierarchyInformation(); } + /** + * Get the fulfilledBy property: The entity responsible for fulfillment of the item at the given hierarchy level. + * + * @return the fulfilledBy value. + */ + public FulfillmentType fulfilledBy() { + return this.innerProperties() == null ? null : this.innerProperties().fulfilledBy(); + } + /** * Validates the instance. * diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/ProductFamilyInner.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/ProductFamilyInner.java index d249e15b1355..6fa67e59af70 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/ProductFamilyInner.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/ProductFamilyInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.fluent.models; @@ -13,6 +13,7 @@ import com.azure.resourcemanager.edgeorder.models.CostInformation; import com.azure.resourcemanager.edgeorder.models.Description; import com.azure.resourcemanager.edgeorder.models.FilterableProperty; +import com.azure.resourcemanager.edgeorder.models.FulfillmentType; import com.azure.resourcemanager.edgeorder.models.HierarchyInformation; import com.azure.resourcemanager.edgeorder.models.ImageInformation; import com.azure.resourcemanager.edgeorder.models.ProductLine; @@ -26,14 +27,14 @@ @Immutable public final class ProductFamilyInner implements JsonSerializable { /* - * Properties of product family + * Properties of product family. */ private ProductFamilyProperties innerProperties; /** * Creates an instance of ProductFamilyInner class. */ - public ProductFamilyInner() { + private ProductFamilyInner() { } /** @@ -64,21 +65,7 @@ public List resourceProviderDetails() { } /** - * Set the resourceProviderDetails property: Contains details related to resource provider. - * - * @param resourceProviderDetails the resourceProviderDetails value to set. - * @return the ProductFamilyInner object itself. - */ - public ProductFamilyInner withResourceProviderDetails(List resourceProviderDetails) { - if (this.innerProperties() == null) { - this.innerProperties = new ProductFamilyProperties(); - } - this.innerProperties().withResourceProviderDetails(resourceProviderDetails); - return this; - } - - /** - * Get the filterableProperties property: list of filters supported for a product. + * Get the filterableProperties property: List of filters supported for a product. * * @return the filterableProperties value. */ @@ -140,6 +127,15 @@ public HierarchyInformation hierarchyInformation() { return this.innerProperties() == null ? null : this.innerProperties().hierarchyInformation(); } + /** + * Get the fulfilledBy property: The entity responsible for fulfillment of the item at the given hierarchy level. + * + * @return the fulfilledBy value. + */ + public FulfillmentType fulfilledBy() { + return this.innerProperties() == null ? null : this.innerProperties().fulfilledBy(); + } + /** * Validates the instance. * diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/ProductFamilyProperties.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/ProductFamilyProperties.java index 78b9fd90fcae..97a7c385773d 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/ProductFamilyProperties.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/ProductFamilyProperties.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.edgeorder.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -13,6 +13,7 @@ import com.azure.resourcemanager.edgeorder.models.CostInformation; import com.azure.resourcemanager.edgeorder.models.Description; import com.azure.resourcemanager.edgeorder.models.FilterableProperty; +import com.azure.resourcemanager.edgeorder.models.FulfillmentType; import com.azure.resourcemanager.edgeorder.models.HierarchyInformation; import com.azure.resourcemanager.edgeorder.models.ImageInformation; import com.azure.resourcemanager.edgeorder.models.ProductLine; @@ -23,23 +24,28 @@ /** * Properties of product family. */ -@Fluent +@Immutable public final class ProductFamilyProperties extends CommonProperties { /* - * List of product lines supported in the product family + * List of product lines supported in the product family. */ private List productLines; /* - * Contains details related to resource provider + * Contains details related to resource provider. */ private List resourceProviderDetails; /* - * list of filters supported for a product + * List of filters supported for a product. */ private List filterableProperties; + /* + * The entity responsible for fulfillment of the item at the given hierarchy level. + */ + private FulfillmentType fulfilledBy; + /* * Hierarchy information of a product. */ @@ -73,7 +79,7 @@ public final class ProductFamilyProperties extends CommonProperties { /** * Creates an instance of ProductFamilyProperties class. */ - public ProductFamilyProperties() { + private ProductFamilyProperties() { } /** @@ -95,24 +101,23 @@ public List resourceProviderDetails() { } /** - * Set the resourceProviderDetails property: Contains details related to resource provider. + * Get the filterableProperties property: List of filters supported for a product. * - * @param resourceProviderDetails the resourceProviderDetails value to set. - * @return the ProductFamilyProperties object itself. + * @return the filterableProperties value. */ - public ProductFamilyProperties withResourceProviderDetails(List resourceProviderDetails) { - this.resourceProviderDetails = resourceProviderDetails; - return this; + @Override + public List filterableProperties() { + return this.filterableProperties; } /** - * Get the filterableProperties property: list of filters supported for a product. + * Get the fulfilledBy property: The entity responsible for fulfillment of the item at the given hierarchy level. * - * @return the filterableProperties value. + * @return the fulfilledBy value. */ @Override - public List filterableProperties() { - return this.filterableProperties; + public FulfillmentType fulfilledBy() { + return this.fulfilledBy; } /** @@ -249,6 +254,8 @@ public static ProductFamilyProperties fromJson(JsonReader jsonReader) throws IOE = AvailabilityInformation.fromJson(reader); } else if ("hierarchyInformation".equals(fieldName)) { deserializedProductFamilyProperties.hierarchyInformation = HierarchyInformation.fromJson(reader); + } else if ("fulfilledBy".equals(fieldName)) { + deserializedProductFamilyProperties.fulfilledBy = FulfillmentType.fromString(reader.getString()); } else if ("filterableProperties".equals(fieldName)) { List filterableProperties = reader.readArray(reader1 -> FilterableProperty.fromJson(reader1)); diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/ProductLineProperties.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/ProductLineProperties.java index b0b9d677bd39..828868dba80a 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/ProductLineProperties.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/ProductLineProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.fluent.models; @@ -13,6 +13,7 @@ import com.azure.resourcemanager.edgeorder.models.CostInformation; import com.azure.resourcemanager.edgeorder.models.Description; import com.azure.resourcemanager.edgeorder.models.FilterableProperty; +import com.azure.resourcemanager.edgeorder.models.FulfillmentType; import com.azure.resourcemanager.edgeorder.models.HierarchyInformation; import com.azure.resourcemanager.edgeorder.models.ImageInformation; import com.azure.resourcemanager.edgeorder.models.Product; @@ -25,15 +26,20 @@ @Immutable public final class ProductLineProperties extends CommonProperties { /* - * List of products in the product line + * List of products in the product line. */ private List products; /* - * list of filters supported for a product + * List of filters supported for a product. */ private List filterableProperties; + /* + * The entity responsible for fulfillment of the item at the given hierarchy level. + */ + private FulfillmentType fulfilledBy; + /* * Hierarchy information of a product. */ @@ -67,7 +73,7 @@ public final class ProductLineProperties extends CommonProperties { /** * Creates an instance of ProductLineProperties class. */ - public ProductLineProperties() { + private ProductLineProperties() { } /** @@ -80,7 +86,7 @@ public List products() { } /** - * Get the filterableProperties property: list of filters supported for a product. + * Get the filterableProperties property: List of filters supported for a product. * * @return the filterableProperties value. */ @@ -89,6 +95,16 @@ public List filterableProperties() { return this.filterableProperties; } + /** + * Get the fulfilledBy property: The entity responsible for fulfillment of the item at the given hierarchy level. + * + * @return the fulfilledBy value. + */ + @Override + public FulfillmentType fulfilledBy() { + return this.fulfilledBy; + } + /** * Get the hierarchyInformation property: Hierarchy information of a product. * @@ -218,6 +234,8 @@ public static ProductLineProperties fromJson(JsonReader jsonReader) throws IOExc = AvailabilityInformation.fromJson(reader); } else if ("hierarchyInformation".equals(fieldName)) { deserializedProductLineProperties.hierarchyInformation = HierarchyInformation.fromJson(reader); + } else if ("fulfilledBy".equals(fieldName)) { + deserializedProductLineProperties.fulfilledBy = FulfillmentType.fromString(reader.getString()); } else if ("filterableProperties".equals(fieldName)) { List filterableProperties = reader.readArray(reader1 -> FilterableProperty.fromJson(reader1)); diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/ProductProperties.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/ProductProperties.java index ed0fb81ef0e5..b4fb15339fd3 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/ProductProperties.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/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.edgeorder.fluent.models; @@ -13,26 +13,32 @@ import com.azure.resourcemanager.edgeorder.models.CostInformation; import com.azure.resourcemanager.edgeorder.models.Description; import com.azure.resourcemanager.edgeorder.models.FilterableProperty; +import com.azure.resourcemanager.edgeorder.models.FulfillmentType; import com.azure.resourcemanager.edgeorder.models.HierarchyInformation; import com.azure.resourcemanager.edgeorder.models.ImageInformation; import java.io.IOException; import java.util.List; /** - * Properties of products. + * Properties of product. */ @Immutable public final class ProductProperties extends CommonProperties { /* - * List of configurations for the product + * List of configurations for the product. */ private List configurations; /* - * list of filters supported for a product + * List of filters supported for a product. */ private List filterableProperties; + /* + * The entity responsible for fulfillment of the item at the given hierarchy level. + */ + private FulfillmentType fulfilledBy; + /* * Hierarchy information of a product. */ @@ -66,7 +72,7 @@ public final class ProductProperties extends CommonProperties { /** * Creates an instance of ProductProperties class. */ - public ProductProperties() { + private ProductProperties() { } /** @@ -79,7 +85,7 @@ public List configurations() { } /** - * Get the filterableProperties property: list of filters supported for a product. + * Get the filterableProperties property: List of filters supported for a product. * * @return the filterableProperties value. */ @@ -88,6 +94,16 @@ public List filterableProperties() { return this.filterableProperties; } + /** + * Get the fulfilledBy property: The entity responsible for fulfillment of the item at the given hierarchy level. + * + * @return the fulfilledBy value. + */ + @Override + public FulfillmentType fulfilledBy() { + return this.fulfilledBy; + } + /** * Get the hierarchyInformation property: Hierarchy information of a product. * @@ -216,6 +232,8 @@ public static ProductProperties fromJson(JsonReader jsonReader) throws IOExcepti deserializedProductProperties.availabilityInformation = AvailabilityInformation.fromJson(reader); } else if ("hierarchyInformation".equals(fieldName)) { deserializedProductProperties.hierarchyInformation = HierarchyInformation.fromJson(reader); + } else if ("fulfilledBy".equals(fieldName)) { + deserializedProductProperties.fulfilledBy = FulfillmentType.fromString(reader.getString()); } else if ("filterableProperties".equals(fieldName)) { List filterableProperties = reader.readArray(reader1 -> FilterableProperty.fromJson(reader1)); diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/package-info.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/package-info.java index 365741573330..5202b3118451 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/models/package-info.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/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 EdgeOrderManagementClient. + * Package containing the inner data models for Edgeorder. * Edge Order API's. */ package com.azure.resourcemanager.edgeorder.fluent.models; diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/package-info.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/package-info.java index b8ead4c9c767..a465e89ce469 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/fluent/package-info.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/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 EdgeOrderManagementClient. + * Package containing the service clients for Edgeorder. * Edge Order API's. */ package com.azure.resourcemanager.edgeorder.fluent; diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/AddressResourceImpl.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/AddressResourceImpl.java index 236b2232e805..e0952056436d 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/AddressResourceImpl.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/AddressResourceImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.implementation; @@ -8,10 +8,12 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.edgeorder.fluent.models.AddressResourceInner; +import com.azure.resourcemanager.edgeorder.models.AddressClassification; import com.azure.resourcemanager.edgeorder.models.AddressResource; import com.azure.resourcemanager.edgeorder.models.AddressUpdateParameter; import com.azure.resourcemanager.edgeorder.models.AddressValidationStatus; import com.azure.resourcemanager.edgeorder.models.ContactDetails; +import com.azure.resourcemanager.edgeorder.models.ProvisioningState; import com.azure.resourcemanager.edgeorder.models.ShippingAddress; import java.util.Collections; import java.util.Map; @@ -19,7 +21,7 @@ public final class AddressResourceImpl implements AddressResource, AddressResource.Definition, AddressResource.Update { private AddressResourceInner innerObject; - private final com.azure.resourcemanager.edgeorder.EdgeOrderManager serviceManager; + private final com.azure.resourcemanager.edgeorder.EdgeorderManager serviceManager; public String id() { return this.innerModel().id(); @@ -50,6 +52,10 @@ public SystemData systemData() { return this.innerModel().systemData(); } + public AddressClassification addressClassification() { + return this.innerModel().addressClassification(); + } + public ShippingAddress shippingAddress() { return this.innerModel().shippingAddress(); } @@ -62,6 +68,10 @@ public AddressValidationStatus addressValidationStatus() { return this.innerModel().addressValidationStatus(); } + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -78,14 +88,14 @@ public AddressResourceInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.edgeorder.EdgeOrderManager manager() { + private com.azure.resourcemanager.edgeorder.EdgeorderManager manager() { return this.serviceManager; } - private String addressName; - private String resourceGroupName; + private String addressName; + private String updateIfMatch; private AddressUpdateParameter updateAddressUpdateParameter; @@ -97,19 +107,19 @@ public AddressResourceImpl withExistingResourceGroup(String resourceGroupName) { public AddressResource create() { this.innerObject = serviceManager.serviceClient() - .getResourceProviders() - .createAddress(addressName, resourceGroupName, this.innerModel(), Context.NONE); + .getAddressResources() + .create(resourceGroupName, addressName, this.innerModel(), Context.NONE); return this; } public AddressResource create(Context context) { this.innerObject = serviceManager.serviceClient() - .getResourceProviders() - .createAddress(addressName, resourceGroupName, this.innerModel(), context); + .getAddressResources() + .create(resourceGroupName, addressName, this.innerModel(), context); return this; } - AddressResourceImpl(String name, com.azure.resourcemanager.edgeorder.EdgeOrderManager serviceManager) { + AddressResourceImpl(String name, com.azure.resourcemanager.edgeorder.EdgeorderManager serviceManager) { this.innerObject = new AddressResourceInner(); this.serviceManager = serviceManager; this.addressName = name; @@ -123,29 +133,29 @@ public AddressResourceImpl update() { public AddressResource apply() { this.innerObject = serviceManager.serviceClient() - .getResourceProviders() - .updateAddress(addressName, resourceGroupName, updateAddressUpdateParameter, updateIfMatch, Context.NONE); + .getAddressResources() + .update(resourceGroupName, addressName, updateAddressUpdateParameter, updateIfMatch, Context.NONE); return this; } public AddressResource apply(Context context) { this.innerObject = serviceManager.serviceClient() - .getResourceProviders() - .updateAddress(addressName, resourceGroupName, updateAddressUpdateParameter, updateIfMatch, context); + .getAddressResources() + .update(resourceGroupName, addressName, updateAddressUpdateParameter, updateIfMatch, context); return this; } AddressResourceImpl(AddressResourceInner innerObject, - com.azure.resourcemanager.edgeorder.EdgeOrderManager serviceManager) { + com.azure.resourcemanager.edgeorder.EdgeorderManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.addressName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "addresses"); this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.addressName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "addresses"); } public AddressResource refresh() { this.innerObject = serviceManager.serviceClient() - .getResourceProviders() + .getAddressResources() .getByResourceGroupWithResponse(resourceGroupName, addressName, Context.NONE) .getValue(); return this; @@ -153,7 +163,7 @@ public AddressResource refresh() { public AddressResource refresh(Context context) { this.innerObject = serviceManager.serviceClient() - .getResourceProviders() + .getAddressResources() .getByResourceGroupWithResponse(resourceGroupName, addressName, context) .getValue(); return this; @@ -169,32 +179,37 @@ public AddressResourceImpl withRegion(String location) { return this; } - public AddressResourceImpl withContactDetails(ContactDetails contactDetails) { + public AddressResourceImpl withTags(Map tags) { if (isInCreateMode()) { - this.innerModel().withContactDetails(contactDetails); + this.innerModel().withTags(tags); return this; } else { - this.updateAddressUpdateParameter.withContactDetails(contactDetails); + this.updateAddressUpdateParameter.withTags(tags); return this; } } - public AddressResourceImpl withTags(Map tags) { + public AddressResourceImpl withAddressClassification(AddressClassification addressClassification) { + this.innerModel().withAddressClassification(addressClassification); + return this; + } + + public AddressResourceImpl withShippingAddress(ShippingAddress shippingAddress) { if (isInCreateMode()) { - this.innerModel().withTags(tags); + this.innerModel().withShippingAddress(shippingAddress); return this; } else { - this.updateAddressUpdateParameter.withTags(tags); + this.updateAddressUpdateParameter.withShippingAddress(shippingAddress); return this; } } - public AddressResourceImpl withShippingAddress(ShippingAddress shippingAddress) { + public AddressResourceImpl withContactDetails(ContactDetails contactDetails) { if (isInCreateMode()) { - this.innerModel().withShippingAddress(shippingAddress); + this.innerModel().withContactDetails(contactDetails); return this; } else { - this.updateAddressUpdateParameter.withShippingAddress(shippingAddress); + this.updateAddressUpdateParameter.withContactDetails(contactDetails); return this; } } diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/AddressResourcesClientImpl.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/AddressResourcesClientImpl.java new file mode 100644 index 000000000000..47e147b7cd40 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/AddressResourcesClientImpl.java @@ -0,0 +1,1685 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.edgeorder.fluent.AddressResourcesClient; +import com.azure.resourcemanager.edgeorder.fluent.models.AddressResourceInner; +import com.azure.resourcemanager.edgeorder.implementation.models.AddressResourceList; +import com.azure.resourcemanager.edgeorder.models.AddressUpdateParameter; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AddressResourcesClient. + */ +public final class AddressResourcesClientImpl implements AddressResourcesClient { + /** + * The proxy service used to perform REST calls. + */ + private final AddressResourcesService service; + + /** + * The service client containing this operation class. + */ + private final EdgeOrderClientImpl client; + + /** + * Initializes an instance of AddressResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AddressResourcesClientImpl(EdgeOrderClientImpl client) { + this.service + = RestProxy.create(AddressResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for EdgeOrderClientAddressResources to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "EdgeOrderClientAddre") + public interface AddressResourcesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("addressName") String addressName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("addressName") String addressName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("addressName") String addressName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AddressResourceInner addressResource, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("addressName") String addressName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AddressResourceInner addressResource, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}") + @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("addressName") String addressName, + @HeaderParam("If-Match") String ifMatch, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") AddressUpdateParameter addressUpdateParameter, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}") + @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("addressName") String addressName, + @HeaderParam("If-Match") String ifMatch, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") AddressUpdateParameter addressUpdateParameter, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}") + @ExpectedResponses({ 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("addressName") String addressName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}") + @ExpectedResponses({ 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("addressName") String addressName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @QueryParam("$skipToken") String skipToken, @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @QueryParam("$skipToken") String skipToken, @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/addresses") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, @QueryParam("$skipToken") String skipToken, + @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/addresses") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, @QueryParam("$skipToken") String skipToken, + @QueryParam("$top") Integer top, @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("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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get information about the specified address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified address along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String addressName) { + 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 (addressName == null) { + return Mono.error(new IllegalArgumentException("Parameter addressName 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, addressName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get information about the specified address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified address on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String addressName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, addressName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get information about the specified address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified address along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String addressName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (addressName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter addressName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, addressName, accept, context); + } + + /** + * Get information about the specified address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified address. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AddressResourceInner getByResourceGroup(String resourceGroupName, String addressName) { + return getByResourceGroupWithResponse(resourceGroupName, addressName, Context.NONE).getValue(); + } + + /** + * Create a new address with the specified parameters. Existing address cannot be updated with this API and should + * instead be updated with the Update address API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param addressResource Address details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return address Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String addressName, + AddressResourceInner addressResource) { + 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 (addressName == null) { + return Mono.error(new IllegalArgumentException("Parameter addressName is required and cannot be null.")); + } + if (addressResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter addressResource is required and cannot be null.")); + } else { + addressResource.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, addressName, contentType, accept, addressResource, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a new address with the specified parameters. Existing address cannot be updated with this API and should + * instead be updated with the Update address API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param addressResource Address details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return address Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createWithResponse(String resourceGroupName, String addressName, + AddressResourceInner addressResource) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (addressName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter addressName is required and cannot be null.")); + } + if (addressResource == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter addressResource is required and cannot be null.")); + } else { + addressResource.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, addressName, contentType, accept, addressResource, + Context.NONE); + } + + /** + * Create a new address with the specified parameters. Existing address cannot be updated with this API and should + * instead be updated with the Update address API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param addressResource Address details from 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 address Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createWithResponse(String resourceGroupName, String addressName, + AddressResourceInner addressResource, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (addressName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter addressName is required and cannot be null.")); + } + if (addressResource == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter addressResource is required and cannot be null.")); + } else { + addressResource.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, addressName, contentType, accept, addressResource, + context); + } + + /** + * Create a new address with the specified parameters. Existing address cannot be updated with this API and should + * instead be updated with the Update address API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param addressResource Address details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of address Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AddressResourceInner> + beginCreateAsync(String resourceGroupName, String addressName, AddressResourceInner addressResource) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, addressName, addressResource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AddressResourceInner.class, AddressResourceInner.class, this.client.getContext()); + } + + /** + * Create a new address with the specified parameters. Existing address cannot be updated with this API and should + * instead be updated with the Update address API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param addressResource Address details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of address Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AddressResourceInner> beginCreate(String resourceGroupName, + String addressName, AddressResourceInner addressResource) { + Response response = createWithResponse(resourceGroupName, addressName, addressResource); + return this.client.getLroResult(response, + AddressResourceInner.class, AddressResourceInner.class, Context.NONE); + } + + /** + * Create a new address with the specified parameters. Existing address cannot be updated with this API and should + * instead be updated with the Update address API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param addressResource Address details from request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of address Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AddressResourceInner> beginCreate(String resourceGroupName, + String addressName, AddressResourceInner addressResource, Context context) { + Response response = createWithResponse(resourceGroupName, addressName, addressResource, context); + return this.client.getLroResult(response, + AddressResourceInner.class, AddressResourceInner.class, context); + } + + /** + * Create a new address with the specified parameters. Existing address cannot be updated with this API and should + * instead be updated with the Update address API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param addressResource Address details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return address Resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String addressName, + AddressResourceInner addressResource) { + return beginCreateAsync(resourceGroupName, addressName, addressResource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new address with the specified parameters. Existing address cannot be updated with this API and should + * instead be updated with the Update address API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param addressResource Address details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return address Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AddressResourceInner create(String resourceGroupName, String addressName, + AddressResourceInner addressResource) { + return beginCreate(resourceGroupName, addressName, addressResource).getFinalResult(); + } + + /** + * Create a new address with the specified parameters. Existing address cannot be updated with this API and should + * instead be updated with the Update address API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param addressResource Address details from 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 address Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AddressResourceInner create(String resourceGroupName, String addressName, + AddressResourceInner addressResource, Context context) { + return beginCreate(resourceGroupName, addressName, addressResource, context).getFinalResult(); + } + + /** + * Update the properties of an existing address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param addressUpdateParameter Address update parameters from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the + * server matches this value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return address Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String addressName, + AddressUpdateParameter addressUpdateParameter, String ifMatch) { + 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 (addressName == null) { + return Mono.error(new IllegalArgumentException("Parameter addressName is required and cannot be null.")); + } + if (addressUpdateParameter == null) { + return Mono.error( + new IllegalArgumentException("Parameter addressUpdateParameter is required and cannot be null.")); + } else { + addressUpdateParameter.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, addressName, ifMatch, contentType, accept, + addressUpdateParameter, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update the properties of an existing address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param addressUpdateParameter Address update parameters from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the + * server matches this value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return address Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String addressName, + AddressUpdateParameter addressUpdateParameter, String ifMatch) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (addressName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter addressName is required and cannot be null.")); + } + if (addressUpdateParameter == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter addressUpdateParameter is required and cannot be null.")); + } else { + addressUpdateParameter.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, addressName, ifMatch, contentType, accept, + addressUpdateParameter, Context.NONE); + } + + /** + * Update the properties of an existing address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param addressUpdateParameter Address update parameters from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the + * server matches this value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return address Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String addressName, + AddressUpdateParameter addressUpdateParameter, String ifMatch, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (addressName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter addressName is required and cannot be null.")); + } + if (addressUpdateParameter == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter addressUpdateParameter is required and cannot be null.")); + } else { + addressUpdateParameter.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, addressName, ifMatch, contentType, accept, + addressUpdateParameter, context); + } + + /** + * Update the properties of an existing address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param addressUpdateParameter Address update parameters from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the + * server matches this value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 address Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AddressResourceInner> beginUpdateAsync( + String resourceGroupName, String addressName, AddressUpdateParameter addressUpdateParameter, String ifMatch) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, addressName, addressUpdateParameter, ifMatch); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AddressResourceInner.class, AddressResourceInner.class, this.client.getContext()); + } + + /** + * Update the properties of an existing address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param addressUpdateParameter Address update parameters from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of address Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AddressResourceInner> + beginUpdateAsync(String resourceGroupName, String addressName, AddressUpdateParameter addressUpdateParameter) { + final String ifMatch = null; + Mono>> mono + = updateWithResponseAsync(resourceGroupName, addressName, addressUpdateParameter, ifMatch); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AddressResourceInner.class, AddressResourceInner.class, this.client.getContext()); + } + + /** + * Update the properties of an existing address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param addressUpdateParameter Address update parameters from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the + * server matches this value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 address Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AddressResourceInner> beginUpdate(String resourceGroupName, + String addressName, AddressUpdateParameter addressUpdateParameter, String ifMatch) { + Response response + = updateWithResponse(resourceGroupName, addressName, addressUpdateParameter, ifMatch); + return this.client.getLroResult(response, + AddressResourceInner.class, AddressResourceInner.class, Context.NONE); + } + + /** + * Update the properties of an existing address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param addressUpdateParameter Address update parameters from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of address Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AddressResourceInner> beginUpdate(String resourceGroupName, + String addressName, AddressUpdateParameter addressUpdateParameter) { + final String ifMatch = null; + Response response + = updateWithResponse(resourceGroupName, addressName, addressUpdateParameter, ifMatch); + return this.client.getLroResult(response, + AddressResourceInner.class, AddressResourceInner.class, Context.NONE); + } + + /** + * Update the properties of an existing address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param addressUpdateParameter Address update parameters from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the + * server matches this value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 address Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AddressResourceInner> beginUpdate(String resourceGroupName, + String addressName, AddressUpdateParameter addressUpdateParameter, String ifMatch, Context context) { + Response response + = updateWithResponse(resourceGroupName, addressName, addressUpdateParameter, ifMatch, context); + return this.client.getLroResult(response, + AddressResourceInner.class, AddressResourceInner.class, context); + } + + /** + * Update the properties of an existing address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param addressUpdateParameter Address update parameters from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the + * server matches this value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return address Resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String addressName, + AddressUpdateParameter addressUpdateParameter, String ifMatch) { + return beginUpdateAsync(resourceGroupName, addressName, addressUpdateParameter, ifMatch).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the properties of an existing address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param addressUpdateParameter Address update parameters from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return address Resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String addressName, + AddressUpdateParameter addressUpdateParameter) { + final String ifMatch = null; + return beginUpdateAsync(resourceGroupName, addressName, addressUpdateParameter, ifMatch).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the properties of an existing address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param addressUpdateParameter Address update parameters from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return address Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AddressResourceInner update(String resourceGroupName, String addressName, + AddressUpdateParameter addressUpdateParameter) { + final String ifMatch = null; + return beginUpdate(resourceGroupName, addressName, addressUpdateParameter, ifMatch).getFinalResult(); + } + + /** + * Update the properties of an existing address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param addressUpdateParameter Address update parameters from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the + * server matches this value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return address Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AddressResourceInner update(String resourceGroupName, String addressName, + AddressUpdateParameter addressUpdateParameter, String ifMatch, Context context) { + return beginUpdate(resourceGroupName, addressName, addressUpdateParameter, ifMatch, context).getFinalResult(); + } + + /** + * Delete an address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 addressName) { + 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 (addressName == null) { + return Mono.error(new IllegalArgumentException("Parameter addressName 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, addressName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete an address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 addressName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (addressName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter addressName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, addressName, accept, Context.NONE); + } + + /** + * Delete an address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 addressName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (addressName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter addressName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, addressName, accept, context); + } + + /** + * Delete an address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 addressName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, addressName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete an address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 addressName) { + Response response = deleteWithResponse(resourceGroupName, addressName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete an address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 addressName, + Context context) { + Response response = deleteWithResponse(resourceGroupName, addressName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete an address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 addressName) { + return beginDeleteAsync(resourceGroupName, addressName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete an address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 addressName) { + beginDelete(resourceGroupName, addressName).getFinalResult(); + } + + /** + * Delete an address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 addressName, Context context) { + beginDelete(resourceGroupName, addressName, context).getFinalResult(); + } + + /** + * List all the addresses available under the given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter $filter is supported to filter based on shipping address properties. Filter supports only equals + * operation. + * @param skipToken $skipToken is supported on Get list of addresses, which provides the next page in the list of + * addresses. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return address Resource Collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + String filter, String skipToken, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, skipToken, top, 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 all the addresses available under the given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter $filter is supported to filter based on shipping address properties. Filter supports only equals + * operation. + * @param skipToken $skipToken is supported on Get list of addresses, which provides the next page in the list of + * addresses. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return address Resource Collection as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, + String skipToken, Integer top) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, skipToken, top), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List all the addresses available under the given 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 address Resource Collection as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String filter = null; + final String skipToken = null; + final Integer top = null; + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, skipToken, top), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List all the addresses available under the given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter $filter is supported to filter based on shipping address properties. Filter supports only equals + * operation. + * @param skipToken $skipToken is supported on Get list of addresses, which provides the next page in the list of + * addresses. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return address Resource Collection along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, String filter, + String skipToken, Integer top) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, skipToken, top, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List all the addresses available under the given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter $filter is supported to filter based on shipping address properties. Filter supports only equals + * operation. + * @param skipToken $skipToken is supported on Get list of addresses, which provides the next page in the list of + * addresses. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return address Resource Collection along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, String filter, + String skipToken, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, skipToken, top, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List all the addresses available under the given 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 address Resource Collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final String filter = null; + final String skipToken = null; + final Integer top = null; + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, filter, skipToken, top), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); + } + + /** + * List all the addresses available under the given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter $filter is supported to filter based on shipping address properties. Filter supports only equals + * operation. + * @param skipToken $skipToken is supported on Get list of addresses, which provides the next page in the list of + * addresses. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return address Resource Collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, String filter, + String skipToken, Integer top, Context context) { + return new PagedIterable<>( + () -> listByResourceGroupSinglePage(resourceGroupName, filter, skipToken, top, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); + } + + /** + * List all the addresses available under the subscription. + * + * @param filter $filter is supported to filter based on shipping address properties. Filter supports only equals + * operation. + * @param skipToken $skipToken is supported on Get list of addresses, which provides the next page in the list of + * addresses. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return address Resource Collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String filter, String skipToken, + Integer top) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), filter, skipToken, top, 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 all the addresses available under the subscription. + * + * @param filter $filter is supported to filter based on shipping address properties. Filter supports only equals + * operation. + * @param skipToken $skipToken is supported on Get list of addresses, which provides the next page in the list of + * addresses. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return address Resource Collection as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, String skipToken, Integer top) { + return new PagedFlux<>(() -> listSinglePageAsync(filter, skipToken, top), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List all the addresses available under the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return address Resource Collection as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String filter = null; + final String skipToken = null; + final Integer top = null; + return new PagedFlux<>(() -> listSinglePageAsync(filter, skipToken, top), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List all the addresses available under the subscription. + * + * @param filter $filter is supported to filter based on shipping address properties. Filter supports only equals + * operation. + * @param skipToken $skipToken is supported on Get list of addresses, which provides the next page in the list of + * addresses. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return address Resource Collection along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String filter, String skipToken, Integer top) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), filter, skipToken, top, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List all the addresses available under the subscription. + * + * @param filter $filter is supported to filter based on shipping address properties. Filter supports only equals + * operation. + * @param skipToken $skipToken is supported on Get list of addresses, which provides the next page in the list of + * addresses. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return address Resource Collection along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String filter, String skipToken, Integer top, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), filter, skipToken, top, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List all the addresses available under the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return address Resource Collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + final String skipToken = null; + final Integer top = null; + return new PagedIterable<>(() -> listSinglePage(filter, skipToken, top), + nextLink -> listBySubscriptionNextSinglePage(nextLink)); + } + + /** + * List all the addresses available under the subscription. + * + * @param filter $filter is supported to filter based on shipping address properties. Filter supports only equals + * operation. + * @param skipToken $skipToken is supported on Get list of addresses, which provides the next page in the list of + * addresses. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return address Resource Collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String filter, String skipToken, Integer top, Context context) { + return new PagedIterable<>(() -> listSinglePage(filter, skipToken, top, context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); + } + + /** + * 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 address Resource Collection along with {@link PagedResponse} on successful completion of {@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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 address Resource Collection along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + 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. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return address Resource Collection along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * 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 address Resource Collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 address Resource Collection along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + 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. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return address Resource Collection along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + 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); + } + + private static final ClientLogger LOGGER = new ClientLogger(AddressResourcesClientImpl.class); +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/AddressResourcesImpl.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/AddressResourcesImpl.java new file mode 100644 index 000000000000..88defac3a211 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/AddressResourcesImpl.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.edgeorder.fluent.AddressResourcesClient; +import com.azure.resourcemanager.edgeorder.fluent.models.AddressResourceInner; +import com.azure.resourcemanager.edgeorder.models.AddressResource; +import com.azure.resourcemanager.edgeorder.models.AddressResources; + +public final class AddressResourcesImpl implements AddressResources { + private static final ClientLogger LOGGER = new ClientLogger(AddressResourcesImpl.class); + + private final AddressResourcesClient innerClient; + + private final com.azure.resourcemanager.edgeorder.EdgeorderManager serviceManager; + + public AddressResourcesImpl(AddressResourcesClient innerClient, + com.azure.resourcemanager.edgeorder.EdgeorderManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String addressName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, addressName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AddressResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AddressResource getByResourceGroup(String resourceGroupName, String addressName) { + AddressResourceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, addressName); + if (inner != null) { + return new AddressResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String addressName) { + this.serviceClient().delete(resourceGroupName, addressName); + } + + public void delete(String resourceGroupName, String addressName, Context context) { + this.serviceClient().delete(resourceGroupName, addressName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AddressResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, String filter, String skipToken, + Integer top, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, filter, skipToken, top, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AddressResourceImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AddressResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String filter, String skipToken, Integer top, Context context) { + PagedIterable inner = this.serviceClient().list(filter, skipToken, top, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AddressResourceImpl(inner1, this.manager())); + } + + public AddressResource getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String addressName = ResourceManagerUtils.getValueFromIdByName(id, "addresses"); + if (addressName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'addresses'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, addressName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String addressName = ResourceManagerUtils.getValueFromIdByName(id, "addresses"); + if (addressName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'addresses'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, addressName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String addressName = ResourceManagerUtils.getValueFromIdByName(id, "addresses"); + if (addressName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'addresses'.", id))); + } + this.delete(resourceGroupName, addressName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String addressName = ResourceManagerUtils.getValueFromIdByName(id, "addresses"); + if (addressName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'addresses'.", id))); + } + this.delete(resourceGroupName, addressName, context); + } + + private AddressResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.edgeorder.EdgeorderManager manager() { + return this.serviceManager; + } + + public AddressResourceImpl define(String name) { + return new AddressResourceImpl(name, this.manager()); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/ConfigurationImpl.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/ConfigurationImpl.java index 79c2860530e7..24e6788b4a3d 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/ConfigurationImpl.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/ConfigurationImpl.java @@ -1,29 +1,34 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.implementation; import com.azure.resourcemanager.edgeorder.fluent.models.ConfigurationInner; import com.azure.resourcemanager.edgeorder.models.AvailabilityInformation; +import com.azure.resourcemanager.edgeorder.models.ChildConfigurationType; import com.azure.resourcemanager.edgeorder.models.Configuration; import com.azure.resourcemanager.edgeorder.models.CostInformation; import com.azure.resourcemanager.edgeorder.models.Description; import com.azure.resourcemanager.edgeorder.models.Dimensions; import com.azure.resourcemanager.edgeorder.models.FilterableProperty; +import com.azure.resourcemanager.edgeorder.models.FulfillmentType; +import com.azure.resourcemanager.edgeorder.models.GroupedChildConfigurations; import com.azure.resourcemanager.edgeorder.models.HierarchyInformation; import com.azure.resourcemanager.edgeorder.models.ImageInformation; +import com.azure.resourcemanager.edgeorder.models.ProvisioningSupport; import com.azure.resourcemanager.edgeorder.models.Specification; +import java.time.Duration; import java.util.Collections; import java.util.List; public final class ConfigurationImpl implements Configuration { private ConfigurationInner innerObject; - private final com.azure.resourcemanager.edgeorder.EdgeOrderManager serviceManager; + private final com.azure.resourcemanager.edgeorder.EdgeorderManager serviceManager; ConfigurationImpl(ConfigurationInner innerObject, - com.azure.resourcemanager.edgeorder.EdgeOrderManager serviceManager) { + com.azure.resourcemanager.edgeorder.EdgeorderManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -41,6 +46,37 @@ public Dimensions dimensions() { return this.innerModel().dimensions(); } + public ProvisioningSupport provisioningSupport() { + return this.innerModel().provisioningSupport(); + } + + public List childConfigurationTypes() { + List inner = this.innerModel().childConfigurationTypes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List groupedChildConfigurations() { + List inner = this.innerModel().groupedChildConfigurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List supportedTermCommitmentDurations() { + List inner = this.innerModel().supportedTermCommitmentDurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + public List filterableProperties() { List inner = this.innerModel().filterableProperties(); if (inner != null) { @@ -79,11 +115,15 @@ public HierarchyInformation hierarchyInformation() { return this.innerModel().hierarchyInformation(); } + public FulfillmentType fulfilledBy() { + return this.innerModel().fulfilledBy(); + } + public ConfigurationInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.edgeorder.EdgeOrderManager manager() { + private com.azure.resourcemanager.edgeorder.EdgeorderManager manager() { return this.serviceManager; } } diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/EdgeOrderManagementClientBuilder.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/EdgeOrderClientBuilder.java similarity index 64% rename from sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/EdgeOrderManagementClientBuilder.java rename to sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/EdgeOrderClientBuilder.java index c7d34f434705..0e4a83182d8f 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/EdgeOrderManagementClientBuilder.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/EdgeOrderClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.implementation; @@ -15,39 +15,39 @@ import java.time.Duration; /** - * A builder for creating a new instance of the EdgeOrderManagementClientImpl type. + * A builder for creating a new instance of the EdgeOrderClientImpl type. */ -@ServiceClientBuilder(serviceClients = { EdgeOrderManagementClientImpl.class }) -public final class EdgeOrderManagementClientBuilder { +@ServiceClientBuilder(serviceClients = { EdgeOrderClientImpl.class }) +public final class EdgeOrderClientBuilder { /* - * 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 EdgeOrderManagementClientBuilder. + * @param endpoint the endpoint value. + * @return the EdgeOrderClientBuilder. */ - public EdgeOrderManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; + public EdgeOrderClientBuilder 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 EdgeOrderManagementClientBuilder. + * @param subscriptionId the subscriptionId value. + * @return the EdgeOrderClientBuilder. */ - public EdgeOrderManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + public EdgeOrderClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; return this; } @@ -60,9 +60,9 @@ public EdgeOrderManagementClientBuilder endpoint(String endpoint) { * Sets The environment to connect to. * * @param environment the environment value. - * @return the EdgeOrderManagementClientBuilder. + * @return the EdgeOrderClientBuilder. */ - public EdgeOrderManagementClientBuilder environment(AzureEnvironment environment) { + public EdgeOrderClientBuilder environment(AzureEnvironment environment) { this.environment = environment; return this; } @@ -76,9 +76,9 @@ public EdgeOrderManagementClientBuilder environment(AzureEnvironment environment * Sets The HTTP pipeline to send requests through. * * @param pipeline the pipeline value. - * @return the EdgeOrderManagementClientBuilder. + * @return the EdgeOrderClientBuilder. */ - public EdgeOrderManagementClientBuilder pipeline(HttpPipeline pipeline) { + public EdgeOrderClientBuilder pipeline(HttpPipeline pipeline) { this.pipeline = pipeline; return this; } @@ -92,9 +92,9 @@ public EdgeOrderManagementClientBuilder pipeline(HttpPipeline pipeline) { * Sets The default poll interval for long-running operation. * * @param defaultPollInterval the defaultPollInterval value. - * @return the EdgeOrderManagementClientBuilder. + * @return the EdgeOrderClientBuilder. */ - public EdgeOrderManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + public EdgeOrderClientBuilder defaultPollInterval(Duration defaultPollInterval) { this.defaultPollInterval = defaultPollInterval; return this; } @@ -108,19 +108,19 @@ public EdgeOrderManagementClientBuilder defaultPollInterval(Duration defaultPoll * Sets The serializer to serialize an object into a string. * * @param serializerAdapter the serializerAdapter value. - * @return the EdgeOrderManagementClientBuilder. + * @return the EdgeOrderClientBuilder. */ - public EdgeOrderManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + public EdgeOrderClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { this.serializerAdapter = serializerAdapter; return this; } /** - * Builds an instance of EdgeOrderManagementClientImpl with the provided parameters. + * Builds an instance of EdgeOrderClientImpl with the provided parameters. * - * @return an instance of EdgeOrderManagementClientImpl. + * @return an instance of EdgeOrderClientImpl. */ - public EdgeOrderManagementClientImpl buildClient() { + public EdgeOrderClientImpl 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 EdgeOrderManagementClientImpl buildClient() { SerializerAdapter localSerializerAdapter = (serializerAdapter != null) ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); - EdgeOrderManagementClientImpl client = new EdgeOrderManagementClientImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + EdgeOrderClientImpl client = new EdgeOrderClientImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/EdgeOrderManagementClientImpl.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/EdgeOrderClientImpl.java similarity index 61% rename from sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/EdgeOrderManagementClientImpl.java rename to sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/EdgeOrderClientImpl.java index 03991a410bba..a7ee3c9054b4 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/EdgeOrderManagementClientImpl.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/EdgeOrderClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.implementation; @@ -15,16 +15,24 @@ 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.edgeorder.fluent.EdgeOrderManagementClient; -import com.azure.resourcemanager.edgeorder.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.edgeorder.fluent.AddressResourcesClient; +import com.azure.resourcemanager.edgeorder.fluent.EdgeOrderClient; +import com.azure.resourcemanager.edgeorder.fluent.OperationsClient; +import com.azure.resourcemanager.edgeorder.fluent.OrderItemResourcesClient; +import com.azure.resourcemanager.edgeorder.fluent.OrderResourcesClient; +import com.azure.resourcemanager.edgeorder.fluent.OrdersOperationGroupsClient; +import com.azure.resourcemanager.edgeorder.fluent.ProductsAndConfigurationsOperationGroupsClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -35,31 +43,17 @@ import reactor.core.publisher.Mono; /** - * Initializes a new instance of the EdgeOrderManagementClientImpl type. + * Initializes a new instance of the EdgeOrderClientImpl type. */ -@ServiceClient(builder = EdgeOrderManagementClientBuilder.class) -public final class EdgeOrderManagementClientImpl implements EdgeOrderManagementClient { +@ServiceClient(builder = EdgeOrderClientBuilder.class) +public final class EdgeOrderClientImpl implements EdgeOrderClient { /** - * 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. */ @@ -68,12 +62,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -81,6 +75,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. */ @@ -124,38 +132,113 @@ public Duration getDefaultPollInterval() { } /** - * The ResourceProvidersClient object to access its operations. + * The OperationsClient object to access its operations. + */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** + * The AddressResourcesClient object to access its operations. + */ + private final AddressResourcesClient addressResources; + + /** + * Gets the AddressResourcesClient object to access its operations. + * + * @return the AddressResourcesClient object. + */ + public AddressResourcesClient getAddressResources() { + return this.addressResources; + } + + /** + * The OrderItemResourcesClient object to access its operations. + */ + private final OrderItemResourcesClient orderItemResources; + + /** + * Gets the OrderItemResourcesClient object to access its operations. + * + * @return the OrderItemResourcesClient object. + */ + public OrderItemResourcesClient getOrderItemResources() { + return this.orderItemResources; + } + + /** + * The OrderResourcesClient object to access its operations. + */ + private final OrderResourcesClient orderResources; + + /** + * Gets the OrderResourcesClient object to access its operations. + * + * @return the OrderResourcesClient object. + */ + public OrderResourcesClient getOrderResources() { + return this.orderResources; + } + + /** + * The ProductsAndConfigurationsOperationGroupsClient object to access its operations. */ - private final ResourceProvidersClient resourceProviders; + private final ProductsAndConfigurationsOperationGroupsClient productsAndConfigurationsOperationGroups; /** - * Gets the ResourceProvidersClient object to access its operations. + * Gets the ProductsAndConfigurationsOperationGroupsClient object to access its operations. * - * @return the ResourceProvidersClient object. + * @return the ProductsAndConfigurationsOperationGroupsClient object. */ - public ResourceProvidersClient getResourceProviders() { - return this.resourceProviders; + public ProductsAndConfigurationsOperationGroupsClient getProductsAndConfigurationsOperationGroups() { + return this.productsAndConfigurationsOperationGroups; } /** - * Initializes an instance of EdgeOrderManagementClient client. + * The OrdersOperationGroupsClient object to access its operations. + */ + private final OrdersOperationGroupsClient ordersOperationGroups; + + /** + * Gets the OrdersOperationGroupsClient object to access its operations. + * + * @return the OrdersOperationGroupsClient object. + */ + public OrdersOperationGroupsClient getOrdersOperationGroups() { + return this.ordersOperationGroups; + } + + /** + * Initializes an instance of EdgeOrderClient 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. */ - EdgeOrderManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + EdgeOrderClientImpl(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.apiVersion = "2021-12-01"; - this.resourceProviders = new ResourceProvidersClientImpl(this); + this.subscriptionId = subscriptionId; + this.apiVersion = "2024-02-01"; + this.operations = new OperationsClientImpl(this); + this.addressResources = new AddressResourcesClientImpl(this); + this.orderItemResources = new OrderItemResourcesClientImpl(this); + this.orderResources = new OrderResourcesClientImpl(this); + this.productsAndConfigurationsOperationGroups = new ProductsAndConfigurationsOperationGroupsClientImpl(this); + this.ordersOperationGroups = new OrdersOperationGroupsClientImpl(this); } /** @@ -195,6 +278,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. * @@ -284,5 +384,5 @@ public Mono getBodyAsString(Charset charset) { } } - private static final ClientLogger LOGGER = new ClientLogger(EdgeOrderManagementClientImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(EdgeOrderClientImpl.class); } diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OperationImpl.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OperationImpl.java index 611c937efb15..c0369748c5d5 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OperationImpl.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/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.edgeorder.implementation; @@ -13,9 +13,9 @@ public final class OperationImpl implements Operation { private OperationInner innerObject; - private final com.azure.resourcemanager.edgeorder.EdgeOrderManager serviceManager; + private final com.azure.resourcemanager.edgeorder.EdgeorderManager serviceManager; - OperationImpl(OperationInner innerObject, com.azure.resourcemanager.edgeorder.EdgeOrderManager serviceManager) { + OperationImpl(OperationInner innerObject, com.azure.resourcemanager.edgeorder.EdgeorderManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -44,7 +44,7 @@ public OperationInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.edgeorder.EdgeOrderManager manager() { + private com.azure.resourcemanager.edgeorder.EdgeorderManager manager() { return this.serviceManager; } } diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OperationsClientImpl.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..e152050b42b2 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OperationsClientImpl.java @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.edgeorder.fluent.OperationsClient; +import com.azure.resourcemanager.edgeorder.fluent.models.OperationInner; +import com.azure.resourcemanager.edgeorder.implementation.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public final class OperationsClientImpl implements OperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final OperationsService service; + + /** + * The service client containing this operation class. + */ + private final EdgeOrderClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(EdgeOrderClientImpl client) { + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for EdgeOrderClientOperations to be used by the proxy service to perform + * REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "EdgeOrderClientOpera") + public interface OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.EdgeOrder/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + 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.EdgeOrder/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" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@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 listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the operations for the provider. + * + * @throws 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}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List the operations for the provider. + * + * @throws 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 listSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + 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); + } + + /** + * 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + 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); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * 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} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .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) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + 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. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + 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); + } + + private static final ClientLogger LOGGER = new ClientLogger(OperationsClientImpl.class); +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OperationsImpl.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OperationsImpl.java new file mode 100644 index 000000000000..44000fc8f071 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OperationsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.edgeorder.fluent.OperationsClient; +import com.azure.resourcemanager.edgeorder.fluent.models.OperationInner; +import com.azure.resourcemanager.edgeorder.models.Operation; +import com.azure.resourcemanager.edgeorder.models.Operations; + +public final class OperationsImpl implements Operations { + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.edgeorder.EdgeorderManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, + com.azure.resourcemanager.edgeorder.EdgeorderManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.edgeorder.EdgeorderManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OrderItemResourceImpl.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OrderItemResourceImpl.java index ad7ec8fdb3ee..2253cce59bd9 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OrderItemResourceImpl.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OrderItemResourceImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.implementation; @@ -13,9 +13,12 @@ import com.azure.resourcemanager.edgeorder.models.AddressDetails; import com.azure.resourcemanager.edgeorder.models.CancellationReason; import com.azure.resourcemanager.edgeorder.models.OrderItemDetails; +import com.azure.resourcemanager.edgeorder.models.OrderItemDetailsUpdateParameter; import com.azure.resourcemanager.edgeorder.models.OrderItemResource; import com.azure.resourcemanager.edgeorder.models.OrderItemUpdateParameter; import com.azure.resourcemanager.edgeorder.models.Preferences; +import com.azure.resourcemanager.edgeorder.models.ProvisioningState; +import com.azure.resourcemanager.edgeorder.models.ResourceIdentity; import com.azure.resourcemanager.edgeorder.models.ReturnOrderItemDetails; import java.time.OffsetDateTime; import java.util.Collections; @@ -26,7 +29,7 @@ public final class OrderItemResourceImpl implements OrderItemResource, OrderItemResource.Definition, OrderItemResource.Update { private OrderItemResourceInner innerObject; - private final com.azure.resourcemanager.edgeorder.EdgeOrderManager serviceManager; + private final com.azure.resourcemanager.edgeorder.EdgeorderManager serviceManager; public String id() { return this.innerModel().id(); @@ -53,6 +56,10 @@ public Map tags() { } } + public ResourceIdentity identity() { + return this.innerModel().identity(); + } + public SystemData systemData() { return this.innerModel().systemData(); } @@ -73,6 +80,10 @@ public String orderId() { return this.innerModel().orderId(); } + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -89,14 +100,14 @@ public OrderItemResourceInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.edgeorder.EdgeOrderManager manager() { + private com.azure.resourcemanager.edgeorder.EdgeorderManager manager() { return this.serviceManager; } - private String orderItemName; - private String resourceGroupName; + private String orderItemName; + private String updateIfMatch; private OrderItemUpdateParameter updateOrderItemUpdateParameter; @@ -108,19 +119,19 @@ public OrderItemResourceImpl withExistingResourceGroup(String resourceGroupName) public OrderItemResource create() { this.innerObject = serviceManager.serviceClient() - .getResourceProviders() - .createOrderItem(orderItemName, resourceGroupName, this.innerModel(), Context.NONE); + .getOrderItemResources() + .create(resourceGroupName, orderItemName, this.innerModel(), Context.NONE); return this; } public OrderItemResource create(Context context) { this.innerObject = serviceManager.serviceClient() - .getResourceProviders() - .createOrderItem(orderItemName, resourceGroupName, this.innerModel(), context); + .getOrderItemResources() + .create(resourceGroupName, orderItemName, this.innerModel(), context); return this; } - OrderItemResourceImpl(String name, com.azure.resourcemanager.edgeorder.EdgeOrderManager serviceManager) { + OrderItemResourceImpl(String name, com.azure.resourcemanager.edgeorder.EdgeorderManager serviceManager) { this.innerObject = new OrderItemResourceInner(); this.serviceManager = serviceManager; this.orderItemName = name; @@ -134,32 +145,31 @@ public OrderItemResourceImpl update() { public OrderItemResource apply() { this.innerObject = serviceManager.serviceClient() - .getResourceProviders() - .updateOrderItem(orderItemName, resourceGroupName, updateOrderItemUpdateParameter, updateIfMatch, - Context.NONE); + .getOrderItemResources() + .update(resourceGroupName, orderItemName, updateOrderItemUpdateParameter, updateIfMatch, Context.NONE); return this; } public OrderItemResource apply(Context context) { this.innerObject = serviceManager.serviceClient() - .getResourceProviders() - .updateOrderItem(orderItemName, resourceGroupName, updateOrderItemUpdateParameter, updateIfMatch, context); + .getOrderItemResources() + .update(resourceGroupName, orderItemName, updateOrderItemUpdateParameter, updateIfMatch, context); return this; } OrderItemResourceImpl(OrderItemResourceInner innerObject, - com.azure.resourcemanager.edgeorder.EdgeOrderManager serviceManager) { + com.azure.resourcemanager.edgeorder.EdgeorderManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.orderItemName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "orderItems"); this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.orderItemName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "orderItems"); } public OrderItemResource refresh() { String localExpand = null; this.innerObject = serviceManager.serviceClient() - .getResourceProviders() - .getOrderItemByNameWithResponse(orderItemName, resourceGroupName, localExpand, Context.NONE) + .getOrderItemResources() + .getByResourceGroupWithResponse(resourceGroupName, orderItemName, localExpand, Context.NONE) .getValue(); return this; } @@ -167,28 +177,28 @@ public OrderItemResource refresh() { public OrderItemResource refresh(Context context) { String localExpand = null; this.innerObject = serviceManager.serviceClient() - .getResourceProviders() - .getOrderItemByNameWithResponse(orderItemName, resourceGroupName, localExpand, context) + .getOrderItemResources() + .getByResourceGroupWithResponse(resourceGroupName, orderItemName, localExpand, context) .getValue(); return this; } - public Response cancelOrderItemWithResponse(CancellationReason cancellationReason, Context context) { - return serviceManager.resourceProviders() - .cancelOrderItemWithResponse(orderItemName, resourceGroupName, cancellationReason, context); + public Response cancelWithResponse(CancellationReason cancellationReason, Context context) { + return serviceManager.orderItemResources() + .cancelWithResponse(resourceGroupName, orderItemName, cancellationReason, context); } - public void cancelOrderItem(CancellationReason cancellationReason) { - serviceManager.resourceProviders().cancelOrderItem(orderItemName, resourceGroupName, cancellationReason); + public void cancel(CancellationReason cancellationReason) { + serviceManager.orderItemResources().cancel(resourceGroupName, orderItemName, cancellationReason); } public void returnOrderItem(ReturnOrderItemDetails returnOrderItemDetails) { - serviceManager.resourceProviders().returnOrderItem(orderItemName, resourceGroupName, returnOrderItemDetails); + serviceManager.orderItemResources().returnOrderItem(resourceGroupName, orderItemName, returnOrderItemDetails); } public void returnOrderItem(ReturnOrderItemDetails returnOrderItemDetails, Context context) { - serviceManager.resourceProviders() - .returnOrderItem(orderItemName, resourceGroupName, returnOrderItemDetails, context); + serviceManager.orderItemResources() + .returnOrderItem(resourceGroupName, orderItemName, returnOrderItemDetails, context); } public OrderItemResourceImpl withRegion(Region location) { @@ -206,11 +216,6 @@ public OrderItemResourceImpl withOrderItemDetails(OrderItemDetails orderItemDeta return this; } - public OrderItemResourceImpl withAddressDetails(AddressDetails addressDetails) { - this.innerModel().withAddressDetails(addressDetails); - return this; - } - public OrderItemResourceImpl withOrderId(String orderId) { this.innerModel().withOrderId(orderId); return this; @@ -226,6 +231,21 @@ public OrderItemResourceImpl withTags(Map tags) { } } + public OrderItemResourceImpl withIdentity(ResourceIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateOrderItemUpdateParameter.withIdentity(identity); + return this; + } + } + + public OrderItemResourceImpl withAddressDetails(AddressDetails addressDetails) { + this.innerModel().withAddressDetails(addressDetails); + return this; + } + public OrderItemResourceImpl withForwardAddress(AddressProperties forwardAddress) { this.updateOrderItemUpdateParameter.withForwardAddress(forwardAddress); return this; @@ -241,6 +261,11 @@ public OrderItemResourceImpl withNotificationEmailList(List notification return this; } + public OrderItemResourceImpl withOrderItemDetails(OrderItemDetailsUpdateParameter orderItemDetails) { + this.updateOrderItemUpdateParameter.withOrderItemDetails(orderItemDetails); + return this; + } + public OrderItemResourceImpl withIfMatch(String ifMatch) { this.updateIfMatch = ifMatch; return this; diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OrderItemResourcesClientImpl.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OrderItemResourcesClientImpl.java new file mode 100644 index 000000000000..050fcbd7d77a --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OrderItemResourcesClientImpl.java @@ -0,0 +1,2147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.edgeorder.fluent.OrderItemResourcesClient; +import com.azure.resourcemanager.edgeorder.fluent.models.OrderItemResourceInner; +import com.azure.resourcemanager.edgeorder.implementation.models.OrderItemResourceList; +import com.azure.resourcemanager.edgeorder.models.CancellationReason; +import com.azure.resourcemanager.edgeorder.models.OrderItemUpdateParameter; +import com.azure.resourcemanager.edgeorder.models.ReturnOrderItemDetails; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OrderItemResourcesClient. + */ +public final class OrderItemResourcesClientImpl implements OrderItemResourcesClient { + /** + * The proxy service used to perform REST calls. + */ + private final OrderItemResourcesService service; + + /** + * The service client containing this operation class. + */ + private final EdgeOrderClientImpl client; + + /** + * Initializes an instance of OrderItemResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OrderItemResourcesClientImpl(EdgeOrderClientImpl client) { + this.service = RestProxy.create(OrderItemResourcesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for EdgeOrderClientOrderItemResources to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "EdgeOrderClientOrder") + public interface OrderItemResourcesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("orderItemName") String orderItemName, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("orderItemName") String orderItemName, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("orderItemName") String orderItemName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") OrderItemResourceInner orderItemResource, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("orderItemName") String orderItemName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") OrderItemResourceInner orderItemResource, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}") + @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("orderItemName") String orderItemName, + @HeaderParam("If-Match") String ifMatch, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") OrderItemUpdateParameter orderItemUpdateParameter, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}") + @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("orderItemName") String orderItemName, + @HeaderParam("If-Match") String ifMatch, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") OrderItemUpdateParameter orderItemUpdateParameter, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}") + @ExpectedResponses({ 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("orderItemName") String orderItemName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}") + @ExpectedResponses({ 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("orderItemName") String orderItemName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @QueryParam("$expand") String expand, @QueryParam("$skipToken") String skipToken, + @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @QueryParam("$expand") String expand, @QueryParam("$skipToken") String skipToken, + @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, @QueryParam("$expand") String expand, + @QueryParam("$skipToken") String skipToken, @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, @QueryParam("$expand") String expand, + @QueryParam("$skipToken") String skipToken, @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/cancel") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> cancel(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("orderItemName") String orderItemName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CancellationReason cancellationReason, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/cancel") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response cancelSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("orderItemName") String orderItemName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CancellationReason cancellationReason, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> returnOrderItem(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("orderItemName") String orderItemName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ReturnOrderItemDetails returnOrderItemDetails, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response returnOrderItemSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("orderItemName") String orderItemName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ReturnOrderItemDetails returnOrderItemDetails, 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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get an order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param expand $expand is supported on parent device details, device details, forward shipping details and reverse + * shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for + * order item provides details on the devices of the product, Device Details for order item provides details on the + * devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and + * reverse shipping details respectively. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 order item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String orderItemName, String expand) { + 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 (orderItemName == null) { + return Mono.error(new IllegalArgumentException("Parameter orderItemName 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, orderItemName, expand, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get an order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 order item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String orderItemName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, orderItemName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get an order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param expand $expand is supported on parent device details, device details, forward shipping details and reverse + * shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for + * order item provides details on the devices of the product, Device Details for order item provides details on the + * devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and + * reverse shipping details respectively. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 order item along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String orderItemName, String expand, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (orderItemName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter orderItemName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, orderItemName, expand, accept, context); + } + + /** + * Get an order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 order item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrderItemResourceInner getByResourceGroup(String resourceGroupName, String orderItemName) { + final String expand = null; + return getByResourceGroupWithResponse(resourceGroupName, orderItemName, expand, Context.NONE).getValue(); + } + + /** + * Create an order item. Existing order item cannot be updated with this api and should instead be updated with the + * Update order item + * API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param orderItemResource Order item details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents order item resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String orderItemName, + OrderItemResourceInner orderItemResource) { + 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 (orderItemName == null) { + return Mono.error(new IllegalArgumentException("Parameter orderItemName is required and cannot be null.")); + } + if (orderItemResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter orderItemResource is required and cannot be null.")); + } else { + orderItemResource.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, orderItemName, contentType, accept, + orderItemResource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create an order item. Existing order item cannot be updated with this api and should instead be updated with the + * Update order item + * API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param orderItemResource Order item details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents order item resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createWithResponse(String resourceGroupName, String orderItemName, + OrderItemResourceInner orderItemResource) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (orderItemName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter orderItemName is required and cannot be null.")); + } + if (orderItemResource == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter orderItemResource is required and cannot be null.")); + } else { + orderItemResource.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, orderItemName, contentType, accept, orderItemResource, + Context.NONE); + } + + /** + * Create an order item. Existing order item cannot be updated with this api and should instead be updated with the + * Update order item + * API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param orderItemResource Order item details from 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 represents order item resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createWithResponse(String resourceGroupName, String orderItemName, + OrderItemResourceInner orderItemResource, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (orderItemName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter orderItemName is required and cannot be null.")); + } + if (orderItemResource == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter orderItemResource is required and cannot be null.")); + } else { + orderItemResource.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, orderItemName, contentType, accept, orderItemResource, + context); + } + + /** + * Create an order item. Existing order item cannot be updated with this api and should instead be updated with the + * Update order item + * API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param orderItemResource Order item details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of represents order item resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OrderItemResourceInner> + beginCreateAsync(String resourceGroupName, String orderItemName, OrderItemResourceInner orderItemResource) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, orderItemName, orderItemResource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OrderItemResourceInner.class, OrderItemResourceInner.class, + this.client.getContext()); + } + + /** + * Create an order item. Existing order item cannot be updated with this api and should instead be updated with the + * Update order item + * API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param orderItemResource Order item details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents order item resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OrderItemResourceInner> beginCreate(String resourceGroupName, + String orderItemName, OrderItemResourceInner orderItemResource) { + Response response = createWithResponse(resourceGroupName, orderItemName, orderItemResource); + return this.client.getLroResult(response, + OrderItemResourceInner.class, OrderItemResourceInner.class, Context.NONE); + } + + /** + * Create an order item. Existing order item cannot be updated with this api and should instead be updated with the + * Update order item + * API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param orderItemResource Order item details from request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents order item resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OrderItemResourceInner> beginCreate(String resourceGroupName, + String orderItemName, OrderItemResourceInner orderItemResource, Context context) { + Response response + = createWithResponse(resourceGroupName, orderItemName, orderItemResource, context); + return this.client.getLroResult(response, + OrderItemResourceInner.class, OrderItemResourceInner.class, context); + } + + /** + * Create an order item. Existing order item cannot be updated with this api and should instead be updated with the + * Update order item + * API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param orderItemResource Order item details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents order item resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String orderItemName, + OrderItemResourceInner orderItemResource) { + return beginCreateAsync(resourceGroupName, orderItemName, orderItemResource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create an order item. Existing order item cannot be updated with this api and should instead be updated with the + * Update order item + * API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param orderItemResource Order item details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents order item resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrderItemResourceInner create(String resourceGroupName, String orderItemName, + OrderItemResourceInner orderItemResource) { + return beginCreate(resourceGroupName, orderItemName, orderItemResource).getFinalResult(); + } + + /** + * Create an order item. Existing order item cannot be updated with this api and should instead be updated with the + * Update order item + * API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param orderItemResource Order item details from 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 represents order item resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrderItemResourceInner create(String resourceGroupName, String orderItemName, + OrderItemResourceInner orderItemResource, Context context) { + return beginCreate(resourceGroupName, orderItemName, orderItemResource, context).getFinalResult(); + } + + /** + * Update the properties of an existing order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param orderItemUpdateParameter Order item update parameters from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the order on the + * server matches this value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents order item resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String orderItemName, + OrderItemUpdateParameter orderItemUpdateParameter, String ifMatch) { + 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 (orderItemName == null) { + return Mono.error(new IllegalArgumentException("Parameter orderItemName is required and cannot be null.")); + } + if (orderItemUpdateParameter == null) { + return Mono.error( + new IllegalArgumentException("Parameter orderItemUpdateParameter is required and cannot be null.")); + } else { + orderItemUpdateParameter.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, orderItemName, ifMatch, contentType, accept, + orderItemUpdateParameter, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update the properties of an existing order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param orderItemUpdateParameter Order item update parameters from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the order on the + * server matches this value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents order item resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String orderItemName, + OrderItemUpdateParameter orderItemUpdateParameter, String ifMatch) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (orderItemName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter orderItemName is required and cannot be null.")); + } + if (orderItemUpdateParameter == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Parameter orderItemUpdateParameter is required and cannot be null.")); + } else { + orderItemUpdateParameter.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, orderItemName, ifMatch, contentType, accept, + orderItemUpdateParameter, Context.NONE); + } + + /** + * Update the properties of an existing order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param orderItemUpdateParameter Order item update parameters from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the order on the + * server matches this value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents order item resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String orderItemName, + OrderItemUpdateParameter orderItemUpdateParameter, String ifMatch, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (orderItemName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter orderItemName is required and cannot be null.")); + } + if (orderItemUpdateParameter == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Parameter orderItemUpdateParameter is required and cannot be null.")); + } else { + orderItemUpdateParameter.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, orderItemName, ifMatch, contentType, accept, + orderItemUpdateParameter, context); + } + + /** + * Update the properties of an existing order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param orderItemUpdateParameter Order item update parameters from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the order on the + * server matches this value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 represents order item resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OrderItemResourceInner> beginUpdateAsync( + String resourceGroupName, String orderItemName, OrderItemUpdateParameter orderItemUpdateParameter, + String ifMatch) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, orderItemName, orderItemUpdateParameter, ifMatch); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OrderItemResourceInner.class, OrderItemResourceInner.class, + this.client.getContext()); + } + + /** + * Update the properties of an existing order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param orderItemUpdateParameter Order item update parameters from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of represents order item resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OrderItemResourceInner> beginUpdateAsync( + String resourceGroupName, String orderItemName, OrderItemUpdateParameter orderItemUpdateParameter) { + final String ifMatch = null; + Mono>> mono + = updateWithResponseAsync(resourceGroupName, orderItemName, orderItemUpdateParameter, ifMatch); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OrderItemResourceInner.class, OrderItemResourceInner.class, + this.client.getContext()); + } + + /** + * Update the properties of an existing order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param orderItemUpdateParameter Order item update parameters from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the order on the + * server matches this value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 represents order item resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OrderItemResourceInner> beginUpdate(String resourceGroupName, + String orderItemName, OrderItemUpdateParameter orderItemUpdateParameter, String ifMatch) { + Response response + = updateWithResponse(resourceGroupName, orderItemName, orderItemUpdateParameter, ifMatch); + return this.client.getLroResult(response, + OrderItemResourceInner.class, OrderItemResourceInner.class, Context.NONE); + } + + /** + * Update the properties of an existing order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param orderItemUpdateParameter Order item update parameters from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents order item resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OrderItemResourceInner> beginUpdate(String resourceGroupName, + String orderItemName, OrderItemUpdateParameter orderItemUpdateParameter) { + final String ifMatch = null; + Response response + = updateWithResponse(resourceGroupName, orderItemName, orderItemUpdateParameter, ifMatch); + return this.client.getLroResult(response, + OrderItemResourceInner.class, OrderItemResourceInner.class, Context.NONE); + } + + /** + * Update the properties of an existing order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param orderItemUpdateParameter Order item update parameters from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the order on the + * server matches this value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 represents order item resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OrderItemResourceInner> beginUpdate(String resourceGroupName, + String orderItemName, OrderItemUpdateParameter orderItemUpdateParameter, String ifMatch, Context context) { + Response response + = updateWithResponse(resourceGroupName, orderItemName, orderItemUpdateParameter, ifMatch, context); + return this.client.getLroResult(response, + OrderItemResourceInner.class, OrderItemResourceInner.class, context); + } + + /** + * Update the properties of an existing order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param orderItemUpdateParameter Order item update parameters from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the order on the + * server matches this value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents order item resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String orderItemName, + OrderItemUpdateParameter orderItemUpdateParameter, String ifMatch) { + return beginUpdateAsync(resourceGroupName, orderItemName, orderItemUpdateParameter, ifMatch).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the properties of an existing order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param orderItemUpdateParameter Order item update parameters from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents order item resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String orderItemName, + OrderItemUpdateParameter orderItemUpdateParameter) { + final String ifMatch = null; + return beginUpdateAsync(resourceGroupName, orderItemName, orderItemUpdateParameter, ifMatch).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the properties of an existing order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param orderItemUpdateParameter Order item update parameters from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents order item resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrderItemResourceInner update(String resourceGroupName, String orderItemName, + OrderItemUpdateParameter orderItemUpdateParameter) { + final String ifMatch = null; + return beginUpdate(resourceGroupName, orderItemName, orderItemUpdateParameter, ifMatch).getFinalResult(); + } + + /** + * Update the properties of an existing order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param orderItemUpdateParameter Order item update parameters from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the order on the + * server matches this value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents order item resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrderItemResourceInner update(String resourceGroupName, String orderItemName, + OrderItemUpdateParameter orderItemUpdateParameter, String ifMatch, Context context) { + return beginUpdate(resourceGroupName, orderItemName, orderItemUpdateParameter, ifMatch, context) + .getFinalResult(); + } + + /** + * Delete an order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 orderItemName) { + 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 (orderItemName == null) { + return Mono.error(new IllegalArgumentException("Parameter orderItemName 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, orderItemName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete an order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 orderItemName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (orderItemName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter orderItemName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, orderItemName, accept, Context.NONE); + } + + /** + * Delete an order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 orderItemName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (orderItemName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter orderItemName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, orderItemName, accept, context); + } + + /** + * Delete an order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 orderItemName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, orderItemName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete an order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 orderItemName) { + Response response = deleteWithResponse(resourceGroupName, orderItemName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete an order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 orderItemName, + Context context) { + Response response = deleteWithResponse(resourceGroupName, orderItemName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete an order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 orderItemName) { + return beginDeleteAsync(resourceGroupName, orderItemName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete an order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 orderItemName) { + beginDelete(resourceGroupName, orderItemName).getFinalResult(); + } + + /** + * Delete an order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 orderItemName, Context context) { + beginDelete(resourceGroupName, orderItemName, context).getFinalResult(); + } + + /** + * List order items at resource group level. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter $filter is supported to filter based on order id and order Item Type. Filter supports only equals + * operation. + * @param expand $expand is supported on parent device details, device details, forward shipping details and reverse + * shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for + * order item provides details on the devices of the product, Device Details for order item provides details on the + * devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and + * reverse shipping details respectively. + * @param skipToken $skipToken is supported on Get list of order items, which provides the next page in the list of + * order items. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of order items along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + String filter, String expand, String skipToken, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, expand, skipToken, top, 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 order items at resource group level. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter $filter is supported to filter based on order id and order Item Type. Filter supports only equals + * operation. + * @param expand $expand is supported on parent device details, device details, forward shipping details and reverse + * shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for + * order item provides details on the devices of the product, Device Details for order item provides details on the + * devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and + * reverse shipping details respectively. + * @param skipToken $skipToken is supported on Get list of order items, which provides the next page in the list of + * order items. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of order items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, + String expand, String skipToken, Integer top) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand, skipToken, top), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List order items at resource group level. + * + * @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 list of order items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String filter = null; + final String expand = null; + final String skipToken = null; + final Integer top = null; + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand, skipToken, top), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List order items at resource group level. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter $filter is supported to filter based on order id and order Item Type. Filter supports only equals + * operation. + * @param expand $expand is supported on parent device details, device details, forward shipping details and reverse + * shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for + * order item provides details on the devices of the product, Device Details for order item provides details on the + * devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and + * reverse shipping details respectively. + * @param skipToken $skipToken is supported on Get list of order items, which provides the next page in the list of + * order items. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of order items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, String filter, + String expand, String skipToken, Integer top) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, filter, expand, skipToken, + top, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List order items at resource group level. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter $filter is supported to filter based on order id and order Item Type. Filter supports only equals + * operation. + * @param expand $expand is supported on parent device details, device details, forward shipping details and reverse + * shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for + * order item provides details on the devices of the product, Device Details for order item provides details on the + * devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and + * reverse shipping details respectively. + * @param skipToken $skipToken is supported on Get list of order items, which provides the next page in the list of + * order items. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of order items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, String filter, + String expand, String skipToken, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, expand, skipToken, top, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List order items at resource group level. + * + * @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 list of order items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final String filter = null; + final String expand = null; + final String skipToken = null; + final Integer top = null; + return new PagedIterable<>( + () -> listByResourceGroupSinglePage(resourceGroupName, filter, expand, skipToken, top), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); + } + + /** + * List order items at resource group level. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter $filter is supported to filter based on order id and order Item Type. Filter supports only equals + * operation. + * @param expand $expand is supported on parent device details, device details, forward shipping details and reverse + * shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for + * order item provides details on the devices of the product, Device Details for order item provides details on the + * devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and + * reverse shipping details respectively. + * @param skipToken $skipToken is supported on Get list of order items, which provides the next page in the list of + * order items. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of order items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, String filter, + String expand, String skipToken, Integer top, Context context) { + return new PagedIterable<>( + () -> listByResourceGroupSinglePage(resourceGroupName, filter, expand, skipToken, top, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); + } + + /** + * List order items at subscription level. + * + * @param filter $filter is supported to filter based on order id and order Item Type. Filter supports only equals + * operation. + * @param expand $expand is supported on parent device details, device details, forward shipping details and reverse + * shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for + * order item provides details on the devices of the product, Device Details for order item provides details on the + * devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and + * reverse shipping details respectively. + * @param skipToken $skipToken is supported on Get list of order items, which provides the next page in the list of + * order items. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of order items along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String filter, String expand, + String skipToken, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), filter, expand, skipToken, top, 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 order items at subscription level. + * + * @param filter $filter is supported to filter based on order id and order Item Type. Filter supports only equals + * operation. + * @param expand $expand is supported on parent device details, device details, forward shipping details and reverse + * shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for + * order item provides details on the devices of the product, Device Details for order item provides details on the + * devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and + * reverse shipping details respectively. + * @param skipToken $skipToken is supported on Get list of order items, which provides the next page in the list of + * order items. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of order items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, String expand, String skipToken, Integer top) { + return new PagedFlux<>(() -> listSinglePageAsync(filter, expand, skipToken, top), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List order items at subscription level. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of order items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String filter = null; + final String expand = null; + final String skipToken = null; + final Integer top = null; + return new PagedFlux<>(() -> listSinglePageAsync(filter, expand, skipToken, top), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List order items at subscription level. + * + * @param filter $filter is supported to filter based on order id and order Item Type. Filter supports only equals + * operation. + * @param expand $expand is supported on parent device details, device details, forward shipping details and reverse + * shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for + * order item provides details on the devices of the product, Device Details for order item provides details on the + * devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and + * reverse shipping details respectively. + * @param skipToken $skipToken is supported on Get list of order items, which provides the next page in the list of + * order items. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of order items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String filter, String expand, String skipToken, + Integer top) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), filter, expand, skipToken, top, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List order items at subscription level. + * + * @param filter $filter is supported to filter based on order id and order Item Type. Filter supports only equals + * operation. + * @param expand $expand is supported on parent device details, device details, forward shipping details and reverse + * shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for + * order item provides details on the devices of the product, Device Details for order item provides details on the + * devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and + * reverse shipping details respectively. + * @param skipToken $skipToken is supported on Get list of order items, which provides the next page in the list of + * order items. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of order items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String filter, String expand, String skipToken, + Integer top, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), filter, expand, skipToken, top, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List order items at subscription level. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of order items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + final String expand = null; + final String skipToken = null; + final Integer top = null; + return new PagedIterable<>(() -> listSinglePage(filter, expand, skipToken, top), + nextLink -> listBySubscriptionNextSinglePage(nextLink)); + } + + /** + * List order items at subscription level. + * + * @param filter $filter is supported to filter based on order id and order Item Type. Filter supports only equals + * operation. + * @param expand $expand is supported on parent device details, device details, forward shipping details and reverse + * shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for + * order item provides details on the devices of the product, Device Details for order item provides details on the + * devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and + * reverse shipping details respectively. + * @param skipToken $skipToken is supported on Get list of order items, which provides the next page in the list of + * order items. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of order items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String filter, String expand, String skipToken, Integer top, + Context context) { + return new PagedIterable<>(() -> listSinglePage(filter, expand, skipToken, top, context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); + } + + /** + * Cancel order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param cancellationReason Reason for cancellation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> cancelWithResponseAsync(String resourceGroupName, String orderItemName, + CancellationReason cancellationReason) { + 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 (orderItemName == null) { + return Mono.error(new IllegalArgumentException("Parameter orderItemName is required and cannot be null.")); + } + if (cancellationReason == null) { + return Mono + .error(new IllegalArgumentException("Parameter cancellationReason is required and cannot be null.")); + } else { + cancellationReason.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.cancel(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, orderItemName, contentType, accept, + cancellationReason, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Cancel order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param cancellationReason Reason for cancellation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cancelAsync(String resourceGroupName, String orderItemName, + CancellationReason cancellationReason) { + return cancelWithResponseAsync(resourceGroupName, orderItemName, cancellationReason) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Cancel order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param cancellationReason Reason for cancellation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response cancelWithResponse(String resourceGroupName, String orderItemName, + CancellationReason cancellationReason, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (orderItemName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter orderItemName is required and cannot be null.")); + } + if (cancellationReason == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter cancellationReason is required and cannot be null.")); + } else { + cancellationReason.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.cancelSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, orderItemName, contentType, accept, cancellationReason, + context); + } + + /** + * Cancel order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param cancellationReason Reason for cancellation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 cancel(String resourceGroupName, String orderItemName, CancellationReason cancellationReason) { + cancelWithResponse(resourceGroupName, orderItemName, cancellationReason, Context.NONE); + } + + /** + * Return order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param returnOrderItemDetails Return order item details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> returnOrderItemWithResponseAsync(String resourceGroupName, + String orderItemName, ReturnOrderItemDetails returnOrderItemDetails) { + 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 (orderItemName == null) { + return Mono.error(new IllegalArgumentException("Parameter orderItemName is required and cannot be null.")); + } + if (returnOrderItemDetails == null) { + return Mono.error( + new IllegalArgumentException("Parameter returnOrderItemDetails is required and cannot be null.")); + } else { + returnOrderItemDetails.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.returnOrderItem(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, orderItemName, contentType, accept, + returnOrderItemDetails, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Return order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param returnOrderItemDetails Return order item details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response returnOrderItemWithResponse(String resourceGroupName, String orderItemName, + ReturnOrderItemDetails returnOrderItemDetails) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (orderItemName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter orderItemName is required and cannot be null.")); + } + if (returnOrderItemDetails == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter returnOrderItemDetails is required and cannot be null.")); + } else { + returnOrderItemDetails.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.returnOrderItemSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, orderItemName, contentType, accept, + returnOrderItemDetails, Context.NONE); + } + + /** + * Return order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param returnOrderItemDetails Return order item details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response returnOrderItemWithResponse(String resourceGroupName, String orderItemName, + ReturnOrderItemDetails returnOrderItemDetails, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (orderItemName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter orderItemName is required and cannot be null.")); + } + if (returnOrderItemDetails == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter returnOrderItemDetails is required and cannot be null.")); + } else { + returnOrderItemDetails.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.returnOrderItemSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, orderItemName, contentType, accept, + returnOrderItemDetails, context); + } + + /** + * Return order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param returnOrderItemDetails Return order item details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginReturnOrderItemAsync(String resourceGroupName, String orderItemName, + ReturnOrderItemDetails returnOrderItemDetails) { + Mono>> mono + = returnOrderItemWithResponseAsync(resourceGroupName, orderItemName, returnOrderItemDetails); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Return order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param returnOrderItemDetails Return order item details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginReturnOrderItem(String resourceGroupName, String orderItemName, + ReturnOrderItemDetails returnOrderItemDetails) { + Response response + = returnOrderItemWithResponse(resourceGroupName, orderItemName, returnOrderItemDetails); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Return order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param returnOrderItemDetails Return order item details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginReturnOrderItem(String resourceGroupName, String orderItemName, + ReturnOrderItemDetails returnOrderItemDetails, Context context) { + Response response + = returnOrderItemWithResponse(resourceGroupName, orderItemName, returnOrderItemDetails, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Return order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param returnOrderItemDetails Return order item details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono returnOrderItemAsync(String resourceGroupName, String orderItemName, + ReturnOrderItemDetails returnOrderItemDetails) { + return beginReturnOrderItemAsync(resourceGroupName, orderItemName, returnOrderItemDetails).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Return order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param returnOrderItemDetails Return order item details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void returnOrderItem(String resourceGroupName, String orderItemName, + ReturnOrderItemDetails returnOrderItemDetails) { + beginReturnOrderItem(resourceGroupName, orderItemName, returnOrderItemDetails).getFinalResult(); + } + + /** + * Return order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param returnOrderItemDetails Return order item details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void returnOrderItem(String resourceGroupName, String orderItemName, + ReturnOrderItemDetails returnOrderItemDetails, Context context) { + beginReturnOrderItem(resourceGroupName, orderItemName, returnOrderItemDetails, context).getFinalResult(); + } + + /** + * 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 list of order items along with {@link PagedResponse} on successful completion of {@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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 list of order items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + 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. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of order items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * 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 list of order items along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 list of order items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + 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. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of order items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + 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); + } + + private static final ClientLogger LOGGER = new ClientLogger(OrderItemResourcesClientImpl.class); +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OrderItemResourcesImpl.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OrderItemResourcesImpl.java new file mode 100644 index 000000000000..d958349edc8b --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OrderItemResourcesImpl.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.edgeorder.fluent.OrderItemResourcesClient; +import com.azure.resourcemanager.edgeorder.fluent.models.OrderItemResourceInner; +import com.azure.resourcemanager.edgeorder.models.CancellationReason; +import com.azure.resourcemanager.edgeorder.models.OrderItemResource; +import com.azure.resourcemanager.edgeorder.models.OrderItemResources; +import com.azure.resourcemanager.edgeorder.models.ReturnOrderItemDetails; + +public final class OrderItemResourcesImpl implements OrderItemResources { + private static final ClientLogger LOGGER = new ClientLogger(OrderItemResourcesImpl.class); + + private final OrderItemResourcesClient innerClient; + + private final com.azure.resourcemanager.edgeorder.EdgeorderManager serviceManager; + + public OrderItemResourcesImpl(OrderItemResourcesClient innerClient, + com.azure.resourcemanager.edgeorder.EdgeorderManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String orderItemName, + String expand, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, orderItemName, expand, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new OrderItemResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public OrderItemResource getByResourceGroup(String resourceGroupName, String orderItemName) { + OrderItemResourceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, orderItemName); + if (inner != null) { + return new OrderItemResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String orderItemName) { + this.serviceClient().delete(resourceGroupName, orderItemName); + } + + public void delete(String resourceGroupName, String orderItemName, Context context) { + this.serviceClient().delete(resourceGroupName, orderItemName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OrderItemResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, String filter, String expand, + String skipToken, Integer top, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, filter, expand, skipToken, top, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OrderItemResourceImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OrderItemResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String filter, String expand, String skipToken, Integer top, + Context context) { + PagedIterable inner + = this.serviceClient().list(filter, expand, skipToken, top, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OrderItemResourceImpl(inner1, this.manager())); + } + + public Response cancelWithResponse(String resourceGroupName, String orderItemName, + CancellationReason cancellationReason, Context context) { + return this.serviceClient().cancelWithResponse(resourceGroupName, orderItemName, cancellationReason, context); + } + + public void cancel(String resourceGroupName, String orderItemName, CancellationReason cancellationReason) { + this.serviceClient().cancel(resourceGroupName, orderItemName, cancellationReason); + } + + public void returnOrderItem(String resourceGroupName, String orderItemName, + ReturnOrderItemDetails returnOrderItemDetails) { + this.serviceClient().returnOrderItem(resourceGroupName, orderItemName, returnOrderItemDetails); + } + + public void returnOrderItem(String resourceGroupName, String orderItemName, + ReturnOrderItemDetails returnOrderItemDetails, Context context) { + this.serviceClient().returnOrderItem(resourceGroupName, orderItemName, returnOrderItemDetails, context); + } + + public OrderItemResource getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String orderItemName = ResourceManagerUtils.getValueFromIdByName(id, "orderItems"); + if (orderItemName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'orderItems'.", id))); + } + String localExpand = null; + return this.getByResourceGroupWithResponse(resourceGroupName, orderItemName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String orderItemName = ResourceManagerUtils.getValueFromIdByName(id, "orderItems"); + if (orderItemName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'orderItems'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, orderItemName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String orderItemName = ResourceManagerUtils.getValueFromIdByName(id, "orderItems"); + if (orderItemName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'orderItems'.", id))); + } + this.delete(resourceGroupName, orderItemName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String orderItemName = ResourceManagerUtils.getValueFromIdByName(id, "orderItems"); + if (orderItemName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'orderItems'.", id))); + } + this.delete(resourceGroupName, orderItemName, context); + } + + private OrderItemResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.edgeorder.EdgeorderManager manager() { + return this.serviceManager; + } + + public OrderItemResourceImpl define(String name) { + return new OrderItemResourceImpl(name, this.manager()); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OrderResourceImpl.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OrderResourceImpl.java index 883fc1a1fab9..26d92a865ccc 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OrderResourceImpl.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OrderResourceImpl.java @@ -1,11 +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.edgeorder.implementation; import com.azure.core.management.SystemData; import com.azure.resourcemanager.edgeorder.fluent.models.OrderResourceInner; +import com.azure.resourcemanager.edgeorder.models.OrderMode; import com.azure.resourcemanager.edgeorder.models.OrderResource; import com.azure.resourcemanager.edgeorder.models.StageDetails; import java.util.Collections; @@ -14,10 +15,10 @@ public final class OrderResourceImpl implements OrderResource { private OrderResourceInner innerObject; - private final com.azure.resourcemanager.edgeorder.EdgeOrderManager serviceManager; + private final com.azure.resourcemanager.edgeorder.EdgeorderManager serviceManager; OrderResourceImpl(OrderResourceInner innerObject, - com.azure.resourcemanager.edgeorder.EdgeOrderManager serviceManager) { + com.azure.resourcemanager.edgeorder.EdgeorderManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -60,11 +61,15 @@ public List orderStageHistory() { } } + public OrderMode orderMode() { + return this.innerModel().orderMode(); + } + public OrderResourceInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.edgeorder.EdgeOrderManager manager() { + private com.azure.resourcemanager.edgeorder.EdgeorderManager manager() { return this.serviceManager; } } diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OrderResourcesClientImpl.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OrderResourcesClientImpl.java new file mode 100644 index 000000000000..507b0a223d4a --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OrderResourcesClientImpl.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.edgeorder.fluent.OrderResourcesClient; +import com.azure.resourcemanager.edgeorder.fluent.models.OrderResourceInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OrderResourcesClient. + */ +public final class OrderResourcesClientImpl implements OrderResourcesClient { + /** + * The proxy service used to perform REST calls. + */ + private final OrderResourcesService service; + + /** + * The service client containing this operation class. + */ + private final EdgeOrderClientImpl client; + + /** + * Initializes an instance of OrderResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OrderResourcesClientImpl(EdgeOrderClientImpl client) { + this.service + = RestProxy.create(OrderResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for EdgeOrderClientOrderResources to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "EdgeOrderClientOrder") + public interface OrderResourcesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName}") + @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("location") String location, + @PathParam("orderName") String orderName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName}") + @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("location") String location, + @PathParam("orderName") String orderName, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get an order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param orderName The name of the order. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 order along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String location, + String orderName) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (orderName == null) { + return Mono.error(new IllegalArgumentException("Parameter orderName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, orderName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get an order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param orderName The name of the order. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 order on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String location, String orderName) { + return getWithResponseAsync(resourceGroupName, location, orderName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get an order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param orderName The name of the order. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 order along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String location, String orderName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (orderName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter orderName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, location, orderName, accept, context); + } + + /** + * Get an order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param orderName The name of the order. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 order. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrderResourceInner get(String resourceGroupName, String location, String orderName) { + return getWithResponse(resourceGroupName, location, orderName, Context.NONE).getValue(); + } + + private static final ClientLogger LOGGER = new ClientLogger(OrderResourcesClientImpl.class); +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OrderResourcesImpl.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OrderResourcesImpl.java new file mode 100644 index 000000000000..cfcd36d1f631 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OrderResourcesImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.edgeorder.fluent.OrderResourcesClient; +import com.azure.resourcemanager.edgeorder.fluent.models.OrderResourceInner; +import com.azure.resourcemanager.edgeorder.models.OrderResource; +import com.azure.resourcemanager.edgeorder.models.OrderResources; + +public final class OrderResourcesImpl implements OrderResources { + private static final ClientLogger LOGGER = new ClientLogger(OrderResourcesImpl.class); + + private final OrderResourcesClient innerClient; + + private final com.azure.resourcemanager.edgeorder.EdgeorderManager serviceManager; + + public OrderResourcesImpl(OrderResourcesClient innerClient, + com.azure.resourcemanager.edgeorder.EdgeorderManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String location, String orderName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, location, orderName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new OrderResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public OrderResource get(String resourceGroupName, String location, String orderName) { + OrderResourceInner inner = this.serviceClient().get(resourceGroupName, location, orderName); + if (inner != null) { + return new OrderResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + private OrderResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.edgeorder.EdgeorderManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OrdersOperationGroupsClientImpl.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OrdersOperationGroupsClientImpl.java new file mode 100644 index 000000000000..c13e5f5be5d0 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OrdersOperationGroupsClientImpl.java @@ -0,0 +1,650 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.edgeorder.fluent.OrdersOperationGroupsClient; +import com.azure.resourcemanager.edgeorder.fluent.models.OrderResourceInner; +import com.azure.resourcemanager.edgeorder.implementation.models.OrderResourceList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OrdersOperationGroupsClient. + */ +public final class OrdersOperationGroupsClientImpl implements OrdersOperationGroupsClient { + /** + * The proxy service used to perform REST calls. + */ + private final OrdersOperationGroupsService service; + + /** + * The service client containing this operation class. + */ + private final EdgeOrderClientImpl client; + + /** + * Initializes an instance of OrdersOperationGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OrdersOperationGroupsClientImpl(EdgeOrderClientImpl client) { + this.service = RestProxy.create(OrdersOperationGroupsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for EdgeOrderClientOrdersOperationGroups to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "EdgeOrderClientOrder") + public interface OrdersOperationGroupsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$skipToken") String skipToken, @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$skipToken") String skipToken, @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orders") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$skipToken") String skipToken, + @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orders") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$skipToken") String skipToken, + @QueryParam("$top") Integer top, @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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> 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); + } + + /** + * List orders at subscription level. + * + * @param skipToken $skipToken is supported on Get list of orders, which provides the next page in the list of + * orders. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of orders along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String skipToken, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), skipToken, top, 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 orders at subscription level. + * + * @param skipToken $skipToken is supported on Get list of orders, which provides the next page in the list of + * orders. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of orders as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String skipToken, Integer top) { + return new PagedFlux<>(() -> listSinglePageAsync(skipToken, top), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List orders at subscription level. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of orders as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String skipToken = null; + final Integer top = null; + return new PagedFlux<>(() -> listSinglePageAsync(skipToken, top), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List orders at subscription level. + * + * @param skipToken $skipToken is supported on Get list of orders, which provides the next page in the list of + * orders. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of orders along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String skipToken, Integer top) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), skipToken, top, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List orders at subscription level. + * + * @param skipToken $skipToken is supported on Get list of orders, which provides the next page in the list of + * orders. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of orders along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String skipToken, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), skipToken, top, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List orders at subscription level. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of orders as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String skipToken = null; + final Integer top = null; + return new PagedIterable<>(() -> listSinglePage(skipToken, top), + nextLink -> listBySubscriptionNextSinglePage(nextLink)); + } + + /** + * List orders at subscription level. + * + * @param skipToken $skipToken is supported on Get list of orders, which provides the next page in the list of + * orders. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of orders as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String skipToken, Integer top, Context context) { + return new PagedIterable<>(() -> listSinglePage(skipToken, top, context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); + } + + /** + * List orders at resource group level. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param skipToken $skipToken is supported on Get list of orders, which provides the next page in the list of + * orders. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of orders along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + String skipToken, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, skipToken, top, 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 orders at resource group level. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param skipToken $skipToken is supported on Get list of orders, which provides the next page in the list of + * orders. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of orders as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String skipToken, + Integer top) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, skipToken, top), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List orders at resource group level. + * + * @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 list of orders as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String skipToken = null; + final Integer top = null; + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, skipToken, top), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List orders at resource group level. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param skipToken $skipToken is supported on Get list of orders, which provides the next page in the list of + * orders. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of orders along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, String skipToken, + Integer top) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, skipToken, top, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List orders at resource group level. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param skipToken $skipToken is supported on Get list of orders, which provides the next page in the list of + * orders. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of orders along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, String skipToken, + Integer top, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, skipToken, top, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List orders at resource group level. + * + * @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 list of orders as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final String skipToken = null; + final Integer top = null; + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, skipToken, top), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); + } + + /** + * List orders at resource group level. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param skipToken $skipToken is supported on Get list of orders, which provides the next page in the list of + * orders. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of orders as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, String skipToken, + Integer top, Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, skipToken, top, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); + } + + /** + * 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 list of orders along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 list of orders along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + 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. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of orders along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of orders along with {@link PagedResponse} on successful completion of {@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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 list of orders along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + 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. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of orders along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + private static final ClientLogger LOGGER = new ClientLogger(OrdersOperationGroupsClientImpl.class); +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OrdersOperationGroupsImpl.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OrdersOperationGroupsImpl.java new file mode 100644 index 000000000000..d2089ffd45e9 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/OrdersOperationGroupsImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.edgeorder.fluent.OrdersOperationGroupsClient; +import com.azure.resourcemanager.edgeorder.fluent.models.OrderResourceInner; +import com.azure.resourcemanager.edgeorder.models.OrderResource; +import com.azure.resourcemanager.edgeorder.models.OrdersOperationGroups; + +public final class OrdersOperationGroupsImpl implements OrdersOperationGroups { + private static final ClientLogger LOGGER = new ClientLogger(OrdersOperationGroupsImpl.class); + + private final OrdersOperationGroupsClient innerClient; + + private final com.azure.resourcemanager.edgeorder.EdgeorderManager serviceManager; + + public OrdersOperationGroupsImpl(OrdersOperationGroupsClient innerClient, + com.azure.resourcemanager.edgeorder.EdgeorderManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OrderResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String skipToken, Integer top, Context context) { + PagedIterable inner = this.serviceClient().list(skipToken, top, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OrderResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OrderResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, String skipToken, Integer top, + Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, skipToken, top, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OrderResourceImpl(inner1, this.manager())); + } + + private OrdersOperationGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.edgeorder.EdgeorderManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/ProductFamiliesMetadataDetailsImpl.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/ProductFamiliesMetadataDetailsImpl.java index 55526b8cdc47..05bcbe468bc9 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/ProductFamiliesMetadataDetailsImpl.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/ProductFamiliesMetadataDetailsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.implementation; @@ -9,6 +9,7 @@ import com.azure.resourcemanager.edgeorder.models.CostInformation; import com.azure.resourcemanager.edgeorder.models.Description; import com.azure.resourcemanager.edgeorder.models.FilterableProperty; +import com.azure.resourcemanager.edgeorder.models.FulfillmentType; import com.azure.resourcemanager.edgeorder.models.HierarchyInformation; import com.azure.resourcemanager.edgeorder.models.ImageInformation; import com.azure.resourcemanager.edgeorder.models.ProductFamiliesMetadataDetails; @@ -20,10 +21,10 @@ public final class ProductFamiliesMetadataDetailsImpl implements ProductFamiliesMetadataDetails { private ProductFamiliesMetadataDetailsInner innerObject; - private final com.azure.resourcemanager.edgeorder.EdgeOrderManager serviceManager; + private final com.azure.resourcemanager.edgeorder.EdgeorderManager serviceManager; ProductFamiliesMetadataDetailsImpl(ProductFamiliesMetadataDetailsInner innerObject, - com.azure.resourcemanager.edgeorder.EdgeOrderManager serviceManager) { + com.azure.resourcemanager.edgeorder.EdgeorderManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -84,11 +85,15 @@ public HierarchyInformation hierarchyInformation() { return this.innerModel().hierarchyInformation(); } + public FulfillmentType fulfilledBy() { + return this.innerModel().fulfilledBy(); + } + public ProductFamiliesMetadataDetailsInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.edgeorder.EdgeOrderManager manager() { + private com.azure.resourcemanager.edgeorder.EdgeorderManager manager() { return this.serviceManager; } } diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/ProductFamilyImpl.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/ProductFamilyImpl.java index c0699a9a1823..217d1a3e5b5b 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/ProductFamilyImpl.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/ProductFamilyImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.implementation; @@ -9,6 +9,7 @@ import com.azure.resourcemanager.edgeorder.models.CostInformation; import com.azure.resourcemanager.edgeorder.models.Description; import com.azure.resourcemanager.edgeorder.models.FilterableProperty; +import com.azure.resourcemanager.edgeorder.models.FulfillmentType; import com.azure.resourcemanager.edgeorder.models.HierarchyInformation; import com.azure.resourcemanager.edgeorder.models.ImageInformation; import com.azure.resourcemanager.edgeorder.models.ProductFamily; @@ -20,10 +21,10 @@ public final class ProductFamilyImpl implements ProductFamily { private ProductFamilyInner innerObject; - private final com.azure.resourcemanager.edgeorder.EdgeOrderManager serviceManager; + private final com.azure.resourcemanager.edgeorder.EdgeorderManager serviceManager; ProductFamilyImpl(ProductFamilyInner innerObject, - com.azure.resourcemanager.edgeorder.EdgeOrderManager serviceManager) { + com.azure.resourcemanager.edgeorder.EdgeorderManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -84,11 +85,15 @@ public HierarchyInformation hierarchyInformation() { return this.innerModel().hierarchyInformation(); } + public FulfillmentType fulfilledBy() { + return this.innerModel().fulfilledBy(); + } + public ProductFamilyInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.edgeorder.EdgeOrderManager manager() { + private com.azure.resourcemanager.edgeorder.EdgeorderManager manager() { return this.serviceManager; } } diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/ProductsAndConfigurationsOperationGroupsClientImpl.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/ProductsAndConfigurationsOperationGroupsClientImpl.java new file mode 100644 index 000000000000..3d2cede70f4f --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/ProductsAndConfigurationsOperationGroupsClientImpl.java @@ -0,0 +1,962 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.edgeorder.fluent.ProductsAndConfigurationsOperationGroupsClient; +import com.azure.resourcemanager.edgeorder.fluent.models.ConfigurationInner; +import com.azure.resourcemanager.edgeorder.fluent.models.ProductFamiliesMetadataDetailsInner; +import com.azure.resourcemanager.edgeorder.fluent.models.ProductFamilyInner; +import com.azure.resourcemanager.edgeorder.implementation.models.Configurations; +import com.azure.resourcemanager.edgeorder.implementation.models.ProductFamilies; +import com.azure.resourcemanager.edgeorder.implementation.models.ProductFamiliesMetadata; +import com.azure.resourcemanager.edgeorder.models.ConfigurationsRequest; +import com.azure.resourcemanager.edgeorder.models.ProductFamiliesRequest; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ProductsAndConfigurationsOperationGroupsClient. + */ +public final class ProductsAndConfigurationsOperationGroupsClientImpl + implements ProductsAndConfigurationsOperationGroupsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ProductsAndConfigurationsOperationGroupsService service; + + /** + * The service client containing this operation class. + */ + private final EdgeOrderClientImpl client; + + /** + * Initializes an instance of ProductsAndConfigurationsOperationGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProductsAndConfigurationsOperationGroupsClientImpl(EdgeOrderClientImpl client) { + this.service = RestProxy.create(ProductsAndConfigurationsOperationGroupsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for EdgeOrderClientProductsAndConfigurationsOperationGroups to be used by + * the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "EdgeOrderClientProdu") + public interface ProductsAndConfigurationsOperationGroupsService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listConfigurations(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ConfigurationsRequest configurationsRequest, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listConfigurationsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ConfigurationsRequest configurationsRequest, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listProductFamilies(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, @QueryParam("$skipToken") String skipToken, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ProductFamiliesRequest productFamiliesRequest, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listProductFamiliesSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, @QueryParam("$skipToken") String skipToken, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ProductFamiliesRequest productFamiliesRequest, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/productFamiliesMetadata") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listProductFamiliesMetadata(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/productFamiliesMetadata") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listProductFamiliesMetadataSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listConfigurationsNext( + @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 listConfigurationsNextSync( + @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> listProductFamiliesNext( + @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 listProductFamiliesNextSync( + @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> listProductFamiliesMetadataNext( + @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 listProductFamiliesMetadataNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List configurations for the given product family, product line and product for the given subscription. + * + * @param configurationsRequest Filters for showing the configurations. + * @param skipToken $skipToken is supported on list of configurations, which provides the next page in the list of + * configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of configurations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listConfigurationsSinglePageAsync(ConfigurationsRequest configurationsRequest, String skipToken) { + 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 (configurationsRequest == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationsRequest is required and cannot be null.")); + } else { + configurationsRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listConfigurations(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), skipToken, accept, configurationsRequest, 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 configurations for the given product family, product line and product for the given subscription. + * + * @param configurationsRequest Filters for showing the configurations. + * @param skipToken $skipToken is supported on list of configurations, which provides the next page in the list of + * configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of configurations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listConfigurationsAsync(ConfigurationsRequest configurationsRequest, + String skipToken) { + return new PagedFlux<>(() -> listConfigurationsSinglePageAsync(configurationsRequest, skipToken), + nextLink -> listConfigurationsNextSinglePageAsync(nextLink)); + } + + /** + * List configurations for the given product family, product line and product for the given subscription. + * + * @param configurationsRequest Filters for showing the configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of configurations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listConfigurationsAsync(ConfigurationsRequest configurationsRequest) { + final String skipToken = null; + return new PagedFlux<>(() -> listConfigurationsSinglePageAsync(configurationsRequest, skipToken), + nextLink -> listConfigurationsNextSinglePageAsync(nextLink)); + } + + /** + * List configurations for the given product family, product line and product for the given subscription. + * + * @param configurationsRequest Filters for showing the configurations. + * @param skipToken $skipToken is supported on list of configurations, which provides the next page in the list of + * configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of configurations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listConfigurationsSinglePage(ConfigurationsRequest configurationsRequest, + String skipToken) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (configurationsRequest == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter configurationsRequest is required and cannot be null.")); + } else { + configurationsRequest.validate(); + } + final String accept = "application/json"; + Response res + = service.listConfigurationsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), skipToken, accept, configurationsRequest, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List configurations for the given product family, product line and product for the given subscription. + * + * @param configurationsRequest Filters for showing the configurations. + * @param skipToken $skipToken is supported on list of configurations, which provides the next page in the list of + * configurations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of configurations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listConfigurationsSinglePage(ConfigurationsRequest configurationsRequest, + String skipToken, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (configurationsRequest == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter configurationsRequest is required and cannot be null.")); + } else { + configurationsRequest.validate(); + } + final String accept = "application/json"; + Response res + = service.listConfigurationsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), skipToken, accept, configurationsRequest, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List configurations for the given product family, product line and product for the given subscription. + * + * @param configurationsRequest Filters for showing the configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of configurations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listConfigurations(ConfigurationsRequest configurationsRequest) { + final String skipToken = null; + return new PagedIterable<>(() -> listConfigurationsSinglePage(configurationsRequest, skipToken), + nextLink -> listConfigurationsNextSinglePage(nextLink)); + } + + /** + * List configurations for the given product family, product line and product for the given subscription. + * + * @param configurationsRequest Filters for showing the configurations. + * @param skipToken $skipToken is supported on list of configurations, which provides the next page in the list of + * configurations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of configurations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listConfigurations(ConfigurationsRequest configurationsRequest, + String skipToken, Context context) { + return new PagedIterable<>(() -> listConfigurationsSinglePage(configurationsRequest, skipToken, context), + nextLink -> listConfigurationsNextSinglePage(nextLink, context)); + } + + /** + * List product families for the given subscription. + * + * @param productFamiliesRequest Filters for showing the product families. + * @param expand $expand is supported on configurations parameter for product, which provides details on the + * configurations for the product. + * @param skipToken $skipToken is supported on list of product families, which provides the next page in the list of + * product families. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of product families along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listProductFamiliesSinglePageAsync( + ProductFamiliesRequest productFamiliesRequest, String expand, String skipToken) { + 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 (productFamiliesRequest == null) { + return Mono.error( + new IllegalArgumentException("Parameter productFamiliesRequest is required and cannot be null.")); + } else { + productFamiliesRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listProductFamilies(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), expand, skipToken, accept, productFamiliesRequest, 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 families for the given subscription. + * + * @param productFamiliesRequest Filters for showing the product families. + * @param expand $expand is supported on configurations parameter for product, which provides details on the + * configurations for the product. + * @param skipToken $skipToken is supported on list of product families, which provides the next page in the list of + * product families. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of product families as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listProductFamiliesAsync(ProductFamiliesRequest productFamiliesRequest, + String expand, String skipToken) { + return new PagedFlux<>(() -> listProductFamiliesSinglePageAsync(productFamiliesRequest, expand, skipToken), + nextLink -> listProductFamiliesNextSinglePageAsync(nextLink)); + } + + /** + * List product families for the given subscription. + * + * @param productFamiliesRequest Filters for showing the product families. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of product families as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listProductFamiliesAsync(ProductFamiliesRequest productFamiliesRequest) { + final String expand = null; + final String skipToken = null; + return new PagedFlux<>(() -> listProductFamiliesSinglePageAsync(productFamiliesRequest, expand, skipToken), + nextLink -> listProductFamiliesNextSinglePageAsync(nextLink)); + } + + /** + * List product families for the given subscription. + * + * @param productFamiliesRequest Filters for showing the product families. + * @param expand $expand is supported on configurations parameter for product, which provides details on the + * configurations for the product. + * @param skipToken $skipToken is supported on list of product families, which provides the next page in the list of + * product families. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of product families along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse + listProductFamiliesSinglePage(ProductFamiliesRequest productFamiliesRequest, String expand, String skipToken) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (productFamiliesRequest == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter productFamiliesRequest is required and cannot be null.")); + } else { + productFamiliesRequest.validate(); + } + final String accept = "application/json"; + Response res + = service.listProductFamiliesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), expand, skipToken, accept, productFamiliesRequest, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List product families for the given subscription. + * + * @param productFamiliesRequest Filters for showing the product families. + * @param expand $expand is supported on configurations parameter for product, which provides details on the + * configurations for the product. + * @param skipToken $skipToken is supported on list of product families, which provides the next page in the list of + * product families. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of product families along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listProductFamiliesSinglePage( + ProductFamiliesRequest productFamiliesRequest, String expand, String skipToken, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (productFamiliesRequest == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter productFamiliesRequest is required and cannot be null.")); + } else { + productFamiliesRequest.validate(); + } + final String accept = "application/json"; + Response res + = service.listProductFamiliesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), expand, skipToken, accept, productFamiliesRequest, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List product families for the given subscription. + * + * @param productFamiliesRequest Filters for showing the product families. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of product families as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listProductFamilies(ProductFamiliesRequest productFamiliesRequest) { + final String expand = null; + final String skipToken = null; + return new PagedIterable<>(() -> listProductFamiliesSinglePage(productFamiliesRequest, expand, skipToken), + nextLink -> listProductFamiliesNextSinglePage(nextLink)); + } + + /** + * List product families for the given subscription. + * + * @param productFamiliesRequest Filters for showing the product families. + * @param expand $expand is supported on configurations parameter for product, which provides details on the + * configurations for the product. + * @param skipToken $skipToken is supported on list of product families, which provides the next page in the list of + * product families. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of product families as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listProductFamilies(ProductFamiliesRequest productFamiliesRequest, + String expand, String skipToken, Context context) { + return new PagedIterable<>( + () -> listProductFamiliesSinglePage(productFamiliesRequest, expand, skipToken, context), + nextLink -> listProductFamiliesNextSinglePage(nextLink, context)); + } + + /** + * List product families metadata for the given subscription. + * + * @param skipToken $skipToken is supported on list of product families metadata, which provides the next page in + * the list of product families metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds details about product family metadata along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listProductFamiliesMetadataSinglePageAsync(String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listProductFamiliesMetadata(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), skipToken, 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 families metadata for the given subscription. + * + * @param skipToken $skipToken is supported on list of product families metadata, which provides the next page in + * the list of product families metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds details about product family metadata as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listProductFamiliesMetadataAsync(String skipToken) { + return new PagedFlux<>(() -> listProductFamiliesMetadataSinglePageAsync(skipToken), + nextLink -> listProductFamiliesMetadataNextSinglePageAsync(nextLink)); + } + + /** + * List product families metadata for the given subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds details about product family metadata as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listProductFamiliesMetadataAsync() { + final String skipToken = null; + return new PagedFlux<>(() -> listProductFamiliesMetadataSinglePageAsync(skipToken), + nextLink -> listProductFamiliesMetadataNextSinglePageAsync(nextLink)); + } + + /** + * List product families metadata for the given subscription. + * + * @param skipToken $skipToken is supported on list of product families metadata, which provides the next page in + * the list of product families metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds details about product family metadata along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listProductFamiliesMetadataSinglePage(String skipToken) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listProductFamiliesMetadataSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), skipToken, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List product families metadata for the given subscription. + * + * @param skipToken $skipToken is supported on list of product families metadata, which provides the next page in + * the list of product families metadata. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds details about product family metadata along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listProductFamiliesMetadataSinglePage(String skipToken, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listProductFamiliesMetadataSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), skipToken, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List product families metadata for the given subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds details about product family metadata as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listProductFamiliesMetadata() { + final String skipToken = null; + return new PagedIterable<>(() -> listProductFamiliesMetadataSinglePage(skipToken), + nextLink -> listProductFamiliesMetadataNextSinglePage(nextLink)); + } + + /** + * List product families metadata for the given subscription. + * + * @param skipToken $skipToken is supported on list of product families metadata, which provides the next page in + * the list of product families metadata. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds details about product family metadata as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listProductFamiliesMetadata(String skipToken, + Context context) { + return new PagedIterable<>(() -> listProductFamiliesMetadataSinglePage(skipToken, context), + nextLink -> listProductFamiliesMetadataNextSinglePage(nextLink, context)); + } + + /** + * 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 list of configurations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listConfigurationsNextSinglePageAsync(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.listConfigurationsNext(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 list of configurations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listConfigurationsNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listConfigurationsNextSync(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. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of configurations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listConfigurationsNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listConfigurationsNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of product families along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listProductFamiliesNextSinglePageAsync(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.listProductFamiliesNext(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 list of product families along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listProductFamiliesNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listProductFamiliesNextSync(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. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of product families along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listProductFamiliesNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listProductFamiliesNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds details about product family metadata along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listProductFamiliesMetadataNextSinglePageAsync(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.listProductFamiliesMetadataNext(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 holds details about product family metadata along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse + listProductFamiliesMetadataNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listProductFamiliesMetadataNextSync(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. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds details about product family metadata along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse + listProductFamiliesMetadataNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listProductFamiliesMetadataNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + private static final ClientLogger LOGGER + = new ClientLogger(ProductsAndConfigurationsOperationGroupsClientImpl.class); +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/ProductsAndConfigurationsOperationGroupsImpl.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/ProductsAndConfigurationsOperationGroupsImpl.java new file mode 100644 index 000000000000..e948bb3ea40f --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/ProductsAndConfigurationsOperationGroupsImpl.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.edgeorder.fluent.ProductsAndConfigurationsOperationGroupsClient; +import com.azure.resourcemanager.edgeorder.fluent.models.ConfigurationInner; +import com.azure.resourcemanager.edgeorder.fluent.models.ProductFamiliesMetadataDetailsInner; +import com.azure.resourcemanager.edgeorder.fluent.models.ProductFamilyInner; +import com.azure.resourcemanager.edgeorder.models.Configuration; +import com.azure.resourcemanager.edgeorder.models.ConfigurationsRequest; +import com.azure.resourcemanager.edgeorder.models.ProductFamiliesMetadataDetails; +import com.azure.resourcemanager.edgeorder.models.ProductFamiliesRequest; +import com.azure.resourcemanager.edgeorder.models.ProductFamily; +import com.azure.resourcemanager.edgeorder.models.ProductsAndConfigurationsOperationGroups; + +public final class ProductsAndConfigurationsOperationGroupsImpl implements ProductsAndConfigurationsOperationGroups { + private static final ClientLogger LOGGER = new ClientLogger(ProductsAndConfigurationsOperationGroupsImpl.class); + + private final ProductsAndConfigurationsOperationGroupsClient innerClient; + + private final com.azure.resourcemanager.edgeorder.EdgeorderManager serviceManager; + + public ProductsAndConfigurationsOperationGroupsImpl(ProductsAndConfigurationsOperationGroupsClient innerClient, + com.azure.resourcemanager.edgeorder.EdgeorderManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listConfigurations(ConfigurationsRequest configurationsRequest) { + PagedIterable inner = this.serviceClient().listConfigurations(configurationsRequest); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable listConfigurations(ConfigurationsRequest configurationsRequest, + String skipToken, Context context) { + PagedIterable inner + = this.serviceClient().listConfigurations(configurationsRequest, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable listProductFamilies(ProductFamiliesRequest productFamiliesRequest) { + PagedIterable inner = this.serviceClient().listProductFamilies(productFamiliesRequest); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ProductFamilyImpl(inner1, this.manager())); + } + + public PagedIterable listProductFamilies(ProductFamiliesRequest productFamiliesRequest, + String expand, String skipToken, Context context) { + PagedIterable inner + = this.serviceClient().listProductFamilies(productFamiliesRequest, expand, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ProductFamilyImpl(inner1, this.manager())); + } + + public PagedIterable listProductFamiliesMetadata() { + PagedIterable inner = this.serviceClient().listProductFamiliesMetadata(); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ProductFamiliesMetadataDetailsImpl(inner1, this.manager())); + } + + public PagedIterable listProductFamiliesMetadata(String skipToken, + Context context) { + PagedIterable inner + = this.serviceClient().listProductFamiliesMetadata(skipToken, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ProductFamiliesMetadataDetailsImpl(inner1, this.manager())); + } + + private ProductsAndConfigurationsOperationGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.edgeorder.EdgeorderManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/ResourceManagerUtils.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/ResourceManagerUtils.java index 0562691f1928..4185d39bf373 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/ResourceManagerUtils.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/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.edgeorder.implementation; diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/ResourceProvidersClientImpl.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/ResourceProvidersClientImpl.java deleted file mode 100644 index 158fd15b5432..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/ResourceProvidersClientImpl.java +++ /dev/null @@ -1,4734 +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.edgeorder.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -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.edgeorder.fluent.ResourceProvidersClient; -import com.azure.resourcemanager.edgeorder.fluent.models.AddressResourceInner; -import com.azure.resourcemanager.edgeorder.fluent.models.ConfigurationInner; -import com.azure.resourcemanager.edgeorder.fluent.models.OperationInner; -import com.azure.resourcemanager.edgeorder.fluent.models.OrderItemResourceInner; -import com.azure.resourcemanager.edgeorder.fluent.models.OrderResourceInner; -import com.azure.resourcemanager.edgeorder.fluent.models.ProductFamiliesMetadataDetailsInner; -import com.azure.resourcemanager.edgeorder.fluent.models.ProductFamilyInner; -import com.azure.resourcemanager.edgeorder.models.AddressResourceList; -import com.azure.resourcemanager.edgeorder.models.AddressUpdateParameter; -import com.azure.resourcemanager.edgeorder.models.CancellationReason; -import com.azure.resourcemanager.edgeorder.models.Configurations; -import com.azure.resourcemanager.edgeorder.models.ConfigurationsRequest; -import com.azure.resourcemanager.edgeorder.models.OperationListResult; -import com.azure.resourcemanager.edgeorder.models.OrderItemResourceList; -import com.azure.resourcemanager.edgeorder.models.OrderItemUpdateParameter; -import com.azure.resourcemanager.edgeorder.models.OrderResourceList; -import com.azure.resourcemanager.edgeorder.models.ProductFamilies; -import com.azure.resourcemanager.edgeorder.models.ProductFamiliesMetadata; -import com.azure.resourcemanager.edgeorder.models.ProductFamiliesRequest; -import com.azure.resourcemanager.edgeorder.models.ReturnOrderItemDetails; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ResourceProvidersClient. - */ -public final class ResourceProvidersClientImpl implements ResourceProvidersClient { - /** - * The proxy service used to perform REST calls. - */ - private final ResourceProvidersService service; - - /** - * The service client containing this operation class. - */ - private final EdgeOrderManagementClientImpl client; - - /** - * Initializes an instance of ResourceProvidersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ResourceProvidersClientImpl(EdgeOrderManagementClientImpl client) { - this.service - = RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for EdgeOrderManagementClientResourceProviders to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "EdgeOrderManagementC") - public interface ResourceProvidersService { - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.EdgeOrder/operations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listOperations(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/addresses") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, @QueryParam("$skipToken") String skipToken, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listProductFamilies(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @QueryParam("$expand") String expand, @QueryParam("$skipToken") String skipToken, - @BodyParam("application/json") ProductFamiliesRequest productFamiliesRequest, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listConfigurations(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @QueryParam("$skipToken") String skipToken, - @BodyParam("application/json") ConfigurationsRequest configurationsRequest, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/productFamiliesMetadata") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listProductFamiliesMetadata(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listOrderAtSubscriptionLevel(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listOrderItemsAtSubscriptionLevel(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, @QueryParam("$expand") String expand, - @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, @QueryParam("$skipToken") String skipToken, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @PathParam("addressName") String addressName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createAddress(@HostParam("$host") String endpoint, - @PathParam("addressName") String addressName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AddressResourceInner addressResource, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @PathParam("addressName") String addressName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateAddress(@HostParam("$host") String endpoint, - @PathParam("addressName") String addressName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("If-Match") String ifMatch, - @BodyParam("application/json") AddressUpdateParameter addressUpdateParameter, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orders") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listOrderAtResourceGroupLevel(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getOrderByName(@HostParam("$host") String endpoint, - @PathParam("orderName") String orderName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listOrderItemsAtResourceGroupLevel(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, @QueryParam("$expand") String expand, - @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getOrderItemByName(@HostParam("$host") String endpoint, - @PathParam("orderItemName") String orderItemName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrderItem(@HostParam("$host") String endpoint, - @PathParam("orderItemName") String orderItemName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") OrderItemResourceInner orderItemResource, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deleteOrderItemByName(@HostParam("$host") String endpoint, - @PathParam("orderItemName") String orderItemName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateOrderItem(@HostParam("$host") String endpoint, - @PathParam("orderItemName") String orderItemName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("If-Match") String ifMatch, - @BodyParam("application/json") OrderItemUpdateParameter orderItemUpdateParameter, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/cancel") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> cancelOrderItem(@HostParam("$host") String endpoint, - @PathParam("orderItemName") String orderItemName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CancellationReason cancellationReason, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> returnOrderItem(@HostParam("$host") String endpoint, - @PathParam("orderItemName") String orderItemName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ReturnOrderItemDetails returnOrderItemDetails, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listOperationsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAddressesAtSubscriptionLevelNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listProductFamiliesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listConfigurationsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listProductFamiliesMetadataNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listOrderAtSubscriptionLevelNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listOrderItemsAtSubscriptionLevelNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAddressesAtResourceGroupLevelNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listOrderAtResourceGroupLevelNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listOrderItemsAtResourceGroupLevelNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * This method gets all the operations that are exposed for customer. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOperationsSinglePageAsync() { - 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.listOperations(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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * This method gets all the operations that are exposed for customer. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOperationsSinglePageAsync(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.listOperations(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)); - } - - /** - * This method gets all the operations that are exposed for customer. - * - * @throws 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}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listOperationsAsync() { - return new PagedFlux<>(() -> listOperationsSinglePageAsync(), - nextLink -> listOperationsNextSinglePageAsync(nextLink)); - } - - /** - * This method gets all the operations that are exposed for customer. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listOperationsAsync(Context context) { - return new PagedFlux<>(() -> listOperationsSinglePageAsync(context), - nextLink -> listOperationsNextSinglePageAsync(nextLink, context)); - } - - /** - * This method gets all the operations that are exposed for customer. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOperations() { - return new PagedIterable<>(listOperationsAsync()); - } - - /** - * This method gets all the operations that are exposed for customer. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOperations(Context context) { - return new PagedIterable<>(listOperationsAsync(context)); - } - - /** - * Lists all the addresses available under the subscription. - * - * @param filter $filter is supported to filter based on shipping address properties. Filter supports only equals - * operation. - * @param skipToken $skipToken is supported on Get list of addresses, which provides the next page in the list of - * addresses. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return address Resource Collection along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, String skipToken) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), filter, skipToken, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the addresses available under the subscription. - * - * @param filter $filter is supported to filter based on shipping address properties. Filter supports only equals - * operation. - * @param skipToken $skipToken is supported on Get list of addresses, which provides the next page in the list of - * addresses. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return address Resource Collection along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, String skipToken, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), filter, - skipToken, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists all the addresses available under the subscription. - * - * @param filter $filter is supported to filter based on shipping address properties. Filter supports only equals - * operation. - * @param skipToken $skipToken is supported on Get list of addresses, which provides the next page in the list of - * addresses. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return address Resource Collection as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, String skipToken) { - return new PagedFlux<>(() -> listSinglePageAsync(filter, skipToken), - nextLink -> listAddressesAtSubscriptionLevelNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the addresses available under the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return address Resource Collection as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - final String filter = null; - final String skipToken = null; - return new PagedFlux<>(() -> listSinglePageAsync(filter, skipToken), - nextLink -> listAddressesAtSubscriptionLevelNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the addresses available under the subscription. - * - * @param filter $filter is supported to filter based on shipping address properties. Filter supports only equals - * operation. - * @param skipToken $skipToken is supported on Get list of addresses, which provides the next page in the list of - * addresses. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return address Resource Collection as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, String skipToken, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(filter, skipToken, context), - nextLink -> listAddressesAtSubscriptionLevelNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the addresses available under the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return address Resource Collection as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String filter = null; - final String skipToken = null; - return new PagedIterable<>(listAsync(filter, skipToken)); - } - - /** - * Lists all the addresses available under the subscription. - * - * @param filter $filter is supported to filter based on shipping address properties. Filter supports only equals - * operation. - * @param skipToken $skipToken is supported on Get list of addresses, which provides the next page in the list of - * addresses. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return address Resource Collection as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, String skipToken, Context context) { - return new PagedIterable<>(listAsync(filter, skipToken, context)); - } - - /** - * This method provides the list of product families for the given subscription. - * - * @param productFamiliesRequest Filters for showing the product families. - * @param expand $expand is supported on configurations parameter for product, which provides details on the - * configurations for the product. - * @param skipToken $skipToken is supported on list of product families, which provides the next page in the list of - * product families. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of product families along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listProductFamiliesSinglePageAsync( - ProductFamiliesRequest productFamiliesRequest, String expand, String skipToken) { - 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 (productFamiliesRequest == null) { - return Mono.error( - new IllegalArgumentException("Parameter productFamiliesRequest is required and cannot be null.")); - } else { - productFamiliesRequest.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listProductFamilies(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), expand, skipToken, productFamiliesRequest, 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())); - } - - /** - * This method provides the list of product families for the given subscription. - * - * @param productFamiliesRequest Filters for showing the product families. - * @param expand $expand is supported on configurations parameter for product, which provides details on the - * configurations for the product. - * @param skipToken $skipToken is supported on list of product families, which provides the next page in the list of - * product families. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of product families along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listProductFamiliesSinglePageAsync( - ProductFamiliesRequest productFamiliesRequest, String expand, String skipToken, 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 (productFamiliesRequest == null) { - return Mono.error( - new IllegalArgumentException("Parameter productFamiliesRequest is required and cannot be null.")); - } else { - productFamiliesRequest.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listProductFamilies(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), expand, skipToken, productFamiliesRequest, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * This method provides the list of product families for the given subscription. - * - * @param productFamiliesRequest Filters for showing the product families. - * @param expand $expand is supported on configurations parameter for product, which provides details on the - * configurations for the product. - * @param skipToken $skipToken is supported on list of product families, which provides the next page in the list of - * product families. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of product families as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listProductFamiliesAsync(ProductFamiliesRequest productFamiliesRequest, - String expand, String skipToken) { - return new PagedFlux<>(() -> listProductFamiliesSinglePageAsync(productFamiliesRequest, expand, skipToken), - nextLink -> listProductFamiliesNextSinglePageAsync(nextLink)); - } - - /** - * This method provides the list of product families for the given subscription. - * - * @param productFamiliesRequest Filters for showing the product families. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of product families as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listProductFamiliesAsync(ProductFamiliesRequest productFamiliesRequest) { - final String expand = null; - final String skipToken = null; - return new PagedFlux<>(() -> listProductFamiliesSinglePageAsync(productFamiliesRequest, expand, skipToken), - nextLink -> listProductFamiliesNextSinglePageAsync(nextLink)); - } - - /** - * This method provides the list of product families for the given subscription. - * - * @param productFamiliesRequest Filters for showing the product families. - * @param expand $expand is supported on configurations parameter for product, which provides details on the - * configurations for the product. - * @param skipToken $skipToken is supported on list of product families, which provides the next page in the list of - * product families. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of product families as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listProductFamiliesAsync(ProductFamiliesRequest productFamiliesRequest, - String expand, String skipToken, Context context) { - return new PagedFlux<>( - () -> listProductFamiliesSinglePageAsync(productFamiliesRequest, expand, skipToken, context), - nextLink -> listProductFamiliesNextSinglePageAsync(nextLink, context)); - } - - /** - * This method provides the list of product families for the given subscription. - * - * @param productFamiliesRequest Filters for showing the product families. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of product families as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listProductFamilies(ProductFamiliesRequest productFamiliesRequest) { - final String expand = null; - final String skipToken = null; - return new PagedIterable<>(listProductFamiliesAsync(productFamiliesRequest, expand, skipToken)); - } - - /** - * This method provides the list of product families for the given subscription. - * - * @param productFamiliesRequest Filters for showing the product families. - * @param expand $expand is supported on configurations parameter for product, which provides details on the - * configurations for the product. - * @param skipToken $skipToken is supported on list of product families, which provides the next page in the list of - * product families. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of product families as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listProductFamilies(ProductFamiliesRequest productFamiliesRequest, - String expand, String skipToken, Context context) { - return new PagedIterable<>(listProductFamiliesAsync(productFamiliesRequest, expand, skipToken, context)); - } - - /** - * This method provides the list of configurations for the given product family, product line and product under - * subscription. - * - * @param configurationsRequest Filters for showing the configurations. - * @param skipToken $skipToken is supported on list of configurations, which provides the next page in the list of - * configurations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of configurations along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listConfigurationsSinglePageAsync(ConfigurationsRequest configurationsRequest, String skipToken) { - 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 (configurationsRequest == null) { - return Mono - .error(new IllegalArgumentException("Parameter configurationsRequest is required and cannot be null.")); - } else { - configurationsRequest.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listConfigurations(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), skipToken, configurationsRequest, 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())); - } - - /** - * This method provides the list of configurations for the given product family, product line and product under - * subscription. - * - * @param configurationsRequest Filters for showing the configurations. - * @param skipToken $skipToken is supported on list of configurations, which provides the next page in the list of - * configurations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of configurations along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listConfigurationsSinglePageAsync( - ConfigurationsRequest configurationsRequest, String skipToken, 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 (configurationsRequest == null) { - return Mono - .error(new IllegalArgumentException("Parameter configurationsRequest is required and cannot be null.")); - } else { - configurationsRequest.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listConfigurations(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), - skipToken, configurationsRequest, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * This method provides the list of configurations for the given product family, product line and product under - * subscription. - * - * @param configurationsRequest Filters for showing the configurations. - * @param skipToken $skipToken is supported on list of configurations, which provides the next page in the list of - * configurations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of configurations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listConfigurationsAsync(ConfigurationsRequest configurationsRequest, - String skipToken) { - return new PagedFlux<>(() -> listConfigurationsSinglePageAsync(configurationsRequest, skipToken), - nextLink -> listConfigurationsNextSinglePageAsync(nextLink)); - } - - /** - * This method provides the list of configurations for the given product family, product line and product under - * subscription. - * - * @param configurationsRequest Filters for showing the configurations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of configurations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listConfigurationsAsync(ConfigurationsRequest configurationsRequest) { - final String skipToken = null; - return new PagedFlux<>(() -> listConfigurationsSinglePageAsync(configurationsRequest, skipToken), - nextLink -> listConfigurationsNextSinglePageAsync(nextLink)); - } - - /** - * This method provides the list of configurations for the given product family, product line and product under - * subscription. - * - * @param configurationsRequest Filters for showing the configurations. - * @param skipToken $skipToken is supported on list of configurations, which provides the next page in the list of - * configurations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of configurations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listConfigurationsAsync(ConfigurationsRequest configurationsRequest, - String skipToken, Context context) { - return new PagedFlux<>(() -> listConfigurationsSinglePageAsync(configurationsRequest, skipToken, context), - nextLink -> listConfigurationsNextSinglePageAsync(nextLink, context)); - } - - /** - * This method provides the list of configurations for the given product family, product line and product under - * subscription. - * - * @param configurationsRequest Filters for showing the configurations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of configurations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listConfigurations(ConfigurationsRequest configurationsRequest) { - final String skipToken = null; - return new PagedIterable<>(listConfigurationsAsync(configurationsRequest, skipToken)); - } - - /** - * This method provides the list of configurations for the given product family, product line and product under - * subscription. - * - * @param configurationsRequest Filters for showing the configurations. - * @param skipToken $skipToken is supported on list of configurations, which provides the next page in the list of - * configurations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of configurations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listConfigurations(ConfigurationsRequest configurationsRequest, - String skipToken, Context context) { - return new PagedIterable<>(listConfigurationsAsync(configurationsRequest, skipToken, context)); - } - - /** - * This method provides the list of product families metadata for the given subscription. - * - * @param skipToken $skipToken is supported on list of product families metadata, which provides the next page in - * the list of product families metadata. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return holds details about product family metadata along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listProductFamiliesMetadataSinglePageAsync(String skipToken) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listProductFamiliesMetadata(this.client.getEndpoint(), - this.client.getSubscriptionId(), this.client.getApiVersion(), skipToken, 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())); - } - - /** - * This method provides the list of product families metadata for the given subscription. - * - * @param skipToken $skipToken is supported on list of product families metadata, which provides the next page in - * the list of product families metadata. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return holds details about product family metadata along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listProductFamiliesMetadataSinglePageAsync(String skipToken, 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 - .listProductFamiliesMetadata(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), skipToken, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * This method provides the list of product families metadata for the given subscription. - * - * @param skipToken $skipToken is supported on list of product families metadata, which provides the next page in - * the list of product families metadata. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return holds details about product family metadata as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listProductFamiliesMetadataAsync(String skipToken) { - return new PagedFlux<>(() -> listProductFamiliesMetadataSinglePageAsync(skipToken), - nextLink -> listProductFamiliesMetadataNextSinglePageAsync(nextLink)); - } - - /** - * This method provides the list of product families metadata for the given subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return holds details about product family metadata as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listProductFamiliesMetadataAsync() { - final String skipToken = null; - return new PagedFlux<>(() -> listProductFamiliesMetadataSinglePageAsync(skipToken), - nextLink -> listProductFamiliesMetadataNextSinglePageAsync(nextLink)); - } - - /** - * This method provides the list of product families metadata for the given subscription. - * - * @param skipToken $skipToken is supported on list of product families metadata, which provides the next page in - * the list of product families metadata. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return holds details about product family metadata as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listProductFamiliesMetadataAsync(String skipToken, - Context context) { - return new PagedFlux<>(() -> listProductFamiliesMetadataSinglePageAsync(skipToken, context), - nextLink -> listProductFamiliesMetadataNextSinglePageAsync(nextLink, context)); - } - - /** - * This method provides the list of product families metadata for the given subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return holds details about product family metadata as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listProductFamiliesMetadata() { - final String skipToken = null; - return new PagedIterable<>(listProductFamiliesMetadataAsync(skipToken)); - } - - /** - * This method provides the list of product families metadata for the given subscription. - * - * @param skipToken $skipToken is supported on list of product families metadata, which provides the next page in - * the list of product families metadata. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return holds details about product family metadata as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listProductFamiliesMetadata(String skipToken, - Context context) { - return new PagedIterable<>(listProductFamiliesMetadataAsync(skipToken, context)); - } - - /** - * Lists order at subscription level. - * - * @param skipToken $skipToken is supported on Get list of order, which provides the next page in the list of order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orders along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOrderAtSubscriptionLevelSinglePageAsync(String skipToken) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listOrderAtSubscriptionLevel(this.client.getEndpoint(), - this.client.getSubscriptionId(), this.client.getApiVersion(), skipToken, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists order at subscription level. - * - * @param skipToken $skipToken is supported on Get list of order, which provides the next page in the list of order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orders along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOrderAtSubscriptionLevelSinglePageAsync(String skipToken, - 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 - .listOrderAtSubscriptionLevel(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), skipToken, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists order at subscription level. - * - * @param skipToken $skipToken is supported on Get list of order, which provides the next page in the list of order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orders as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listOrderAtSubscriptionLevelAsync(String skipToken) { - return new PagedFlux<>(() -> listOrderAtSubscriptionLevelSinglePageAsync(skipToken), - nextLink -> listOrderAtSubscriptionLevelNextSinglePageAsync(nextLink)); - } - - /** - * Lists order at subscription level. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orders as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listOrderAtSubscriptionLevelAsync() { - final String skipToken = null; - return new PagedFlux<>(() -> listOrderAtSubscriptionLevelSinglePageAsync(skipToken), - nextLink -> listOrderAtSubscriptionLevelNextSinglePageAsync(nextLink)); - } - - /** - * Lists order at subscription level. - * - * @param skipToken $skipToken is supported on Get list of order, which provides the next page in the list of order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orders as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listOrderAtSubscriptionLevelAsync(String skipToken, Context context) { - return new PagedFlux<>(() -> listOrderAtSubscriptionLevelSinglePageAsync(skipToken, context), - nextLink -> listOrderAtSubscriptionLevelNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists order at subscription level. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orders as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOrderAtSubscriptionLevel() { - final String skipToken = null; - return new PagedIterable<>(listOrderAtSubscriptionLevelAsync(skipToken)); - } - - /** - * Lists order at subscription level. - * - * @param skipToken $skipToken is supported on Get list of order, which provides the next page in the list of order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orders as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOrderAtSubscriptionLevel(String skipToken, Context context) { - return new PagedIterable<>(listOrderAtSubscriptionLevelAsync(skipToken, context)); - } - - /** - * Lists order item at subscription level. - * - * @param filter $filter is supported to filter based on order id. Filter supports only equals operation. - * @param expand $expand is supported on device details, forward shipping details and reverse shipping details - * parameters. Each of these can be provided as a comma separated list. Device Details for order item provides - * details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping - * details respectively. - * @param skipToken $skipToken is supported on Get list of order items, which provides the next page in the list of - * order 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 list of orderItems along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOrderItemsAtSubscriptionLevelSinglePageAsync(String filter, - String expand, String skipToken) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listOrderItemsAtSubscriptionLevel(this.client.getEndpoint(), - this.client.getSubscriptionId(), this.client.getApiVersion(), filter, expand, skipToken, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists order item at subscription level. - * - * @param filter $filter is supported to filter based on order id. Filter supports only equals operation. - * @param expand $expand is supported on device details, forward shipping details and reverse shipping details - * parameters. Each of these can be provided as a comma separated list. Device Details for order item provides - * details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping - * details respectively. - * @param skipToken $skipToken is supported on Get list of order items, which provides the next page in the list of - * order items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orderItems along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOrderItemsAtSubscriptionLevelSinglePageAsync(String filter, - String expand, String skipToken, 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 - .listOrderItemsAtSubscriptionLevel(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), filter, expand, skipToken, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists order item at subscription level. - * - * @param filter $filter is supported to filter based on order id. Filter supports only equals operation. - * @param expand $expand is supported on device details, forward shipping details and reverse shipping details - * parameters. Each of these can be provided as a comma separated list. Device Details for order item provides - * details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping - * details respectively. - * @param skipToken $skipToken is supported on Get list of order items, which provides the next page in the list of - * order 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 list of orderItems as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listOrderItemsAtSubscriptionLevelAsync(String filter, String expand, - String skipToken) { - return new PagedFlux<>(() -> listOrderItemsAtSubscriptionLevelSinglePageAsync(filter, expand, skipToken), - nextLink -> listOrderItemsAtSubscriptionLevelNextSinglePageAsync(nextLink)); - } - - /** - * Lists order item at subscription level. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orderItems as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listOrderItemsAtSubscriptionLevelAsync() { - final String filter = null; - final String expand = null; - final String skipToken = null; - return new PagedFlux<>(() -> listOrderItemsAtSubscriptionLevelSinglePageAsync(filter, expand, skipToken), - nextLink -> listOrderItemsAtSubscriptionLevelNextSinglePageAsync(nextLink)); - } - - /** - * Lists order item at subscription level. - * - * @param filter $filter is supported to filter based on order id. Filter supports only equals operation. - * @param expand $expand is supported on device details, forward shipping details and reverse shipping details - * parameters. Each of these can be provided as a comma separated list. Device Details for order item provides - * details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping - * details respectively. - * @param skipToken $skipToken is supported on Get list of order items, which provides the next page in the list of - * order items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orderItems as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listOrderItemsAtSubscriptionLevelAsync(String filter, String expand, - String skipToken, Context context) { - return new PagedFlux<>( - () -> listOrderItemsAtSubscriptionLevelSinglePageAsync(filter, expand, skipToken, context), - nextLink -> listOrderItemsAtSubscriptionLevelNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists order item at subscription level. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orderItems as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOrderItemsAtSubscriptionLevel() { - final String filter = null; - final String expand = null; - final String skipToken = null; - return new PagedIterable<>(listOrderItemsAtSubscriptionLevelAsync(filter, expand, skipToken)); - } - - /** - * Lists order item at subscription level. - * - * @param filter $filter is supported to filter based on order id. Filter supports only equals operation. - * @param expand $expand is supported on device details, forward shipping details and reverse shipping details - * parameters. Each of these can be provided as a comma separated list. Device Details for order item provides - * details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping - * details respectively. - * @param skipToken $skipToken is supported on Get list of order items, which provides the next page in the list of - * order items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orderItems as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOrderItemsAtSubscriptionLevel(String filter, String expand, - String skipToken, Context context) { - return new PagedIterable<>(listOrderItemsAtSubscriptionLevelAsync(filter, expand, skipToken, context)); - } - - /** - * Lists all the addresses available under the given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter $filter is supported to filter based on shipping address properties. Filter supports only equals - * operation. - * @param skipToken $skipToken is supported on Get list of addresses, which provides the next page in the list of - * address. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return address Resource Collection along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - String filter, String skipToken) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), filter, skipToken, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the addresses available under the given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter $filter is supported to filter based on shipping address properties. Filter supports only equals - * operation. - * @param skipToken $skipToken is supported on Get list of addresses, which provides the next page in the list of - * address. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return address Resource Collection along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - String filter, String skipToken, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), filter, skipToken, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists all the addresses available under the given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter $filter is supported to filter based on shipping address properties. Filter supports only equals - * operation. - * @param skipToken $skipToken is supported on Get list of addresses, which provides the next page in the list of - * address. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return address Resource Collection as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, - String skipToken) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, skipToken), - nextLink -> listAddressesAtResourceGroupLevelNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the addresses available under the given 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 address Resource Collection as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - final String filter = null; - final String skipToken = null; - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, skipToken), - nextLink -> listAddressesAtResourceGroupLevelNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the addresses available under the given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter $filter is supported to filter based on shipping address properties. Filter supports only equals - * operation. - * @param skipToken $skipToken is supported on Get list of addresses, which provides the next page in the list of - * address. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return address Resource Collection as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, - String skipToken, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, skipToken, context), - nextLink -> listAddressesAtResourceGroupLevelNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the addresses available under the given 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 address Resource Collection as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - final String filter = null; - final String skipToken = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, skipToken)); - } - - /** - * Lists all the addresses available under the given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter $filter is supported to filter based on shipping address properties. Filter supports only equals - * operation. - * @param skipToken $skipToken is supported on Get list of addresses, which provides the next page in the list of - * address. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return address Resource Collection as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, String filter, - String skipToken, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, skipToken, context)); - } - - /** - * Gets information about the specified address. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified address along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String addressName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (addressName == null) { - return Mono.error(new IllegalArgumentException("Parameter addressName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, - this.client.getSubscriptionId(), addressName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets information about the specified address. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified address along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String addressName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (addressName == null) { - return Mono.error(new IllegalArgumentException("Parameter addressName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, this.client.getSubscriptionId(), - addressName, this.client.getApiVersion(), accept, context); - } - - /** - * Gets information about the specified address. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified address on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String addressName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, addressName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets information about the specified address. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified address along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, String addressName, - Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, addressName, context).block(); - } - - /** - * Gets information about the specified address. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified address. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AddressResourceInner getByResourceGroup(String resourceGroupName, String addressName) { - return getByResourceGroupWithResponse(resourceGroupName, addressName, Context.NONE).getValue(); - } - - /** - * Creates a new address with the specified parameters. Existing address can be updated with this API. - * - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressResource Address details from request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return address Resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createAddressWithResponseAsync(String addressName, - String resourceGroupName, AddressResourceInner addressResource) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (addressName == null) { - return Mono.error(new IllegalArgumentException("Parameter addressName is required 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 (addressResource == null) { - return Mono - .error(new IllegalArgumentException("Parameter addressResource is required and cannot be null.")); - } else { - addressResource.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createAddress(this.client.getEndpoint(), addressName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), addressResource, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a new address with the specified parameters. Existing address can be updated with this API. - * - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressResource Address details from 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 address Resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createAddressWithResponseAsync(String addressName, - String resourceGroupName, AddressResourceInner addressResource, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (addressName == null) { - return Mono.error(new IllegalArgumentException("Parameter addressName is required 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 (addressResource == null) { - return Mono - .error(new IllegalArgumentException("Parameter addressResource is required and cannot be null.")); - } else { - addressResource.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createAddress(this.client.getEndpoint(), addressName, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), addressResource, accept, context); - } - - /** - * Creates a new address with the specified parameters. Existing address can be updated with this API. - * - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressResource Address details from request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of address Resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AddressResourceInner> - beginCreateAddressAsync(String addressName, String resourceGroupName, AddressResourceInner addressResource) { - Mono>> mono - = createAddressWithResponseAsync(addressName, resourceGroupName, addressResource); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - AddressResourceInner.class, AddressResourceInner.class, this.client.getContext()); - } - - /** - * Creates a new address with the specified parameters. Existing address can be updated with this API. - * - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressResource Address details from 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 address Resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AddressResourceInner> beginCreateAddressAsync( - String addressName, String resourceGroupName, AddressResourceInner addressResource, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createAddressWithResponseAsync(addressName, resourceGroupName, addressResource, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - AddressResourceInner.class, AddressResourceInner.class, context); - } - - /** - * Creates a new address with the specified parameters. Existing address can be updated with this API. - * - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressResource Address details from request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of address Resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AddressResourceInner> beginCreateAddress(String addressName, - String resourceGroupName, AddressResourceInner addressResource) { - return this.beginCreateAddressAsync(addressName, resourceGroupName, addressResource).getSyncPoller(); - } - - /** - * Creates a new address with the specified parameters. Existing address can be updated with this API. - * - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressResource Address details from request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of address Resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AddressResourceInner> beginCreateAddress(String addressName, - String resourceGroupName, AddressResourceInner addressResource, Context context) { - return this.beginCreateAddressAsync(addressName, resourceGroupName, addressResource, context).getSyncPoller(); - } - - /** - * Creates a new address with the specified parameters. Existing address can be updated with this API. - * - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressResource Address details from request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return address Resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAddressAsync(String addressName, String resourceGroupName, - AddressResourceInner addressResource) { - return beginCreateAddressAsync(addressName, resourceGroupName, addressResource).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a new address with the specified parameters. Existing address can be updated with this API. - * - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressResource Address details from 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 address Resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAddressAsync(String addressName, String resourceGroupName, - AddressResourceInner addressResource, Context context) { - return beginCreateAddressAsync(addressName, resourceGroupName, addressResource, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a new address with the specified parameters. Existing address can be updated with this API. - * - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressResource Address details from request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return address Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AddressResourceInner createAddress(String addressName, String resourceGroupName, - AddressResourceInner addressResource) { - return createAddressAsync(addressName, resourceGroupName, addressResource).block(); - } - - /** - * Creates a new address with the specified parameters. Existing address can be updated with this API. - * - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressResource Address details from 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 address Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AddressResourceInner createAddress(String addressName, String resourceGroupName, - AddressResourceInner addressResource, Context context) { - return createAddressAsync(addressName, resourceGroupName, addressResource, context).block(); - } - - /** - * Deletes an address. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 addressName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (addressName == null) { - return Mono.error(new IllegalArgumentException("Parameter addressName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, - this.client.getSubscriptionId(), addressName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes an address. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 addressName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (addressName == null) { - return Mono.error(new IllegalArgumentException("Parameter addressName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, this.client.getSubscriptionId(), - addressName, this.client.getApiVersion(), accept, context); - } - - /** - * Deletes an address. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 addressName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, addressName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes an address. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 addressName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, addressName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Deletes an address. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 addressName) { - return this.beginDeleteAsync(resourceGroupName, addressName).getSyncPoller(); - } - - /** - * Deletes an address. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 addressName, - Context context) { - return this.beginDeleteAsync(resourceGroupName, addressName, context).getSyncPoller(); - } - - /** - * Deletes an address. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 addressName) { - return beginDeleteAsync(resourceGroupName, addressName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes an address. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 addressName, Context context) { - return beginDeleteAsync(resourceGroupName, addressName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes an address. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 addressName) { - deleteAsync(resourceGroupName, addressName).block(); - } - - /** - * Deletes an address. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 addressName, Context context) { - deleteAsync(resourceGroupName, addressName, context).block(); - } - - /** - * Updates the properties of an existing address. - * - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressUpdateParameter Address update parameters from request body. - * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the - * server matches this value. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return address Resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateAddressWithResponseAsync(String addressName, - String resourceGroupName, AddressUpdateParameter addressUpdateParameter, String ifMatch) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (addressName == null) { - return Mono.error(new IllegalArgumentException("Parameter addressName is required 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 (addressUpdateParameter == null) { - return Mono.error( - new IllegalArgumentException("Parameter addressUpdateParameter is required and cannot be null.")); - } else { - addressUpdateParameter.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.updateAddress(this.client.getEndpoint(), addressName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), ifMatch, - addressUpdateParameter, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the properties of an existing address. - * - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressUpdateParameter Address update parameters from request body. - * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the - * server matches this value. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return address Resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateAddressWithResponseAsync(String addressName, - String resourceGroupName, AddressUpdateParameter addressUpdateParameter, String ifMatch, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (addressName == null) { - return Mono.error(new IllegalArgumentException("Parameter addressName is required 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 (addressUpdateParameter == null) { - return Mono.error( - new IllegalArgumentException("Parameter addressUpdateParameter is required and cannot be null.")); - } else { - addressUpdateParameter.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.updateAddress(this.client.getEndpoint(), addressName, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), ifMatch, addressUpdateParameter, accept, context); - } - - /** - * Updates the properties of an existing address. - * - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressUpdateParameter Address update parameters from request body. - * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the - * server matches this value. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 address Resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AddressResourceInner> beginUpdateAddressAsync( - String addressName, String resourceGroupName, AddressUpdateParameter addressUpdateParameter, String ifMatch) { - Mono>> mono - = updateAddressWithResponseAsync(addressName, resourceGroupName, addressUpdateParameter, ifMatch); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - AddressResourceInner.class, AddressResourceInner.class, this.client.getContext()); - } - - /** - * Updates the properties of an existing address. - * - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressUpdateParameter Address update parameters from request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of address Resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AddressResourceInner> beginUpdateAddressAsync( - String addressName, String resourceGroupName, AddressUpdateParameter addressUpdateParameter) { - final String ifMatch = null; - Mono>> mono - = updateAddressWithResponseAsync(addressName, resourceGroupName, addressUpdateParameter, ifMatch); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - AddressResourceInner.class, AddressResourceInner.class, this.client.getContext()); - } - - /** - * Updates the properties of an existing address. - * - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressUpdateParameter Address update parameters from request body. - * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the - * server matches this value. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 address Resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AddressResourceInner> beginUpdateAddressAsync( - String addressName, String resourceGroupName, AddressUpdateParameter addressUpdateParameter, String ifMatch, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = updateAddressWithResponseAsync(addressName, resourceGroupName, addressUpdateParameter, ifMatch, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - AddressResourceInner.class, AddressResourceInner.class, context); - } - - /** - * Updates the properties of an existing address. - * - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressUpdateParameter Address update parameters from request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of address Resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AddressResourceInner> beginUpdateAddress(String addressName, - String resourceGroupName, AddressUpdateParameter addressUpdateParameter) { - final String ifMatch = null; - return this.beginUpdateAddressAsync(addressName, resourceGroupName, addressUpdateParameter, ifMatch) - .getSyncPoller(); - } - - /** - * Updates the properties of an existing address. - * - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressUpdateParameter Address update parameters from request body. - * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the - * server matches this value. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 address Resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AddressResourceInner> beginUpdateAddress(String addressName, - String resourceGroupName, AddressUpdateParameter addressUpdateParameter, String ifMatch, Context context) { - return this.beginUpdateAddressAsync(addressName, resourceGroupName, addressUpdateParameter, ifMatch, context) - .getSyncPoller(); - } - - /** - * Updates the properties of an existing address. - * - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressUpdateParameter Address update parameters from request body. - * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the - * server matches this value. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return address Resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAddressAsync(String addressName, String resourceGroupName, - AddressUpdateParameter addressUpdateParameter, String ifMatch) { - return beginUpdateAddressAsync(addressName, resourceGroupName, addressUpdateParameter, ifMatch).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates the properties of an existing address. - * - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressUpdateParameter Address update parameters from request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return address Resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAddressAsync(String addressName, String resourceGroupName, - AddressUpdateParameter addressUpdateParameter) { - final String ifMatch = null; - return beginUpdateAddressAsync(addressName, resourceGroupName, addressUpdateParameter, ifMatch).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates the properties of an existing address. - * - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressUpdateParameter Address update parameters from request body. - * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the - * server matches this value. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return address Resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAddressAsync(String addressName, String resourceGroupName, - AddressUpdateParameter addressUpdateParameter, String ifMatch, Context context) { - return beginUpdateAddressAsync(addressName, resourceGroupName, addressUpdateParameter, ifMatch, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates the properties of an existing address. - * - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressUpdateParameter Address update parameters from request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return address Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AddressResourceInner updateAddress(String addressName, String resourceGroupName, - AddressUpdateParameter addressUpdateParameter) { - final String ifMatch = null; - return updateAddressAsync(addressName, resourceGroupName, addressUpdateParameter, ifMatch).block(); - } - - /** - * Updates the properties of an existing address. - * - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressUpdateParameter Address update parameters from request body. - * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the - * server matches this value. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return address Resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AddressResourceInner updateAddress(String addressName, String resourceGroupName, - AddressUpdateParameter addressUpdateParameter, String ifMatch, Context context) { - return updateAddressAsync(addressName, resourceGroupName, addressUpdateParameter, ifMatch, context).block(); - } - - /** - * Lists order at resource group level. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param skipToken $skipToken is supported on Get list of order, which provides the next page in the list of order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orders along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listOrderAtResourceGroupLevelSinglePageAsync(String resourceGroupName, String skipToken) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listOrderAtResourceGroupLevel(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), skipToken, accept, - context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists order at resource group level. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param skipToken $skipToken is supported on Get list of order, which provides the next page in the list of order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orders along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listOrderAtResourceGroupLevelSinglePageAsync(String resourceGroupName, String skipToken, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listOrderAtResourceGroupLevel(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), skipToken, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists order at resource group level. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param skipToken $skipToken is supported on Get list of order, which provides the next page in the list of order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orders as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listOrderAtResourceGroupLevelAsync(String resourceGroupName, - String skipToken) { - return new PagedFlux<>(() -> listOrderAtResourceGroupLevelSinglePageAsync(resourceGroupName, skipToken), - nextLink -> listOrderAtResourceGroupLevelNextSinglePageAsync(nextLink)); - } - - /** - * Lists order at resource group level. - * - * @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 list of orders as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listOrderAtResourceGroupLevelAsync(String resourceGroupName) { - final String skipToken = null; - return new PagedFlux<>(() -> listOrderAtResourceGroupLevelSinglePageAsync(resourceGroupName, skipToken), - nextLink -> listOrderAtResourceGroupLevelNextSinglePageAsync(nextLink)); - } - - /** - * Lists order at resource group level. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param skipToken $skipToken is supported on Get list of order, which provides the next page in the list of order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orders as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listOrderAtResourceGroupLevelAsync(String resourceGroupName, String skipToken, - Context context) { - return new PagedFlux<>( - () -> listOrderAtResourceGroupLevelSinglePageAsync(resourceGroupName, skipToken, context), - nextLink -> listOrderAtResourceGroupLevelNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists order at resource group level. - * - * @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 list of orders as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOrderAtResourceGroupLevel(String resourceGroupName) { - final String skipToken = null; - return new PagedIterable<>(listOrderAtResourceGroupLevelAsync(resourceGroupName, skipToken)); - } - - /** - * Lists order at resource group level. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param skipToken $skipToken is supported on Get list of order, which provides the next page in the list of order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orders as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOrderAtResourceGroupLevel(String resourceGroupName, String skipToken, - Context context) { - return new PagedIterable<>(listOrderAtResourceGroupLevelAsync(resourceGroupName, skipToken, context)); - } - - /** - * Gets an order. - * - * @param orderName The name of the order. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param location The name of Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 order along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getOrderByNameWithResponseAsync(String orderName, - String resourceGroupName, String location) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (orderName == null) { - return Mono.error(new IllegalArgumentException("Parameter orderName is required 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 (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.getOrderByName(this.client.getEndpoint(), orderName, this.client.getSubscriptionId(), - resourceGroupName, location, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets an order. - * - * @param orderName The name of the order. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param location The name of Azure region. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 order along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getOrderByNameWithResponseAsync(String orderName, - String resourceGroupName, String location, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (orderName == null) { - return Mono.error(new IllegalArgumentException("Parameter orderName is required 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 (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getOrderByName(this.client.getEndpoint(), orderName, this.client.getSubscriptionId(), - resourceGroupName, location, this.client.getApiVersion(), accept, context); - } - - /** - * Gets an order. - * - * @param orderName The name of the order. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param location The name of Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 order on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getOrderByNameAsync(String orderName, String resourceGroupName, String location) { - return getOrderByNameWithResponseAsync(orderName, resourceGroupName, location) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets an order. - * - * @param orderName The name of the order. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param location The name of Azure region. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 order along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getOrderByNameWithResponse(String orderName, String resourceGroupName, - String location, Context context) { - return getOrderByNameWithResponseAsync(orderName, resourceGroupName, location, context).block(); - } - - /** - * Gets an order. - * - * @param orderName The name of the order. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param location The name of Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OrderResourceInner getOrderByName(String orderName, String resourceGroupName, String location) { - return getOrderByNameWithResponse(orderName, resourceGroupName, location, Context.NONE).getValue(); - } - - /** - * Lists order item at resource group level. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter $filter is supported to filter based on order id. Filter supports only equals operation. - * @param expand $expand is supported on device details, forward shipping details and reverse shipping details - * parameters. Each of these can be provided as a comma separated list. Device Details for order item provides - * details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping - * details respectively. - * @param skipToken $skipToken is supported on Get list of order items, which provides the next page in the list of - * order 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 list of orderItems along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOrderItemsAtResourceGroupLevelSinglePageAsync( - String resourceGroupName, String filter, String expand, String skipToken) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listOrderItemsAtResourceGroupLevel(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), filter, expand, - skipToken, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists order item at resource group level. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter $filter is supported to filter based on order id. Filter supports only equals operation. - * @param expand $expand is supported on device details, forward shipping details and reverse shipping details - * parameters. Each of these can be provided as a comma separated list. Device Details for order item provides - * details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping - * details respectively. - * @param skipToken $skipToken is supported on Get list of order items, which provides the next page in the list of - * order items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orderItems along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOrderItemsAtResourceGroupLevelSinglePageAsync( - String resourceGroupName, String filter, String expand, String skipToken, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listOrderItemsAtResourceGroupLevel(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), filter, expand, skipToken, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists order item at resource group level. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter $filter is supported to filter based on order id. Filter supports only equals operation. - * @param expand $expand is supported on device details, forward shipping details and reverse shipping details - * parameters. Each of these can be provided as a comma separated list. Device Details for order item provides - * details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping - * details respectively. - * @param skipToken $skipToken is supported on Get list of order items, which provides the next page in the list of - * order 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 list of orderItems as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listOrderItemsAtResourceGroupLevelAsync(String resourceGroupName, - String filter, String expand, String skipToken) { - return new PagedFlux<>( - () -> listOrderItemsAtResourceGroupLevelSinglePageAsync(resourceGroupName, filter, expand, skipToken), - nextLink -> listOrderItemsAtResourceGroupLevelNextSinglePageAsync(nextLink)); - } - - /** - * Lists order item at resource group level. - * - * @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 list of orderItems as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listOrderItemsAtResourceGroupLevelAsync(String resourceGroupName) { - final String filter = null; - final String expand = null; - final String skipToken = null; - return new PagedFlux<>( - () -> listOrderItemsAtResourceGroupLevelSinglePageAsync(resourceGroupName, filter, expand, skipToken), - nextLink -> listOrderItemsAtResourceGroupLevelNextSinglePageAsync(nextLink)); - } - - /** - * Lists order item at resource group level. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter $filter is supported to filter based on order id. Filter supports only equals operation. - * @param expand $expand is supported on device details, forward shipping details and reverse shipping details - * parameters. Each of these can be provided as a comma separated list. Device Details for order item provides - * details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping - * details respectively. - * @param skipToken $skipToken is supported on Get list of order items, which provides the next page in the list of - * order items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orderItems as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listOrderItemsAtResourceGroupLevelAsync(String resourceGroupName, - String filter, String expand, String skipToken, Context context) { - return new PagedFlux<>(() -> listOrderItemsAtResourceGroupLevelSinglePageAsync(resourceGroupName, filter, - expand, skipToken, context), - nextLink -> listOrderItemsAtResourceGroupLevelNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists order item at resource group level. - * - * @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 list of orderItems as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOrderItemsAtResourceGroupLevel(String resourceGroupName) { - final String filter = null; - final String expand = null; - final String skipToken = null; - return new PagedIterable<>( - listOrderItemsAtResourceGroupLevelAsync(resourceGroupName, filter, expand, skipToken)); - } - - /** - * Lists order item at resource group level. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter $filter is supported to filter based on order id. Filter supports only equals operation. - * @param expand $expand is supported on device details, forward shipping details and reverse shipping details - * parameters. Each of these can be provided as a comma separated list. Device Details for order item provides - * details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping - * details respectively. - * @param skipToken $skipToken is supported on Get list of order items, which provides the next page in the list of - * order items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orderItems as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOrderItemsAtResourceGroupLevel(String resourceGroupName, - String filter, String expand, String skipToken, Context context) { - return new PagedIterable<>( - listOrderItemsAtResourceGroupLevelAsync(resourceGroupName, filter, expand, skipToken, context)); - } - - /** - * Gets an order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param expand $expand is supported on device details, forward shipping details and reverse shipping details - * parameters. Each of these can be provided as a comma separated list. Device Details for order item provides - * details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping - * details respectively. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 order item along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getOrderItemByNameWithResponseAsync(String orderItemName, - String resourceGroupName, String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (orderItemName == null) { - return Mono.error(new IllegalArgumentException("Parameter orderItemName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getOrderItemByName(this.client.getEndpoint(), orderItemName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), expand, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets an order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param expand $expand is supported on device details, forward shipping details and reverse shipping details - * parameters. Each of these can be provided as a comma separated list. Device Details for order item provides - * details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping - * details respectively. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 order item along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getOrderItemByNameWithResponseAsync(String orderItemName, - String resourceGroupName, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (orderItemName == null) { - return Mono.error(new IllegalArgumentException("Parameter orderItemName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getOrderItemByName(this.client.getEndpoint(), orderItemName, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), expand, accept, context); - } - - /** - * Gets an order item. - * - * @param orderItemName The name of the order item. - * @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 an order item on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getOrderItemByNameAsync(String orderItemName, String resourceGroupName) { - final String expand = null; - return getOrderItemByNameWithResponseAsync(orderItemName, resourceGroupName, expand) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets an order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param expand $expand is supported on device details, forward shipping details and reverse shipping details - * parameters. Each of these can be provided as a comma separated list. Device Details for order item provides - * details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping - * details respectively. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 order item along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getOrderItemByNameWithResponse(String orderItemName, - String resourceGroupName, String expand, Context context) { - return getOrderItemByNameWithResponseAsync(orderItemName, resourceGroupName, expand, context).block(); - } - - /** - * Gets an order item. - * - * @param orderItemName The name of the order item. - * @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 an order item. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OrderItemResourceInner getOrderItemByName(String orderItemName, String resourceGroupName) { - final String expand = null; - return getOrderItemByNameWithResponse(orderItemName, resourceGroupName, expand, Context.NONE).getValue(); - } - - /** - * Creates an order item. Existing order item cannot be updated with this api and should instead be updated with the - * Update order item API. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param orderItemResource Order item details from request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents order item contract along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrderItemWithResponseAsync(String orderItemName, - String resourceGroupName, OrderItemResourceInner orderItemResource) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (orderItemName == null) { - return Mono.error(new IllegalArgumentException("Parameter orderItemName is required 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 (orderItemResource == null) { - return Mono - .error(new IllegalArgumentException("Parameter orderItemResource is required and cannot be null.")); - } else { - orderItemResource.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrderItem(this.client.getEndpoint(), orderItemName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), orderItemResource, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates an order item. Existing order item cannot be updated with this api and should instead be updated with the - * Update order item API. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param orderItemResource Order item details from 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 represents order item contract along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrderItemWithResponseAsync(String orderItemName, - String resourceGroupName, OrderItemResourceInner orderItemResource, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (orderItemName == null) { - return Mono.error(new IllegalArgumentException("Parameter orderItemName is required 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 (orderItemResource == null) { - return Mono - .error(new IllegalArgumentException("Parameter orderItemResource is required and cannot be null.")); - } else { - orderItemResource.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrderItem(this.client.getEndpoint(), orderItemName, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), orderItemResource, accept, context); - } - - /** - * Creates an order item. Existing order item cannot be updated with this api and should instead be updated with the - * Update order item API. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param orderItemResource Order item details from request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of represents order item contract. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OrderItemResourceInner> beginCreateOrderItemAsync( - String orderItemName, String resourceGroupName, OrderItemResourceInner orderItemResource) { - Mono>> mono - = createOrderItemWithResponseAsync(orderItemName, resourceGroupName, orderItemResource); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), OrderItemResourceInner.class, OrderItemResourceInner.class, - this.client.getContext()); - } - - /** - * Creates an order item. Existing order item cannot be updated with this api and should instead be updated with the - * Update order item API. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param orderItemResource Order item details from 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 represents order item contract. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OrderItemResourceInner> beginCreateOrderItemAsync( - String orderItemName, String resourceGroupName, OrderItemResourceInner orderItemResource, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createOrderItemWithResponseAsync(orderItemName, resourceGroupName, orderItemResource, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), OrderItemResourceInner.class, OrderItemResourceInner.class, context); - } - - /** - * Creates an order item. Existing order item cannot be updated with this api and should instead be updated with the - * Update order item API. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param orderItemResource Order item details from request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents order item contract. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OrderItemResourceInner> - beginCreateOrderItem(String orderItemName, String resourceGroupName, OrderItemResourceInner orderItemResource) { - return this.beginCreateOrderItemAsync(orderItemName, resourceGroupName, orderItemResource).getSyncPoller(); - } - - /** - * Creates an order item. Existing order item cannot be updated with this api and should instead be updated with the - * Update order item API. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param orderItemResource Order item details from request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents order item contract. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OrderItemResourceInner> beginCreateOrderItem( - String orderItemName, String resourceGroupName, OrderItemResourceInner orderItemResource, Context context) { - return this.beginCreateOrderItemAsync(orderItemName, resourceGroupName, orderItemResource, context) - .getSyncPoller(); - } - - /** - * Creates an order item. Existing order item cannot be updated with this api and should instead be updated with the - * Update order item API. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param orderItemResource Order item details from request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents order item contract on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrderItemAsync(String orderItemName, String resourceGroupName, - OrderItemResourceInner orderItemResource) { - return beginCreateOrderItemAsync(orderItemName, resourceGroupName, orderItemResource).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates an order item. Existing order item cannot be updated with this api and should instead be updated with the - * Update order item API. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param orderItemResource Order item details from 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 represents order item contract on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrderItemAsync(String orderItemName, String resourceGroupName, - OrderItemResourceInner orderItemResource, Context context) { - return beginCreateOrderItemAsync(orderItemName, resourceGroupName, orderItemResource, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates an order item. Existing order item cannot be updated with this api and should instead be updated with the - * Update order item API. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param orderItemResource Order item details from request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents order item contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OrderItemResourceInner createOrderItem(String orderItemName, String resourceGroupName, - OrderItemResourceInner orderItemResource) { - return createOrderItemAsync(orderItemName, resourceGroupName, orderItemResource).block(); - } - - /** - * Creates an order item. Existing order item cannot be updated with this api and should instead be updated with the - * Update order item API. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param orderItemResource Order item details from 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 represents order item contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OrderItemResourceInner createOrderItem(String orderItemName, String resourceGroupName, - OrderItemResourceInner orderItemResource, Context context) { - return createOrderItemAsync(orderItemName, resourceGroupName, orderItemResource, context).block(); - } - - /** - * Deletes an order item. - * - * @param orderItemName The name of the order item. - * @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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteOrderItemByNameWithResponseAsync(String orderItemName, - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (orderItemName == null) { - return Mono.error(new IllegalArgumentException("Parameter orderItemName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.deleteOrderItemByName(this.client.getEndpoint(), orderItemName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes an order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteOrderItemByNameWithResponseAsync(String orderItemName, - 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 (orderItemName == null) { - return Mono.error(new IllegalArgumentException("Parameter orderItemName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.deleteOrderItemByName(this.client.getEndpoint(), orderItemName, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accept, context); - } - - /** - * Deletes an order item. - * - * @param orderItemName The name of the order item. - * @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 {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteOrderItemByNameAsync(String orderItemName, - String resourceGroupName) { - Mono>> mono - = deleteOrderItemByNameWithResponseAsync(orderItemName, resourceGroupName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes an order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteOrderItemByNameAsync(String orderItemName, - String resourceGroupName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteOrderItemByNameWithResponseAsync(orderItemName, resourceGroupName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Deletes an order item. - * - * @param orderItemName The name of the order item. - * @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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteOrderItemByName(String orderItemName, - String resourceGroupName) { - return this.beginDeleteOrderItemByNameAsync(orderItemName, resourceGroupName).getSyncPoller(); - } - - /** - * Deletes an order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteOrderItemByName(String orderItemName, String resourceGroupName, - Context context) { - return this.beginDeleteOrderItemByNameAsync(orderItemName, resourceGroupName, context).getSyncPoller(); - } - - /** - * Deletes an order item. - * - * @param orderItemName The name of the order item. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteOrderItemByNameAsync(String orderItemName, String resourceGroupName) { - return beginDeleteOrderItemByNameAsync(orderItemName, resourceGroupName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes an order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteOrderItemByNameAsync(String orderItemName, String resourceGroupName, Context context) { - return beginDeleteOrderItemByNameAsync(orderItemName, resourceGroupName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes an order item. - * - * @param orderItemName The name of the order item. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteOrderItemByName(String orderItemName, String resourceGroupName) { - deleteOrderItemByNameAsync(orderItemName, resourceGroupName).block(); - } - - /** - * Deletes an order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteOrderItemByName(String orderItemName, String resourceGroupName, Context context) { - deleteOrderItemByNameAsync(orderItemName, resourceGroupName, context).block(); - } - - /** - * Updates the properties of an existing order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param orderItemUpdateParameter order item update parameters from request body. - * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the order on the - * server matches this value. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents order item contract along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateOrderItemWithResponseAsync(String orderItemName, - String resourceGroupName, OrderItemUpdateParameter orderItemUpdateParameter, String ifMatch) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (orderItemName == null) { - return Mono.error(new IllegalArgumentException("Parameter orderItemName is required 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 (orderItemUpdateParameter == null) { - return Mono.error( - new IllegalArgumentException("Parameter orderItemUpdateParameter is required and cannot be null.")); - } else { - orderItemUpdateParameter.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.updateOrderItem(this.client.getEndpoint(), orderItemName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), ifMatch, - orderItemUpdateParameter, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the properties of an existing order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param orderItemUpdateParameter order item update parameters from request body. - * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the order on the - * server matches this value. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents order item contract along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateOrderItemWithResponseAsync(String orderItemName, - String resourceGroupName, OrderItemUpdateParameter orderItemUpdateParameter, String ifMatch, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (orderItemName == null) { - return Mono.error(new IllegalArgumentException("Parameter orderItemName is required 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 (orderItemUpdateParameter == null) { - return Mono.error( - new IllegalArgumentException("Parameter orderItemUpdateParameter is required and cannot be null.")); - } else { - orderItemUpdateParameter.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.updateOrderItem(this.client.getEndpoint(), orderItemName, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), ifMatch, orderItemUpdateParameter, accept, context); - } - - /** - * Updates the properties of an existing order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param orderItemUpdateParameter order item update parameters from request body. - * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the order on the - * server matches this value. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 represents order item contract. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OrderItemResourceInner> beginUpdateOrderItemAsync( - String orderItemName, String resourceGroupName, OrderItemUpdateParameter orderItemUpdateParameter, - String ifMatch) { - Mono>> mono - = updateOrderItemWithResponseAsync(orderItemName, resourceGroupName, orderItemUpdateParameter, ifMatch); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), OrderItemResourceInner.class, OrderItemResourceInner.class, - this.client.getContext()); - } - - /** - * Updates the properties of an existing order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param orderItemUpdateParameter order item update parameters from request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of represents order item contract. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OrderItemResourceInner> beginUpdateOrderItemAsync( - String orderItemName, String resourceGroupName, OrderItemUpdateParameter orderItemUpdateParameter) { - final String ifMatch = null; - Mono>> mono - = updateOrderItemWithResponseAsync(orderItemName, resourceGroupName, orderItemUpdateParameter, ifMatch); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), OrderItemResourceInner.class, OrderItemResourceInner.class, - this.client.getContext()); - } - - /** - * Updates the properties of an existing order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param orderItemUpdateParameter order item update parameters from request body. - * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the order on the - * server matches this value. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 represents order item contract. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OrderItemResourceInner> beginUpdateOrderItemAsync( - String orderItemName, String resourceGroupName, OrderItemUpdateParameter orderItemUpdateParameter, - String ifMatch, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = updateOrderItemWithResponseAsync(orderItemName, resourceGroupName, - orderItemUpdateParameter, ifMatch, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), OrderItemResourceInner.class, OrderItemResourceInner.class, context); - } - - /** - * Updates the properties of an existing order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param orderItemUpdateParameter order item update parameters from request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents order item contract. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OrderItemResourceInner> beginUpdateOrderItem( - String orderItemName, String resourceGroupName, OrderItemUpdateParameter orderItemUpdateParameter) { - final String ifMatch = null; - return this.beginUpdateOrderItemAsync(orderItemName, resourceGroupName, orderItemUpdateParameter, ifMatch) - .getSyncPoller(); - } - - /** - * Updates the properties of an existing order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param orderItemUpdateParameter order item update parameters from request body. - * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the order on the - * server matches this value. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 represents order item contract. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OrderItemResourceInner> beginUpdateOrderItem( - String orderItemName, String resourceGroupName, OrderItemUpdateParameter orderItemUpdateParameter, - String ifMatch, Context context) { - return this - .beginUpdateOrderItemAsync(orderItemName, resourceGroupName, orderItemUpdateParameter, ifMatch, context) - .getSyncPoller(); - } - - /** - * Updates the properties of an existing order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param orderItemUpdateParameter order item update parameters from request body. - * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the order on the - * server matches this value. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents order item contract on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateOrderItemAsync(String orderItemName, String resourceGroupName, - OrderItemUpdateParameter orderItemUpdateParameter, String ifMatch) { - return beginUpdateOrderItemAsync(orderItemName, resourceGroupName, orderItemUpdateParameter, ifMatch).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates the properties of an existing order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param orderItemUpdateParameter order item update parameters from request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents order item contract on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateOrderItemAsync(String orderItemName, String resourceGroupName, - OrderItemUpdateParameter orderItemUpdateParameter) { - final String ifMatch = null; - return beginUpdateOrderItemAsync(orderItemName, resourceGroupName, orderItemUpdateParameter, ifMatch).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates the properties of an existing order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param orderItemUpdateParameter order item update parameters from request body. - * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the order on the - * server matches this value. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents order item contract on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateOrderItemAsync(String orderItemName, String resourceGroupName, - OrderItemUpdateParameter orderItemUpdateParameter, String ifMatch, Context context) { - return beginUpdateOrderItemAsync(orderItemName, resourceGroupName, orderItemUpdateParameter, ifMatch, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates the properties of an existing order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param orderItemUpdateParameter order item update parameters from request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents order item contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OrderItemResourceInner updateOrderItem(String orderItemName, String resourceGroupName, - OrderItemUpdateParameter orderItemUpdateParameter) { - final String ifMatch = null; - return updateOrderItemAsync(orderItemName, resourceGroupName, orderItemUpdateParameter, ifMatch).block(); - } - - /** - * Updates the properties of an existing order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param orderItemUpdateParameter order item update parameters from request body. - * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the order on the - * server matches this value. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents order item contract. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OrderItemResourceInner updateOrderItem(String orderItemName, String resourceGroupName, - OrderItemUpdateParameter orderItemUpdateParameter, String ifMatch, Context context) { - return updateOrderItemAsync(orderItemName, resourceGroupName, orderItemUpdateParameter, ifMatch, context) - .block(); - } - - /** - * Cancel order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cancellationReason Reason for cancellation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> cancelOrderItemWithResponseAsync(String orderItemName, String resourceGroupName, - CancellationReason cancellationReason) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (orderItemName == null) { - return Mono.error(new IllegalArgumentException("Parameter orderItemName is required 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 (cancellationReason == null) { - return Mono - .error(new IllegalArgumentException("Parameter cancellationReason is required and cannot be null.")); - } else { - cancellationReason.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.cancelOrderItem(this.client.getEndpoint(), orderItemName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), cancellationReason, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Cancel order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cancellationReason Reason for cancellation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> cancelOrderItemWithResponseAsync(String orderItemName, String resourceGroupName, - CancellationReason cancellationReason, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (orderItemName == null) { - return Mono.error(new IllegalArgumentException("Parameter orderItemName is required 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 (cancellationReason == null) { - return Mono - .error(new IllegalArgumentException("Parameter cancellationReason is required and cannot be null.")); - } else { - cancellationReason.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.cancelOrderItem(this.client.getEndpoint(), orderItemName, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), cancellationReason, accept, context); - } - - /** - * Cancel order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cancellationReason Reason for cancellation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 cancelOrderItemAsync(String orderItemName, String resourceGroupName, - CancellationReason cancellationReason) { - return cancelOrderItemWithResponseAsync(orderItemName, resourceGroupName, cancellationReason) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Cancel order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cancellationReason Reason for cancellation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response cancelOrderItemWithResponse(String orderItemName, String resourceGroupName, - CancellationReason cancellationReason, Context context) { - return cancelOrderItemWithResponseAsync(orderItemName, resourceGroupName, cancellationReason, context).block(); - } - - /** - * Cancel order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cancellationReason Reason for cancellation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 cancelOrderItem(String orderItemName, String resourceGroupName, CancellationReason cancellationReason) { - cancelOrderItemWithResponse(orderItemName, resourceGroupName, cancellationReason, Context.NONE); - } - - /** - * Return order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param returnOrderItemDetails Return order item CurrentStatus. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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>> returnOrderItemWithResponseAsync(String orderItemName, - String resourceGroupName, ReturnOrderItemDetails returnOrderItemDetails) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (orderItemName == null) { - return Mono.error(new IllegalArgumentException("Parameter orderItemName is required 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 (returnOrderItemDetails == null) { - return Mono.error( - new IllegalArgumentException("Parameter returnOrderItemDetails is required and cannot be null.")); - } else { - returnOrderItemDetails.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.returnOrderItem(this.client.getEndpoint(), orderItemName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), returnOrderItemDetails, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Return order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param returnOrderItemDetails Return order item CurrentStatus. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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>> returnOrderItemWithResponseAsync(String orderItemName, - String resourceGroupName, ReturnOrderItemDetails returnOrderItemDetails, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (orderItemName == null) { - return Mono.error(new IllegalArgumentException("Parameter orderItemName is required 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 (returnOrderItemDetails == null) { - return Mono.error( - new IllegalArgumentException("Parameter returnOrderItemDetails is required and cannot be null.")); - } else { - returnOrderItemDetails.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.returnOrderItem(this.client.getEndpoint(), orderItemName, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), returnOrderItemDetails, accept, context); - } - - /** - * Return order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param returnOrderItemDetails Return order item CurrentStatus. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginReturnOrderItemAsync(String orderItemName, String resourceGroupName, - ReturnOrderItemDetails returnOrderItemDetails) { - Mono>> mono - = returnOrderItemWithResponseAsync(orderItemName, resourceGroupName, returnOrderItemDetails); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Return order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param returnOrderItemDetails Return order item CurrentStatus. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginReturnOrderItemAsync(String orderItemName, String resourceGroupName, - ReturnOrderItemDetails returnOrderItemDetails, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = returnOrderItemWithResponseAsync(orderItemName, resourceGroupName, returnOrderItemDetails, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Return order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param returnOrderItemDetails Return order item CurrentStatus. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginReturnOrderItem(String orderItemName, String resourceGroupName, - ReturnOrderItemDetails returnOrderItemDetails) { - return this.beginReturnOrderItemAsync(orderItemName, resourceGroupName, returnOrderItemDetails).getSyncPoller(); - } - - /** - * Return order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param returnOrderItemDetails Return order item CurrentStatus. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginReturnOrderItem(String orderItemName, String resourceGroupName, - ReturnOrderItemDetails returnOrderItemDetails, Context context) { - return this.beginReturnOrderItemAsync(orderItemName, resourceGroupName, returnOrderItemDetails, context) - .getSyncPoller(); - } - - /** - * Return order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param returnOrderItemDetails Return order item CurrentStatus. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 returnOrderItemAsync(String orderItemName, String resourceGroupName, - ReturnOrderItemDetails returnOrderItemDetails) { - return beginReturnOrderItemAsync(orderItemName, resourceGroupName, returnOrderItemDetails).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Return order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param returnOrderItemDetails Return order item CurrentStatus. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 returnOrderItemAsync(String orderItemName, String resourceGroupName, - ReturnOrderItemDetails returnOrderItemDetails, Context context) { - return beginReturnOrderItemAsync(orderItemName, resourceGroupName, returnOrderItemDetails, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Return order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param returnOrderItemDetails Return order item CurrentStatus. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 returnOrderItem(String orderItemName, String resourceGroupName, - ReturnOrderItemDetails returnOrderItemDetails) { - returnOrderItemAsync(orderItemName, resourceGroupName, returnOrderItemDetails).block(); - } - - /** - * Return order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param returnOrderItemDetails Return order item CurrentStatus. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 returnOrderItem(String orderItemName, String resourceGroupName, - ReturnOrderItemDetails returnOrderItemDetails, Context context) { - returnOrderItemAsync(orderItemName, resourceGroupName, returnOrderItemDetails, context).block(); - } - - /** - * 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} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOperationsNextSinglePageAsync(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.listOperationsNext(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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOperationsNextSinglePageAsync(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.listOperationsNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The 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 address Resource Collection along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listAddressesAtSubscriptionLevelNextSinglePageAsync(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.listAddressesAtSubscriptionLevelNext(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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return address Resource Collection along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listAddressesAtSubscriptionLevelNextSinglePageAsync(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.listAddressesAtSubscriptionLevelNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The 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 list of product families along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listProductFamiliesNextSinglePageAsync(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.listProductFamiliesNext(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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of product families along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listProductFamiliesNextSinglePageAsync(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.listProductFamiliesNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The 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 list of configurations along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listConfigurationsNextSinglePageAsync(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.listConfigurationsNext(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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of configurations along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listConfigurationsNextSinglePageAsync(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.listConfigurationsNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The 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 holds details about product family metadata along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listProductFamiliesMetadataNextSinglePageAsync(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.listProductFamiliesMetadataNext(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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return holds details about product family metadata along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listProductFamiliesMetadataNextSinglePageAsync(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.listProductFamiliesMetadataNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The 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 list of orders along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOrderAtSubscriptionLevelNextSinglePageAsync(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.listOrderAtSubscriptionLevelNext(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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orders along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOrderAtSubscriptionLevelNextSinglePageAsync(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.listOrderAtSubscriptionLevelNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The 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 list of orderItems along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listOrderItemsAtSubscriptionLevelNextSinglePageAsync(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.listOrderItemsAtSubscriptionLevelNext(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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orderItems along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listOrderItemsAtSubscriptionLevelNextSinglePageAsync(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.listOrderItemsAtSubscriptionLevelNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The 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 address Resource Collection along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listAddressesAtResourceGroupLevelNextSinglePageAsync(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.listAddressesAtResourceGroupLevelNext(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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return address Resource Collection along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listAddressesAtResourceGroupLevelNextSinglePageAsync(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.listAddressesAtResourceGroupLevelNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The 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 list of orders along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOrderAtResourceGroupLevelNextSinglePageAsync(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.listOrderAtResourceGroupLevelNext(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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orders along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOrderAtResourceGroupLevelNextSinglePageAsync(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.listOrderAtResourceGroupLevelNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The 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 list of orderItems along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listOrderItemsAtResourceGroupLevelNextSinglePageAsync(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.listOrderItemsAtResourceGroupLevelNext(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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orderItems along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listOrderItemsAtResourceGroupLevelNextSinglePageAsync(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.listOrderItemsAtResourceGroupLevelNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/ResourceProvidersImpl.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/ResourceProvidersImpl.java deleted file mode 100644 index 34a38aafc108..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/ResourceProvidersImpl.java +++ /dev/null @@ -1,391 +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.edgeorder.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.edgeorder.fluent.ResourceProvidersClient; -import com.azure.resourcemanager.edgeorder.fluent.models.AddressResourceInner; -import com.azure.resourcemanager.edgeorder.fluent.models.ConfigurationInner; -import com.azure.resourcemanager.edgeorder.fluent.models.OperationInner; -import com.azure.resourcemanager.edgeorder.fluent.models.OrderItemResourceInner; -import com.azure.resourcemanager.edgeorder.fluent.models.OrderResourceInner; -import com.azure.resourcemanager.edgeorder.fluent.models.ProductFamiliesMetadataDetailsInner; -import com.azure.resourcemanager.edgeorder.fluent.models.ProductFamilyInner; -import com.azure.resourcemanager.edgeorder.models.AddressResource; -import com.azure.resourcemanager.edgeorder.models.CancellationReason; -import com.azure.resourcemanager.edgeorder.models.Configuration; -import com.azure.resourcemanager.edgeorder.models.ConfigurationsRequest; -import com.azure.resourcemanager.edgeorder.models.Operation; -import com.azure.resourcemanager.edgeorder.models.OrderItemResource; -import com.azure.resourcemanager.edgeorder.models.OrderResource; -import com.azure.resourcemanager.edgeorder.models.ProductFamiliesMetadataDetails; -import com.azure.resourcemanager.edgeorder.models.ProductFamiliesRequest; -import com.azure.resourcemanager.edgeorder.models.ProductFamily; -import com.azure.resourcemanager.edgeorder.models.ResourceProviders; -import com.azure.resourcemanager.edgeorder.models.ReturnOrderItemDetails; - -public final class ResourceProvidersImpl implements ResourceProviders { - private static final ClientLogger LOGGER = new ClientLogger(ResourceProvidersImpl.class); - - private final ResourceProvidersClient innerClient; - - private final com.azure.resourcemanager.edgeorder.EdgeOrderManager serviceManager; - - public ResourceProvidersImpl(ResourceProvidersClient innerClient, - com.azure.resourcemanager.edgeorder.EdgeOrderManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listOperations() { - PagedIterable inner = this.serviceClient().listOperations(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); - } - - public PagedIterable listOperations(Context context) { - PagedIterable inner = this.serviceClient().listOperations(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AddressResourceImpl(inner1, this.manager())); - } - - public PagedIterable list(String filter, String skipToken, Context context) { - PagedIterable inner = this.serviceClient().list(filter, skipToken, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AddressResourceImpl(inner1, this.manager())); - } - - public PagedIterable listProductFamilies(ProductFamiliesRequest productFamiliesRequest) { - PagedIterable inner = this.serviceClient().listProductFamilies(productFamiliesRequest); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ProductFamilyImpl(inner1, this.manager())); - } - - public PagedIterable listProductFamilies(ProductFamiliesRequest productFamiliesRequest, - String expand, String skipToken, Context context) { - PagedIterable inner - = this.serviceClient().listProductFamilies(productFamiliesRequest, expand, skipToken, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ProductFamilyImpl(inner1, this.manager())); - } - - public PagedIterable listConfigurations(ConfigurationsRequest configurationsRequest) { - PagedIterable inner = this.serviceClient().listConfigurations(configurationsRequest); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ConfigurationImpl(inner1, this.manager())); - } - - public PagedIterable listConfigurations(ConfigurationsRequest configurationsRequest, - String skipToken, Context context) { - PagedIterable inner - = this.serviceClient().listConfigurations(configurationsRequest, skipToken, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ConfigurationImpl(inner1, this.manager())); - } - - public PagedIterable listProductFamiliesMetadata() { - PagedIterable inner = this.serviceClient().listProductFamiliesMetadata(); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new ProductFamiliesMetadataDetailsImpl(inner1, this.manager())); - } - - public PagedIterable listProductFamiliesMetadata(String skipToken, - Context context) { - PagedIterable inner - = this.serviceClient().listProductFamiliesMetadata(skipToken, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new ProductFamiliesMetadataDetailsImpl(inner1, this.manager())); - } - - public PagedIterable listOrderAtSubscriptionLevel() { - PagedIterable inner = this.serviceClient().listOrderAtSubscriptionLevel(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OrderResourceImpl(inner1, this.manager())); - } - - public PagedIterable listOrderAtSubscriptionLevel(String skipToken, Context context) { - PagedIterable inner = this.serviceClient().listOrderAtSubscriptionLevel(skipToken, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OrderResourceImpl(inner1, this.manager())); - } - - public PagedIterable listOrderItemsAtSubscriptionLevel() { - PagedIterable inner = this.serviceClient().listOrderItemsAtSubscriptionLevel(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OrderItemResourceImpl(inner1, this.manager())); - } - - public PagedIterable listOrderItemsAtSubscriptionLevel(String filter, String expand, - String skipToken, Context context) { - PagedIterable inner - = this.serviceClient().listOrderItemsAtSubscriptionLevel(filter, expand, skipToken, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OrderItemResourceImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AddressResourceImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, String filter, String skipToken, - Context context) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName, filter, skipToken, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AddressResourceImpl(inner1, this.manager())); - } - - public Response getByResourceGroupWithResponse(String resourceGroupName, String addressName, - Context context) { - Response inner - = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, addressName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AddressResourceImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AddressResource getByResourceGroup(String resourceGroupName, String addressName) { - AddressResourceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, addressName); - if (inner != null) { - return new AddressResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public void deleteByResourceGroup(String resourceGroupName, String addressName) { - this.serviceClient().delete(resourceGroupName, addressName); - } - - public void delete(String resourceGroupName, String addressName, Context context) { - this.serviceClient().delete(resourceGroupName, addressName, context); - } - - public PagedIterable listOrderAtResourceGroupLevel(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listOrderAtResourceGroupLevel(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OrderResourceImpl(inner1, this.manager())); - } - - public PagedIterable listOrderAtResourceGroupLevel(String resourceGroupName, String skipToken, - Context context) { - PagedIterable inner - = this.serviceClient().listOrderAtResourceGroupLevel(resourceGroupName, skipToken, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OrderResourceImpl(inner1, this.manager())); - } - - public Response getOrderByNameWithResponse(String orderName, String resourceGroupName, - String location, Context context) { - Response inner - = this.serviceClient().getOrderByNameWithResponse(orderName, resourceGroupName, location, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new OrderResourceImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public OrderResource getOrderByName(String orderName, String resourceGroupName, String location) { - OrderResourceInner inner = this.serviceClient().getOrderByName(orderName, resourceGroupName, location); - if (inner != null) { - return new OrderResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable listOrderItemsAtResourceGroupLevel(String resourceGroupName) { - PagedIterable inner - = this.serviceClient().listOrderItemsAtResourceGroupLevel(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OrderItemResourceImpl(inner1, this.manager())); - } - - public PagedIterable listOrderItemsAtResourceGroupLevel(String resourceGroupName, String filter, - String expand, String skipToken, Context context) { - PagedIterable inner = this.serviceClient() - .listOrderItemsAtResourceGroupLevel(resourceGroupName, filter, expand, skipToken, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OrderItemResourceImpl(inner1, this.manager())); - } - - public Response getOrderItemByNameWithResponse(String orderItemName, String resourceGroupName, - String expand, Context context) { - Response inner - = this.serviceClient().getOrderItemByNameWithResponse(orderItemName, resourceGroupName, expand, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new OrderItemResourceImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public OrderItemResource getOrderItemByName(String orderItemName, String resourceGroupName) { - OrderItemResourceInner inner = this.serviceClient().getOrderItemByName(orderItemName, resourceGroupName); - if (inner != null) { - return new OrderItemResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public void deleteOrderItemByName(String orderItemName, String resourceGroupName) { - this.serviceClient().deleteOrderItemByName(orderItemName, resourceGroupName); - } - - public void deleteOrderItemByName(String orderItemName, String resourceGroupName, Context context) { - this.serviceClient().deleteOrderItemByName(orderItemName, resourceGroupName, context); - } - - public Response cancelOrderItemWithResponse(String orderItemName, String resourceGroupName, - CancellationReason cancellationReason, Context context) { - return this.serviceClient() - .cancelOrderItemWithResponse(orderItemName, resourceGroupName, cancellationReason, context); - } - - public void cancelOrderItem(String orderItemName, String resourceGroupName, CancellationReason cancellationReason) { - this.serviceClient().cancelOrderItem(orderItemName, resourceGroupName, cancellationReason); - } - - public void returnOrderItem(String orderItemName, String resourceGroupName, - ReturnOrderItemDetails returnOrderItemDetails) { - this.serviceClient().returnOrderItem(orderItemName, resourceGroupName, returnOrderItemDetails); - } - - public void returnOrderItem(String orderItemName, String resourceGroupName, - ReturnOrderItemDetails returnOrderItemDetails, Context context) { - this.serviceClient().returnOrderItem(orderItemName, resourceGroupName, returnOrderItemDetails, context); - } - - public AddressResource getById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String addressName = ResourceManagerUtils.getValueFromIdByName(id, "addresses"); - if (addressName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'addresses'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, addressName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String addressName = ResourceManagerUtils.getValueFromIdByName(id, "addresses"); - if (addressName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'addresses'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, addressName, context); - } - - public OrderItemResource getOrderItemById(String id) { - String orderItemName = ResourceManagerUtils.getValueFromIdByName(id, "orderItems"); - if (orderItemName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'orderItems'.", id))); - } - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String localExpand = null; - return this.getOrderItemByNameWithResponse(orderItemName, resourceGroupName, localExpand, Context.NONE) - .getValue(); - } - - public Response getOrderItemByIdWithResponse(String id, String expand, Context context) { - String orderItemName = ResourceManagerUtils.getValueFromIdByName(id, "orderItems"); - if (orderItemName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'orderItems'.", id))); - } - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - return this.getOrderItemByNameWithResponse(orderItemName, resourceGroupName, expand, context); - } - - public void deleteById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String addressName = ResourceManagerUtils.getValueFromIdByName(id, "addresses"); - if (addressName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'addresses'.", id))); - } - this.delete(resourceGroupName, addressName, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String addressName = ResourceManagerUtils.getValueFromIdByName(id, "addresses"); - if (addressName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'addresses'.", id))); - } - this.delete(resourceGroupName, addressName, context); - } - - public void deleteOrderItemById(String id) { - String orderItemName = ResourceManagerUtils.getValueFromIdByName(id, "orderItems"); - if (orderItemName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'orderItems'.", id))); - } - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - this.deleteOrderItemByName(orderItemName, resourceGroupName, Context.NONE); - } - - public void deleteOrderItemByIdWithResponse(String id, Context context) { - String orderItemName = ResourceManagerUtils.getValueFromIdByName(id, "orderItems"); - if (orderItemName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'orderItems'.", id))); - } - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - this.deleteOrderItemByName(orderItemName, resourceGroupName, context); - } - - private ResourceProvidersClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.edgeorder.EdgeOrderManager manager() { - return this.serviceManager; - } - - public AddressResourceImpl defineAddress(String name) { - return new AddressResourceImpl(name, this.manager()); - } - - public OrderItemResourceImpl defineOrderItem(String name) { - return new OrderItemResourceImpl(name, this.manager()); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AddressResourceList.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/models/AddressResourceList.java similarity index 79% rename from sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AddressResourceList.java rename to sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/models/AddressResourceList.java index 5fb2d5092bd3..5dfff7bb343c 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AddressResourceList.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/models/AddressResourceList.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.edgeorder.models; +package com.azure.resourcemanager.edgeorder.implementation.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; @@ -16,26 +16,26 @@ /** * Address Resource Collection. */ -@Fluent +@Immutable public final class AddressResourceList implements JsonSerializable { /* - * List of address resources. + * The AddressResource items on this page */ private List value; /* - * Link for the next set of job resources. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of AddressResourceList class. */ - public AddressResourceList() { + private AddressResourceList() { } /** - * Get the value property: List of address resources. + * Get the value property: The AddressResource items on this page. * * @return the value value. */ @@ -44,7 +44,7 @@ public List value() { } /** - * Get the nextLink property: Link for the next set of job resources. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -52,17 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Link for the next set of job resources. - * - * @param nextLink the nextLink value to set. - * @return the AddressResourceList object itself. - */ - public AddressResourceList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * @@ -90,6 +79,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of AddressResourceList 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 AddressResourceList. */ public static AddressResourceList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Configurations.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/models/Configurations.java similarity index 79% rename from sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Configurations.java rename to sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/models/Configurations.java index ca7f8c267e81..b400535a0802 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Configurations.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/models/Configurations.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.edgeorder.models; +package com.azure.resourcemanager.edgeorder.implementation.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; @@ -16,26 +16,26 @@ /** * The list of configurations. */ -@Fluent +@Immutable public final class Configurations implements JsonSerializable { /* - * List of configurations. + * The Configuration items on this page */ private List value; /* - * Link for the next set of configurations. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of Configurations class. */ - public Configurations() { + private Configurations() { } /** - * Get the value property: List of configurations. + * Get the value property: The Configuration items on this page. * * @return the value value. */ @@ -44,7 +44,7 @@ public List value() { } /** - * Get the nextLink property: Link for the next set of configurations. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -52,17 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Link for the next set of configurations. - * - * @param nextLink the nextLink value to set. - * @return the Configurations object itself. - */ - public Configurations withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * @@ -90,6 +79,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of Configurations 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 Configurations. */ public static Configurations fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OperationListResult.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/models/OperationListResult.java similarity index 74% rename from sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OperationListResult.java rename to sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/models/OperationListResult.java index fa8f00a8bbee..cc21b72f9bdb 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OperationListResult.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/models/OperationListResult.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.edgeorder.models; +package com.azure.resourcemanager.edgeorder.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -20,23 +21,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 +46,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. */ @@ -59,17 +60,24 @@ public String nextLink() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model OperationListResult")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(OperationListResult.class); + /** * {@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 +87,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/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderItemResourceList.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/models/OrderItemResourceList.java similarity index 78% rename from sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderItemResourceList.java rename to sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/models/OrderItemResourceList.java index 6a94f33a5d0d..438bc2febebc 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderItemResourceList.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/models/OrderItemResourceList.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.edgeorder.models; +package com.azure.resourcemanager.edgeorder.implementation.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,28 +14,28 @@ import java.util.List; /** - * List of orderItems. + * List of order items. */ -@Fluent +@Immutable public final class OrderItemResourceList implements JsonSerializable { /* - * List of order item resources. + * The OrderItemResource items on this page */ private List value; /* - * Link for the next set of order item resources. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of OrderItemResourceList class. */ - public OrderItemResourceList() { + private OrderItemResourceList() { } /** - * Get the value property: List of order item resources. + * Get the value property: The OrderItemResource items on this page. * * @return the value value. */ @@ -44,7 +44,7 @@ public List value() { } /** - * Get the nextLink property: Link for the next set of order item resources. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -52,17 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Link for the next set of order item resources. - * - * @param nextLink the nextLink value to set. - * @return the OrderItemResourceList object itself. - */ - public OrderItemResourceList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * @@ -90,6 +79,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of OrderItemResourceList 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 OrderItemResourceList. */ public static OrderItemResourceList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderResourceList.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/models/OrderResourceList.java similarity index 79% rename from sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderResourceList.java rename to sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/models/OrderResourceList.java index d85f0f805da1..8bc1b6205ddc 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderResourceList.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/models/OrderResourceList.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.edgeorder.models; +package com.azure.resourcemanager.edgeorder.implementation.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; @@ -16,26 +16,26 @@ /** * List of orders. */ -@Fluent +@Immutable public final class OrderResourceList implements JsonSerializable { /* - * List of order resources. + * The OrderResource items on this page */ private List value; /* - * Link for the next set of order resources. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of OrderResourceList class. */ - public OrderResourceList() { + private OrderResourceList() { } /** - * Get the value property: List of order resources. + * Get the value property: The OrderResource items on this page. * * @return the value value. */ @@ -44,7 +44,7 @@ public List value() { } /** - * Get the nextLink property: Link for the next set of order resources. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -52,17 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Link for the next set of order resources. - * - * @param nextLink the nextLink value to set. - * @return the OrderResourceList object itself. - */ - public OrderResourceList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * @@ -90,6 +79,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of OrderResourceList 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 OrderResourceList. */ public static OrderResourceList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProductFamilies.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/models/ProductFamilies.java similarity index 79% rename from sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProductFamilies.java rename to sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/models/ProductFamilies.java index e47ad4bfa0f9..925775d9c186 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProductFamilies.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/models/ProductFamilies.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.edgeorder.models; +package com.azure.resourcemanager.edgeorder.implementation.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; @@ -16,26 +16,26 @@ /** * The list of product families. */ -@Fluent +@Immutable public final class ProductFamilies implements JsonSerializable { /* - * List of product families. + * The ProductFamily items on this page */ private List value; /* - * Link for the next set of product families. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of ProductFamilies class. */ - public ProductFamilies() { + private ProductFamilies() { } /** - * Get the value property: List of product families. + * Get the value property: The ProductFamily items on this page. * * @return the value value. */ @@ -44,7 +44,7 @@ public List value() { } /** - * Get the nextLink property: Link for the next set of product families. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -52,17 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Link for the next set of product families. - * - * @param nextLink the nextLink value to set. - * @return the ProductFamilies object itself. - */ - public ProductFamilies withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * @@ -90,6 +79,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ProductFamilies 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 ProductFamilies. */ public static ProductFamilies fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProductFamiliesMetadata.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/models/ProductFamiliesMetadata.java similarity index 83% rename from sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProductFamiliesMetadata.java rename to sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/models/ProductFamiliesMetadata.java index c725cf9ed633..233842d5dd84 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProductFamiliesMetadata.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/models/ProductFamiliesMetadata.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.edgeorder.models; +package com.azure.resourcemanager.edgeorder.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -19,23 +19,23 @@ @Immutable public final class ProductFamiliesMetadata implements JsonSerializable { /* - * List of product family metadata details. + * The ProductFamiliesMetadataDetails items on this page */ private List value; /* - * Link for the next set of product families. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of ProductFamiliesMetadata class. */ - public ProductFamiliesMetadata() { + private ProductFamiliesMetadata() { } /** - * Get the value property: List of product family metadata details. + * Get the value property: The ProductFamiliesMetadataDetails items on this page. * * @return the value value. */ @@ -44,7 +44,7 @@ public List value() { } /** - * Get the nextLink property: Link for the next set of product families. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -69,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -78,6 +79,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ProductFamiliesMetadata 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 ProductFamiliesMetadata. */ public static ProductFamiliesMetadata fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/package-info.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/package-info.java index ff8c5f296337..2c065a555446 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/implementation/package-info.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/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 EdgeOrderManagementClient. + * Package containing the implementations for Edgeorder. * Edge Order API's. */ package com.azure.resourcemanager.edgeorder.implementation; diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ActionStatusEnum.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ActionStatusEnum.java index d6eeed2b7c08..57e65fe13dda 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ActionStatusEnum.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ActionStatusEnum.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -12,12 +12,12 @@ */ public final class ActionStatusEnum extends ExpandableStringEnum { /** - * Static value Allowed for ActionStatusEnum. + * Allowed flag. */ public static final ActionStatusEnum ALLOWED = fromString("Allowed"); /** - * Static value NotAllowed for ActionStatusEnum. + * Not Allowed flag. */ public static final ActionStatusEnum NOT_ALLOWED = fromString("NotAllowed"); diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ActionType.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ActionType.java index 8146110f2090..b17057a8e34e 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ActionType.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/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.edgeorder.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/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AdditionalConfiguration.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AdditionalConfiguration.java new file mode 100644 index 000000000000..3baef8a90052 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AdditionalConfiguration.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.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; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Additional Configuration details. + */ +@Fluent +public final class AdditionalConfiguration implements JsonSerializable { + /* + * Hierarchy of the product which uniquely identifies the configuration. + */ + private HierarchyInformation hierarchyInformation; + + /* + * Quantity of the product. + */ + private int quantity; + + /* + * List Provisioning Details for Devices in Additional Config. + */ + private List provisioningDetails; + + /** + * Creates an instance of AdditionalConfiguration class. + */ + public AdditionalConfiguration() { + } + + /** + * Get the hierarchyInformation property: Hierarchy of the product which uniquely identifies the configuration. + * + * @return the hierarchyInformation value. + */ + public HierarchyInformation hierarchyInformation() { + return this.hierarchyInformation; + } + + /** + * Set the hierarchyInformation property: Hierarchy of the product which uniquely identifies the configuration. + * + * @param hierarchyInformation the hierarchyInformation value to set. + * @return the AdditionalConfiguration object itself. + */ + public AdditionalConfiguration withHierarchyInformation(HierarchyInformation hierarchyInformation) { + this.hierarchyInformation = hierarchyInformation; + return this; + } + + /** + * Get the quantity property: Quantity of the product. + * + * @return the quantity value. + */ + public int quantity() { + return this.quantity; + } + + /** + * Set the quantity property: Quantity of the product. + * + * @param quantity the quantity value to set. + * @return the AdditionalConfiguration object itself. + */ + public AdditionalConfiguration withQuantity(int quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get the provisioningDetails property: List Provisioning Details for Devices in Additional Config. + * + * @return the provisioningDetails value. + */ + public List provisioningDetails() { + return this.provisioningDetails; + } + + /** + * Set the provisioningDetails property: List Provisioning Details for Devices in Additional Config. + * + * @param provisioningDetails the provisioningDetails value to set. + * @return the AdditionalConfiguration object itself. + */ + public AdditionalConfiguration withProvisioningDetails(List provisioningDetails) { + this.provisioningDetails = provisioningDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hierarchyInformation() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property hierarchyInformation in model AdditionalConfiguration")); + } else { + hierarchyInformation().validate(); + } + if (provisioningDetails() != null) { + provisioningDetails().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AdditionalConfiguration.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("hierarchyInformation", this.hierarchyInformation); + jsonWriter.writeIntField("quantity", this.quantity); + jsonWriter.writeArrayField("provisioningDetails", this.provisioningDetails, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdditionalConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdditionalConfiguration 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 AdditionalConfiguration. + */ + public static AdditionalConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdditionalConfiguration deserializedAdditionalConfiguration = new AdditionalConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hierarchyInformation".equals(fieldName)) { + deserializedAdditionalConfiguration.hierarchyInformation = HierarchyInformation.fromJson(reader); + } else if ("quantity".equals(fieldName)) { + deserializedAdditionalConfiguration.quantity = reader.getInt(); + } else if ("provisioningDetails".equals(fieldName)) { + List provisioningDetails + = reader.readArray(reader1 -> ProvisioningDetails.fromJson(reader1)); + deserializedAdditionalConfiguration.provisioningDetails = provisioningDetails; + } else { + reader.skipChildren(); + } + } + + return deserializedAdditionalConfiguration; + }); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AddressClassification.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AddressClassification.java new file mode 100644 index 000000000000..e1a08578648f --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AddressClassification.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of address based on its usage context. + */ +public final class AddressClassification extends ExpandableStringEnum { + /** + * Shipping address for the order. + */ + public static final AddressClassification SHIPPING = fromString("Shipping"); + + /** + * Site Address. + */ + public static final AddressClassification SITE = fromString("Site"); + + /** + * Creates a new instance of AddressClassification value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AddressClassification() { + } + + /** + * Creates or finds a AddressClassification from its string representation. + * + * @param name a name to look for. + * @return the corresponding AddressClassification. + */ + public static AddressClassification fromString(String name) { + return fromString(name, AddressClassification.class); + } + + /** + * Gets known AddressClassification values. + * + * @return known AddressClassification values. + */ + public static Collection values() { + return values(AddressClassification.class); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AddressDetails.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AddressDetails.java index 7329b5365f39..c0da5a05d15b 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AddressDetails.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AddressDetails.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -19,12 +19,12 @@ @Fluent public final class AddressDetails implements JsonSerializable { /* - * Customer address and contact details. It should be address resource + * Customer address and contact details. */ private AddressProperties forwardAddress; /* - * Return shipping address + * Return shipping address. */ private AddressProperties returnAddress; @@ -35,7 +35,7 @@ public AddressDetails() { } /** - * Get the forwardAddress property: Customer address and contact details. It should be address resource. + * Get the forwardAddress property: Customer address and contact details. * * @return the forwardAddress value. */ @@ -44,7 +44,7 @@ public AddressProperties forwardAddress() { } /** - * Set the forwardAddress property: Customer address and contact details. It should be address resource. + * Set the forwardAddress property: Customer address and contact details. * * @param forwardAddress the forwardAddress value to set. * @return the AddressDetails object itself. diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AddressResource.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AddressResource.java index 4fbc3d056e36..ead10bd42fbd 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AddressResource.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AddressResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -50,12 +50,19 @@ public interface AddressResource { Map tags(); /** - * Gets the systemData property: Represents resource creation and update time. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ SystemData systemData(); + /** + * Gets the addressClassification property: Type of address based on its usage context. + * + * @return the addressClassification value. + */ + AddressClassification addressClassification(); + /** * Gets the shippingAddress property: Shipping details for the address. * @@ -77,6 +84,13 @@ public interface AddressResource { */ AddressValidationStatus addressValidationStatus(); + /** + * Gets the provisioningState property: Provisioning state. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + /** * Gets the region of the resource. * @@ -109,7 +123,7 @@ public interface AddressResource { * The entirety of the AddressResource definition. */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, DefinitionStages.WithContactDetails, DefinitionStages.WithCreate { + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } /** @@ -153,27 +167,15 @@ interface WithResourceGroup { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ - WithContactDetails withExistingResourceGroup(String resourceGroupName); - } - - /** - * The stage of the AddressResource definition allowing to specify contactDetails. - */ - interface WithContactDetails { - /** - * Specifies the contactDetails property: Contact details for the address. - * - * @param contactDetails Contact details for the address. - * @return the next definition stage. - */ - WithCreate withContactDetails(ContactDetails contactDetails); + WithCreate withExistingResourceGroup(String resourceGroupName); } /** * The stage of the AddressResource definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. */ - interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithShippingAddress { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithAddressClassification, + DefinitionStages.WithShippingAddress, DefinitionStages.WithContactDetails { /** * Executes the create request. * @@ -203,18 +205,44 @@ interface WithTags { WithCreate withTags(Map tags); } + /** + * The stage of the AddressResource definition allowing to specify addressClassification. + */ + interface WithAddressClassification { + /** + * Specifies the addressClassification property: Type of address based on its usage context.. + * + * @param addressClassification Type of address based on its usage context. + * @return the next definition stage. + */ + WithCreate withAddressClassification(AddressClassification addressClassification); + } + /** * The stage of the AddressResource definition allowing to specify shippingAddress. */ interface WithShippingAddress { /** - * Specifies the shippingAddress property: Shipping details for the address. + * Specifies the shippingAddress property: Shipping details for the address.. * * @param shippingAddress Shipping details for the address. * @return the next definition stage. */ WithCreate withShippingAddress(ShippingAddress shippingAddress); } + + /** + * The stage of the AddressResource definition allowing to specify contactDetails. + */ + interface WithContactDetails { + /** + * Specifies the contactDetails property: Contact details for the address.. + * + * @param contactDetails Contact details for the address. + * @return the next definition stage. + */ + WithCreate withContactDetails(ContactDetails contactDetails); + } } /** @@ -269,7 +297,7 @@ interface WithTags { */ interface WithShippingAddress { /** - * Specifies the shippingAddress property: Shipping details for the address. + * Specifies the shippingAddress property: Shipping details for the address.. * * @param shippingAddress Shipping details for the address. * @return the next definition stage. @@ -282,7 +310,7 @@ interface WithShippingAddress { */ interface WithContactDetails { /** - * Specifies the contactDetails property: Contact details for the address. + * Specifies the contactDetails property: Contact details for the address.. * * @param contactDetails Contact details for the address. * @return the next definition stage. diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AddressResources.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AddressResources.java new file mode 100644 index 000000000000..abc915e9df67 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AddressResources.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of AddressResources. + */ +public interface AddressResources { + /** + * Get information about the specified address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @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 information about the specified address along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String addressName, + Context context); + + /** + * Get information about the specified address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified address. + */ + AddressResource getByResourceGroup(String resourceGroupName, String addressName); + + /** + * Delete an address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String addressName); + + /** + * Delete an address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param addressName The name of the address Resource within the specified resource group. address names must be + * between 3 and 24 characters in length and use any alphanumeric and underscore only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String addressName, Context context); + + /** + * List all the addresses available under the given 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 address Resource Collection as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List all the addresses available under the given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter $filter is supported to filter based on shipping address properties. Filter supports only equals + * operation. + * @param skipToken $skipToken is supported on Get list of addresses, which provides the next page in the list of + * addresses. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @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 address Resource Collection as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, String filter, String skipToken, + Integer top, Context context); + + /** + * List all the addresses available under the subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return address Resource Collection as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List all the addresses available under the subscription. + * + * @param filter $filter is supported to filter based on shipping address properties. Filter supports only equals + * operation. + * @param skipToken $skipToken is supported on Get list of addresses, which provides the next page in the list of + * addresses. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @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 address Resource Collection as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String filter, String skipToken, Integer top, Context context); + + /** + * Get information about the specified address. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified address along with {@link Response}. + */ + AddressResource getById(String id); + + /** + * Get information about the specified address. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified address along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete an address. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete an address. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new AddressResource resource. + * + * @param name resource name. + * @return the first stage of the new AddressResource definition. + */ + AddressResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AddressType.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AddressType.java index 4de1962ede12..472aef8a5a8f 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AddressType.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AddressType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -12,17 +12,17 @@ */ public final class AddressType extends ExpandableStringEnum { /** - * Static value None for AddressType. + * Address type not known. */ public static final AddressType NONE = fromString("None"); /** - * Static value Residential for AddressType. + * Residential Address. */ public static final AddressType RESIDENTIAL = fromString("Residential"); /** - * Static value Commercial for AddressType. + * Commercial Address. */ public static final AddressType COMMERCIAL = fromString("Commercial"); diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AddressUpdateParameter.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AddressUpdateParameter.java index 334bb06db4a8..8c74379499b8 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AddressUpdateParameter.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AddressUpdateParameter.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -19,7 +19,7 @@ @Fluent public final class AddressUpdateParameter implements JsonSerializable { /* - * Properties of a address to be updated. + * Properties of an address to be updated. */ private AddressUpdateProperties innerProperties; @@ -36,7 +36,7 @@ public AddressUpdateParameter() { } /** - * Get the innerProperties property: Properties of a address to be updated. + * Get the innerProperties property: Properties of an address to be updated. * * @return the innerProperties value. */ diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AddressValidationStatus.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AddressValidationStatus.java index ecc4f3f1bfec..eb9fd9f6d3d3 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AddressValidationStatus.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AddressValidationStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -12,17 +12,17 @@ */ public final class AddressValidationStatus extends ExpandableStringEnum { /** - * Static value Valid for AddressValidationStatus. + * Address provided is valid. */ public static final AddressValidationStatus VALID = fromString("Valid"); /** - * Static value Invalid for AddressValidationStatus. + * Address provided is invalid or not supported. */ public static final AddressValidationStatus INVALID = fromString("Invalid"); /** - * Static value Ambiguous for AddressValidationStatus. + * Address provided is ambiguous, please choose one of the alternate addresses returned. */ public static final AddressValidationStatus AMBIGUOUS = fromString("Ambiguous"); diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AutoProvisioningStatus.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AutoProvisioningStatus.java new file mode 100644 index 000000000000..547c2e173452 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AutoProvisioningStatus.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Auto Provisioning Details. + */ +public final class AutoProvisioningStatus extends ExpandableStringEnum { + /** + * Provisioning Enabled. Will act as pre-approved, and arc extension will be enabled as soon as the device is + * verified to be at the right edge location. + */ + public static final AutoProvisioningStatus ENABLED = fromString("Enabled"); + + /** + * Provisioning Disabled. + */ + public static final AutoProvisioningStatus DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of AutoProvisioningStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AutoProvisioningStatus() { + } + + /** + * Creates or finds a AutoProvisioningStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding AutoProvisioningStatus. + */ + public static AutoProvisioningStatus fromString(String name) { + return fromString(name, AutoProvisioningStatus.class); + } + + /** + * Gets known AutoProvisioningStatus values. + * + * @return known AutoProvisioningStatus values. + */ + public static Collection values() { + return values(AutoProvisioningStatus.class); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AvailabilityInformation.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AvailabilityInformation.java index 09f952767867..bae4184a07b4 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AvailabilityInformation.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/AvailabilityInformation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -17,7 +17,7 @@ @Immutable public final class AvailabilityInformation implements JsonSerializable { /* - * Current availability stage of the product. Availability stage + * Current availability stage of the product. */ private AvailabilityStage availabilityStage; @@ -34,11 +34,11 @@ public final class AvailabilityInformation implements JsonSerializable { /** - * Static value Available for AvailabilityStage. + * Product is available. */ public static final AvailabilityStage AVAILABLE = fromString("Available"); /** - * Static value ComingSoon for AvailabilityStage. + * Product is in preview. */ - public static final AvailabilityStage COMING_SOON = fromString("ComingSoon"); + public static final AvailabilityStage PREVIEW = fromString("Preview"); /** - * Static value Preview for AvailabilityStage. + * Product is available only on signup. */ - public static final AvailabilityStage PREVIEW = fromString("Preview"); + public static final AvailabilityStage SIGNUP = fromString("Signup"); /** - * Static value Deprecated for AvailabilityStage. + * Product is not available in our service but can be discovered from other sources. */ - public static final AvailabilityStage DEPRECATED = fromString("Deprecated"); + public static final AvailabilityStage DISCOVERABLE = fromString("Discoverable"); /** - * Static value Signup for AvailabilityStage. + * Product is coming soon. */ - public static final AvailabilityStage SIGNUP = fromString("Signup"); + public static final AvailabilityStage COMING_SOON = fromString("ComingSoon"); /** - * Static value Unavailable for AvailabilityStage. + * Product is not available. */ public static final AvailabilityStage UNAVAILABLE = fromString("Unavailable"); + /** + * Product is deprecated. + */ + public static final AvailabilityStage DEPRECATED = fromString("Deprecated"); + /** * Creates a new instance of AvailabilityStage value. * diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/BasicInformation.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/BasicInformation.java index e422a790c0a4..e8ffba97602a 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/BasicInformation.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/BasicInformation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -47,10 +47,15 @@ public class BasicInformation implements JsonSerializable { */ private HierarchyInformation hierarchyInformation; + /* + * The entity responsible for fulfillment of the item at the given hierarchy level. + */ + private FulfillmentType fulfilledBy; + /** * Creates an instance of BasicInformation class. */ - public BasicInformation() { + protected BasicInformation() { } /** @@ -173,6 +178,26 @@ BasicInformation withHierarchyInformation(HierarchyInformation hierarchyInformat return this; } + /** + * Get the fulfilledBy property: The entity responsible for fulfillment of the item at the given hierarchy level. + * + * @return the fulfilledBy value. + */ + public FulfillmentType fulfilledBy() { + return this.fulfilledBy; + } + + /** + * Set the fulfilledBy property: The entity responsible for fulfillment of the item at the given hierarchy level. + * + * @param fulfilledBy the fulfilledBy value to set. + * @return the BasicInformation object itself. + */ + BasicInformation withFulfilledBy(FulfillmentType fulfilledBy) { + this.fulfilledBy = fulfilledBy; + return this; + } + /** * Validates the instance. * @@ -234,6 +259,8 @@ public static BasicInformation fromJson(JsonReader jsonReader) throws IOExceptio deserializedBasicInformation.availabilityInformation = AvailabilityInformation.fromJson(reader); } else if ("hierarchyInformation".equals(fieldName)) { deserializedBasicInformation.hierarchyInformation = HierarchyInformation.fromJson(reader); + } else if ("fulfilledBy".equals(fieldName)) { + deserializedBasicInformation.fulfilledBy = FulfillmentType.fromString(reader.getString()); } else { reader.skipChildren(); } diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/BillingMeterDetails.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/BillingMeterDetails.java index 040f67688018..e3fa1fa0a63a 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/BillingMeterDetails.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/BillingMeterDetails.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -17,29 +17,34 @@ @Immutable public final class BillingMeterDetails implements JsonSerializable { /* - * Represents Billing type name + * Represents Billing type name. */ private String name; /* - * Represents MeterDetails + * Represents MeterDetails. */ private MeterDetails meterDetails; /* - * Represents Metering type (eg one-time or recurrent) + * Represents Metering type (eg one-time or recurrent). */ private MeteringType meteringType; /* - * Frequency of recurrence + * Frequency of recurrence. */ private String frequency; + /* + * Represent Term Type details. + */ + private TermTypeDetails termTypeDetails; + /** * Creates an instance of BillingMeterDetails class. */ - public BillingMeterDetails() { + private BillingMeterDetails() { } /** @@ -78,6 +83,15 @@ public String frequency() { return this.frequency; } + /** + * Get the termTypeDetails property: Represent Term Type details. + * + * @return the termTypeDetails value. + */ + public TermTypeDetails termTypeDetails() { + return this.termTypeDetails; + } + /** * Validates the instance. * @@ -87,6 +101,9 @@ public void validate() { if (meterDetails() != null) { meterDetails().validate(); } + if (termTypeDetails() != null) { + termTypeDetails().validate(); + } } /** @@ -121,6 +138,8 @@ public static BillingMeterDetails fromJson(JsonReader jsonReader) throws IOExcep deserializedBillingMeterDetails.meteringType = MeteringType.fromString(reader.getString()); } else if ("frequency".equals(fieldName)) { deserializedBillingMeterDetails.frequency = reader.getString(); + } else if ("termTypeDetails".equals(fieldName)) { + deserializedBillingMeterDetails.termTypeDetails = TermTypeDetails.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/BillingType.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/BillingType.java index 3dcc7ad5ec0f..972cf090e5fb 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/BillingType.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/BillingType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -12,12 +12,12 @@ */ public final class BillingType extends ExpandableStringEnum { /** - * Static value Pav2 for BillingType. + * PaV2 billing. */ public static final BillingType PAV2 = fromString("Pav2"); /** - * Static value Purchase for BillingType. + * Purchase billing. */ public static final BillingType PURCHASE = fromString("Purchase"); diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/CancellationReason.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/CancellationReason.java index efdf1209462f..65dd63387eed 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/CancellationReason.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/CancellationReason.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/CategoryInformation.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/CategoryInformation.java new file mode 100644 index 000000000000..a116b3a17926 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/CategoryInformation.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Category related properties of a child configuration. + */ +@Immutable +public final class CategoryInformation implements JsonSerializable { + /* + * Category name of the child configuration. + */ + private String categoryName; + + /* + * Category display name of the child configuration. + */ + private String categoryDisplayName; + + /* + * Description text for the category. + */ + private String description; + + /* + * Links for the category. + */ + private List links; + + /** + * Creates an instance of CategoryInformation class. + */ + private CategoryInformation() { + } + + /** + * Get the categoryName property: Category name of the child configuration. + * + * @return the categoryName value. + */ + public String categoryName() { + return this.categoryName; + } + + /** + * Get the categoryDisplayName property: Category display name of the child configuration. + * + * @return the categoryDisplayName value. + */ + public String categoryDisplayName() { + return this.categoryDisplayName; + } + + /** + * Get the description property: Description text for the category. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the links property: Links for the category. + * + * @return the links value. + */ + public List links() { + return this.links; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (links() != null) { + links().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("categoryName", this.categoryName); + jsonWriter.writeStringField("categoryDisplayName", this.categoryDisplayName); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeArrayField("links", this.links, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CategoryInformation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CategoryInformation if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CategoryInformation. + */ + public static CategoryInformation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CategoryInformation deserializedCategoryInformation = new CategoryInformation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("categoryName".equals(fieldName)) { + deserializedCategoryInformation.categoryName = reader.getString(); + } else if ("categoryDisplayName".equals(fieldName)) { + deserializedCategoryInformation.categoryDisplayName = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedCategoryInformation.description = reader.getString(); + } else if ("links".equals(fieldName)) { + List links = reader.readArray(reader1 -> Link.fromJson(reader1)); + deserializedCategoryInformation.links = links; + } else { + reader.skipChildren(); + } + } + + return deserializedCategoryInformation; + }); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ChargingType.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ChargingType.java index 575522f2516c..9d72098dc9f7 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ChargingType.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ChargingType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -12,12 +12,12 @@ */ public final class ChargingType extends ExpandableStringEnum { /** - * Static value PerOrder for ChargingType. + * Per order charging type. */ public static final ChargingType PER_ORDER = fromString("PerOrder"); /** - * Static value PerDevice for ChargingType. + * Per device charging type. */ public static final ChargingType PER_DEVICE = fromString("PerDevice"); diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ChildConfiguration.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ChildConfiguration.java new file mode 100644 index 000000000000..b5a54bb477d7 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ChildConfiguration.java @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.edgeorder.fluent.models.ChildConfigurationProperties; +import java.io.IOException; +import java.time.Duration; +import java.util.List; + +/** + * Child configuration object. + */ +@Immutable +public final class ChildConfiguration implements JsonSerializable { + /* + * Properties of child configuration. + */ + private ChildConfigurationProperties innerProperties; + + /** + * Creates an instance of ChildConfiguration class. + */ + private ChildConfiguration() { + } + + /** + * Get the innerProperties property: Properties of child configuration. + * + * @return the innerProperties value. + */ + private ChildConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the childConfigurationType property: Child configuration type. + * + * @return the childConfigurationType value. + */ + public ChildConfigurationType childConfigurationType() { + return this.innerProperties() == null ? null : this.innerProperties().childConfigurationType(); + } + + /** + * Get the isPartOfBaseConfiguration property: Flag to indicate if the child configuration is part of the base + * configuration, which means the customer need not pass this configuration in OptInAdditionalConfigurations while + * placing an order, it will be shipped by default. + * + * @return the isPartOfBaseConfiguration value. + */ + public Boolean isPartOfBaseConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().isPartOfBaseConfiguration(); + } + + /** + * Get the minimumQuantity property: Minimum quantity a customer can order while choosing this configuration. + * + * @return the minimumQuantity value. + */ + public Integer minimumQuantity() { + return this.innerProperties() == null ? null : this.innerProperties().minimumQuantity(); + } + + /** + * Get the maximumQuantity property: Maximum quantity a customer can order while choosing this configuration. + * + * @return the maximumQuantity value. + */ + public Integer maximumQuantity() { + return this.innerProperties() == null ? null : this.innerProperties().maximumQuantity(); + } + + /** + * Get the specifications property: Specifications of the configuration. + * + * @return the specifications value. + */ + public List specifications() { + return this.innerProperties() == null ? null : this.innerProperties().specifications(); + } + + /** + * Get the dimensions property: Dimensions of the configuration. + * + * @return the dimensions value. + */ + public Dimensions dimensions() { + return this.innerProperties() == null ? null : this.innerProperties().dimensions(); + } + + /** + * Get the provisioningSupport property: Determining nature of provisioning that the configuration supports. + * + * @return the provisioningSupport value. + */ + public ProvisioningSupport provisioningSupport() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningSupport(); + } + + /** + * Get the childConfigurationTypes property: Different types of child configurations which exist for this + * configuration, these can be used to populate the child configuration filter. + * + * @return the childConfigurationTypes value. + */ + public List childConfigurationTypes() { + return this.innerProperties() == null ? null : this.innerProperties().childConfigurationTypes(); + } + + /** + * Get the groupedChildConfigurations property: Child configurations present for the configuration after applying + * child configuration filter, grouped by the category name of the child configuration. + * + * @return the groupedChildConfigurations value. + */ + public List groupedChildConfigurations() { + return this.innerProperties() == null ? null : this.innerProperties().groupedChildConfigurations(); + } + + /** + * Get the supportedTermCommitmentDurations property: The Term Commitment Durations that are supported for a + * configuration. + * + * @return the supportedTermCommitmentDurations value. + */ + public List supportedTermCommitmentDurations() { + return this.innerProperties() == null ? null : this.innerProperties().supportedTermCommitmentDurations(); + } + + /** + * Get the filterableProperties property: List of filters supported for a product. + * + * @return the filterableProperties value. + */ + public List filterableProperties() { + return this.innerProperties() == null ? null : this.innerProperties().filterableProperties(); + } + + /** + * Get the displayName property: Display Name for the product system. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Get the description property: Description related to the product system. + * + * @return the description value. + */ + public Description description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Get the imageInformation property: Image information for the product system. + * + * @return the imageInformation value. + */ + public List imageInformation() { + return this.innerProperties() == null ? null : this.innerProperties().imageInformation(); + } + + /** + * Get the costInformation property: Cost information for the product system. + * + * @return the costInformation value. + */ + public CostInformation costInformation() { + return this.innerProperties() == null ? null : this.innerProperties().costInformation(); + } + + /** + * Get the availabilityInformation property: Availability information of the product system. + * + * @return the availabilityInformation value. + */ + public AvailabilityInformation availabilityInformation() { + return this.innerProperties() == null ? null : this.innerProperties().availabilityInformation(); + } + + /** + * Get the hierarchyInformation property: Hierarchy information of a product. + * + * @return the hierarchyInformation value. + */ + public HierarchyInformation hierarchyInformation() { + return this.innerProperties() == null ? null : this.innerProperties().hierarchyInformation(); + } + + /** + * Get the fulfilledBy property: The entity responsible for fulfillment of the item at the given hierarchy level. + * + * @return the fulfilledBy value. + */ + public FulfillmentType fulfilledBy() { + return this.innerProperties() == null ? null : this.innerProperties().fulfilledBy(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChildConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChildConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ChildConfiguration. + */ + public static ChildConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ChildConfiguration deserializedChildConfiguration = new ChildConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedChildConfiguration.innerProperties = ChildConfigurationProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedChildConfiguration; + }); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ChildConfigurationFilter.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ChildConfigurationFilter.java new file mode 100644 index 000000000000..4b9e75990a80 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ChildConfigurationFilter.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Child configuration filter. + */ +@Fluent +public final class ChildConfigurationFilter implements JsonSerializable { + /* + * The list of child configuration hierarchy customer wants to filter for the given configuration. + */ + private List hierarchyInformations; + + /* + * Filter to fetch all child configurations belonging to the given list of configuration types. + */ + private List childConfigurationTypes; + + /** + * Creates an instance of ChildConfigurationFilter class. + */ + public ChildConfigurationFilter() { + } + + /** + * Get the hierarchyInformations property: The list of child configuration hierarchy customer wants to filter for + * the given configuration. + * + * @return the hierarchyInformations value. + */ + public List hierarchyInformations() { + return this.hierarchyInformations; + } + + /** + * Set the hierarchyInformations property: The list of child configuration hierarchy customer wants to filter for + * the given configuration. + * + * @param hierarchyInformations the hierarchyInformations value to set. + * @return the ChildConfigurationFilter object itself. + */ + public ChildConfigurationFilter withHierarchyInformations(List hierarchyInformations) { + this.hierarchyInformations = hierarchyInformations; + return this; + } + + /** + * Get the childConfigurationTypes property: Filter to fetch all child configurations belonging to the given list of + * configuration types. + * + * @return the childConfigurationTypes value. + */ + public List childConfigurationTypes() { + return this.childConfigurationTypes; + } + + /** + * Set the childConfigurationTypes property: Filter to fetch all child configurations belonging to the given list of + * configuration types. + * + * @param childConfigurationTypes the childConfigurationTypes value to set. + * @return the ChildConfigurationFilter object itself. + */ + public ChildConfigurationFilter withChildConfigurationTypes(List childConfigurationTypes) { + this.childConfigurationTypes = childConfigurationTypes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hierarchyInformations() != null) { + hierarchyInformations().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("hierarchyInformations", this.hierarchyInformations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("childConfigurationTypes", this.childConfigurationTypes, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChildConfigurationFilter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChildConfigurationFilter if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ChildConfigurationFilter. + */ + public static ChildConfigurationFilter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ChildConfigurationFilter deserializedChildConfigurationFilter = new ChildConfigurationFilter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hierarchyInformations".equals(fieldName)) { + List hierarchyInformations + = reader.readArray(reader1 -> HierarchyInformation.fromJson(reader1)); + deserializedChildConfigurationFilter.hierarchyInformations = hierarchyInformations; + } else if ("childConfigurationTypes".equals(fieldName)) { + List childConfigurationTypes + = reader.readArray(reader1 -> ChildConfigurationType.fromString(reader1.getString())); + deserializedChildConfigurationFilter.childConfigurationTypes = childConfigurationTypes; + } else { + reader.skipChildren(); + } + } + + return deserializedChildConfigurationFilter; + }); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ChildConfigurationType.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ChildConfigurationType.java new file mode 100644 index 000000000000..07fc0c6fefbe --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ChildConfigurationType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for ChildConfigurationType. + */ +public final class ChildConfigurationType extends ExpandableStringEnum { + /** + * Child configuration is a device configuration. + */ + public static final ChildConfigurationType DEVICE_CONFIGURATION = fromString("DeviceConfiguration"); + + /** + * Child configuration is an additional configuration. + */ + public static final ChildConfigurationType ADDITIONAL_CONFIGURATION = fromString("AdditionalConfiguration"); + + /** + * Creates a new instance of ChildConfigurationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ChildConfigurationType() { + } + + /** + * Creates or finds a ChildConfigurationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ChildConfigurationType. + */ + public static ChildConfigurationType fromString(String name) { + return fromString(name, ChildConfigurationType.class); + } + + /** + * Gets known ChildConfigurationType values. + * + * @return known ChildConfigurationType values. + */ + public static Collection values() { + return values(ChildConfigurationType.class); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/CommonProperties.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/CommonProperties.java index fe1601513ca2..4eedb1ec73bd 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/CommonProperties.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/CommonProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -17,10 +17,15 @@ @Immutable public class CommonProperties extends BasicInformation { /* - * list of filters supported for a product + * List of filters supported for a product. */ private List filterableProperties; + /* + * The entity responsible for fulfillment of the item at the given hierarchy level. + */ + private FulfillmentType fulfilledBy; + /* * Hierarchy information of a product. */ @@ -54,11 +59,11 @@ public class CommonProperties extends BasicInformation { /** * Creates an instance of CommonProperties class. */ - public CommonProperties() { + protected CommonProperties() { } /** - * Get the filterableProperties property: list of filters supported for a product. + * Get the filterableProperties property: List of filters supported for a product. * * @return the filterableProperties value. */ @@ -67,7 +72,7 @@ public List filterableProperties() { } /** - * Set the filterableProperties property: list of filters supported for a product. + * Set the filterableProperties property: List of filters supported for a product. * * @param filterableProperties the filterableProperties value to set. * @return the CommonProperties object itself. @@ -77,6 +82,16 @@ CommonProperties withFilterableProperties(List filterablePro return this; } + /** + * Get the fulfilledBy property: The entity responsible for fulfillment of the item at the given hierarchy level. + * + * @return the fulfilledBy value. + */ + @Override + public FulfillmentType fulfilledBy() { + return this.fulfilledBy; + } + /** * Get the hierarchyInformation property: Hierarchy information of a product. * @@ -202,6 +217,8 @@ public static CommonProperties fromJson(JsonReader jsonReader) throws IOExceptio deserializedCommonProperties.availabilityInformation = AvailabilityInformation.fromJson(reader); } else if ("hierarchyInformation".equals(fieldName)) { deserializedCommonProperties.hierarchyInformation = HierarchyInformation.fromJson(reader); + } else if ("fulfilledBy".equals(fieldName)) { + deserializedCommonProperties.fulfilledBy = FulfillmentType.fromString(reader.getString()); } else if ("filterableProperties".equals(fieldName)) { List filterableProperties = reader.readArray(reader1 -> FilterableProperty.fromJson(reader1)); diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Configuration.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Configuration.java index b875ed262d25..3f93fab5210e 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Configuration.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Configuration.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; import com.azure.resourcemanager.edgeorder.fluent.models.ConfigurationInner; +import java.time.Duration; import java.util.List; /** @@ -26,7 +27,38 @@ public interface Configuration { Dimensions dimensions(); /** - * Gets the filterableProperties property: list of filters supported for a product. + * Gets the provisioningSupport property: Determining nature of provisioning that the configuration supports. + * + * @return the provisioningSupport value. + */ + ProvisioningSupport provisioningSupport(); + + /** + * Gets the childConfigurationTypes property: Different types of child configurations which exist for this + * configuration, these can be used to populate the child configuration filter. + * + * @return the childConfigurationTypes value. + */ + List childConfigurationTypes(); + + /** + * Gets the groupedChildConfigurations property: Child configurations present for the configuration after applying + * child configuration filter, grouped by the category name of the child configuration. + * + * @return the groupedChildConfigurations value. + */ + List groupedChildConfigurations(); + + /** + * Gets the supportedTermCommitmentDurations property: The Term Commitment Durations that are supported for a + * configuration. + * + * @return the supportedTermCommitmentDurations value. + */ + List supportedTermCommitmentDurations(); + + /** + * Gets the filterableProperties property: List of filters supported for a product. * * @return the filterableProperties value. */ @@ -74,6 +106,13 @@ public interface Configuration { */ HierarchyInformation hierarchyInformation(); + /** + * Gets the fulfilledBy property: The entity responsible for fulfillment of the item at the given hierarchy level. + * + * @return the fulfilledBy value. + */ + FulfillmentType fulfilledBy(); + /** * Gets the inner com.azure.resourcemanager.edgeorder.fluent.models.ConfigurationInner object. * diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ConfigurationDeviceDetails.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ConfigurationDeviceDetails.java new file mode 100644 index 000000000000..e1665ec91fb7 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ConfigurationDeviceDetails.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Device details for configuration. + */ +@Immutable +public final class ConfigurationDeviceDetails implements JsonSerializable { + /* + * Display details of the product. + */ + private DisplayInfo displayInfo; + + /* + * Hierarchy of the product which uniquely identifies the configuration. + */ + private HierarchyInformation hierarchyInformation; + + /* + * Quantity of the product. + */ + private Integer quantity; + + /* + * Identification type of the configuration. + */ + private IdentificationType identificationType; + + /* + * List of device details. + */ + private List deviceDetails; + + /* + * Term Commitment Information of the Device. + */ + private TermCommitmentInformation termCommitmentInformation; + + /** + * Creates an instance of ConfigurationDeviceDetails class. + */ + private ConfigurationDeviceDetails() { + } + + /** + * Get the displayInfo property: Display details of the product. + * + * @return the displayInfo value. + */ + public DisplayInfo displayInfo() { + return this.displayInfo; + } + + /** + * Get the hierarchyInformation property: Hierarchy of the product which uniquely identifies the configuration. + * + * @return the hierarchyInformation value. + */ + public HierarchyInformation hierarchyInformation() { + return this.hierarchyInformation; + } + + /** + * Get the quantity property: Quantity of the product. + * + * @return the quantity value. + */ + public Integer quantity() { + return this.quantity; + } + + /** + * Get the identificationType property: Identification type of the configuration. + * + * @return the identificationType value. + */ + public IdentificationType identificationType() { + return this.identificationType; + } + + /** + * Get the deviceDetails property: List of device details. + * + * @return the deviceDetails value. + */ + public List deviceDetails() { + return this.deviceDetails; + } + + /** + * Get the termCommitmentInformation property: Term Commitment Information of the Device. + * + * @return the termCommitmentInformation value. + */ + public TermCommitmentInformation termCommitmentInformation() { + return this.termCommitmentInformation; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (displayInfo() != null) { + displayInfo().validate(); + } + if (hierarchyInformation() != null) { + hierarchyInformation().validate(); + } + if (deviceDetails() != null) { + deviceDetails().forEach(e -> e.validate()); + } + if (termCommitmentInformation() != null) { + termCommitmentInformation().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("displayInfo", this.displayInfo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfigurationDeviceDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfigurationDeviceDetails if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConfigurationDeviceDetails. + */ + public static ConfigurationDeviceDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfigurationDeviceDetails deserializedConfigurationDeviceDetails = new ConfigurationDeviceDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("displayInfo".equals(fieldName)) { + deserializedConfigurationDeviceDetails.displayInfo = DisplayInfo.fromJson(reader); + } else if ("hierarchyInformation".equals(fieldName)) { + deserializedConfigurationDeviceDetails.hierarchyInformation = HierarchyInformation.fromJson(reader); + } else if ("quantity".equals(fieldName)) { + deserializedConfigurationDeviceDetails.quantity = reader.getNullable(JsonReader::getInt); + } else if ("identificationType".equals(fieldName)) { + deserializedConfigurationDeviceDetails.identificationType + = IdentificationType.fromString(reader.getString()); + } else if ("deviceDetails".equals(fieldName)) { + List deviceDetails = reader.readArray(reader1 -> DeviceDetails.fromJson(reader1)); + deserializedConfigurationDeviceDetails.deviceDetails = deviceDetails; + } else if ("termCommitmentInformation".equals(fieldName)) { + deserializedConfigurationDeviceDetails.termCommitmentInformation + = TermCommitmentInformation.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedConfigurationDeviceDetails; + }); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ConfigurationFilters.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ConfigurationFilter.java similarity index 52% rename from sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ConfigurationFilters.java rename to sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ConfigurationFilter.java index e83e0e7aff89..f516e32f5a41 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ConfigurationFilters.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ConfigurationFilter.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -17,21 +17,28 @@ * Configuration filters. */ @Fluent -public final class ConfigurationFilters implements JsonSerializable { +public final class ConfigurationFilter implements JsonSerializable { /* - * Product hierarchy information + * Product hierarchy information. */ private HierarchyInformation hierarchyInformation; /* - * Filters specific to product + * Filters specific to product. */ private List filterableProperty; + /* + * Filter to fetch specific child configurations that exist in the configuration. This must be passed to either + * fetch a list of specific child configurations, or all child configurations of specific types of child + * configurations. + */ + private ChildConfigurationFilter childConfigurationFilter; + /** - * Creates an instance of ConfigurationFilters class. + * Creates an instance of ConfigurationFilter class. */ - public ConfigurationFilters() { + public ConfigurationFilter() { } /** @@ -47,9 +54,9 @@ public HierarchyInformation hierarchyInformation() { * Set the hierarchyInformation property: Product hierarchy information. * * @param hierarchyInformation the hierarchyInformation value to set. - * @return the ConfigurationFilters object itself. + * @return the ConfigurationFilter object itself. */ - public ConfigurationFilters withHierarchyInformation(HierarchyInformation hierarchyInformation) { + public ConfigurationFilter withHierarchyInformation(HierarchyInformation hierarchyInformation) { this.hierarchyInformation = hierarchyInformation; return this; } @@ -67,13 +74,37 @@ public List filterableProperty() { * Set the filterableProperty property: Filters specific to product. * * @param filterableProperty the filterableProperty value to set. - * @return the ConfigurationFilters object itself. + * @return the ConfigurationFilter object itself. */ - public ConfigurationFilters withFilterableProperty(List filterableProperty) { + public ConfigurationFilter withFilterableProperty(List filterableProperty) { this.filterableProperty = filterableProperty; return this; } + /** + * Get the childConfigurationFilter property: Filter to fetch specific child configurations that exist in the + * configuration. This must be passed to either fetch a list of specific child configurations, or all child + * configurations of specific types of child configurations. + * + * @return the childConfigurationFilter value. + */ + public ChildConfigurationFilter childConfigurationFilter() { + return this.childConfigurationFilter; + } + + /** + * Set the childConfigurationFilter property: Filter to fetch specific child configurations that exist in the + * configuration. This must be passed to either fetch a list of specific child configurations, or all child + * configurations of specific types of child configurations. + * + * @param childConfigurationFilter the childConfigurationFilter value to set. + * @return the ConfigurationFilter object itself. + */ + public ConfigurationFilter withChildConfigurationFilter(ChildConfigurationFilter childConfigurationFilter) { + this.childConfigurationFilter = childConfigurationFilter; + return this; + } + /** * Validates the instance. * @@ -83,16 +114,19 @@ public void validate() { if (hierarchyInformation() == null) { throw LOGGER.atError() .log(new IllegalArgumentException( - "Missing required property hierarchyInformation in model ConfigurationFilters")); + "Missing required property hierarchyInformation in model ConfigurationFilter")); } else { hierarchyInformation().validate(); } if (filterableProperty() != null) { filterableProperty().forEach(e -> e.validate()); } + if (childConfigurationFilter() != null) { + childConfigurationFilter().validate(); + } } - private static final ClientLogger LOGGER = new ClientLogger(ConfigurationFilters.class); + private static final ClientLogger LOGGER = new ClientLogger(ConfigurationFilter.class); /** * {@inheritDoc} @@ -103,37 +137,41 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("hierarchyInformation", this.hierarchyInformation); jsonWriter.writeArrayField("filterableProperty", this.filterableProperty, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("childConfigurationFilter", this.childConfigurationFilter); return jsonWriter.writeEndObject(); } /** - * Reads an instance of ConfigurationFilters from the JsonReader. + * Reads an instance of ConfigurationFilter from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ConfigurationFilters if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. + * @return An instance of ConfigurationFilter 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 ConfigurationFilters. + * @throws IOException If an error occurs while reading the ConfigurationFilter. */ - public static ConfigurationFilters fromJson(JsonReader jsonReader) throws IOException { + public static ConfigurationFilter fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - ConfigurationFilters deserializedConfigurationFilters = new ConfigurationFilters(); + ConfigurationFilter deserializedConfigurationFilter = new ConfigurationFilter(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("hierarchyInformation".equals(fieldName)) { - deserializedConfigurationFilters.hierarchyInformation = HierarchyInformation.fromJson(reader); + deserializedConfigurationFilter.hierarchyInformation = HierarchyInformation.fromJson(reader); } else if ("filterableProperty".equals(fieldName)) { List filterableProperty = reader.readArray(reader1 -> FilterableProperty.fromJson(reader1)); - deserializedConfigurationFilters.filterableProperty = filterableProperty; + deserializedConfigurationFilter.filterableProperty = filterableProperty; + } else if ("childConfigurationFilter".equals(fieldName)) { + deserializedConfigurationFilter.childConfigurationFilter + = ChildConfigurationFilter.fromJson(reader); } else { reader.skipChildren(); } } - return deserializedConfigurationFilters; + return deserializedConfigurationFilter; }); } } diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ConfigurationsRequest.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ConfigurationsRequest.java index 653b9e3e6a90..19b608c229a5 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ConfigurationsRequest.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ConfigurationsRequest.java @@ -1,17 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.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; import com.azure.json.JsonWriter; import java.io.IOException; -import java.util.List; /** * Configuration request object. @@ -21,11 +19,11 @@ public final class ConfigurationsRequest implements JsonSerializable configurationFilters; + private ConfigurationFilter configurationFilter; /* * Customer subscription properties. Clients can display available products to unregistered customers by explicitly - * passing subscription details + * passing subscription details. */ private CustomerSubscriptionDetails customerSubscriptionDetails; @@ -36,22 +34,22 @@ public ConfigurationsRequest() { } /** - * Get the configurationFilters property: Holds details about product hierarchy information and filterable property. + * Get the configurationFilter property: Holds details about product hierarchy information and filterable property. * - * @return the configurationFilters value. + * @return the configurationFilter value. */ - public List configurationFilters() { - return this.configurationFilters; + public ConfigurationFilter configurationFilter() { + return this.configurationFilter; } /** - * Set the configurationFilters property: Holds details about product hierarchy information and filterable property. + * Set the configurationFilter property: Holds details about product hierarchy information and filterable property. * - * @param configurationFilters the configurationFilters value to set. + * @param configurationFilter the configurationFilter value to set. * @return the ConfigurationsRequest object itself. */ - public ConfigurationsRequest withConfigurationFilters(List configurationFilters) { - this.configurationFilters = configurationFilters; + public ConfigurationsRequest withConfigurationFilter(ConfigurationFilter configurationFilter) { + this.configurationFilter = configurationFilter; return this; } @@ -84,28 +82,21 @@ public CustomerSubscriptionDetails customerSubscriptionDetails() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (configurationFilters() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property configurationFilters in model ConfigurationsRequest")); - } else { - configurationFilters().forEach(e -> e.validate()); + if (configurationFilter() != null) { + configurationFilter().validate(); } if (customerSubscriptionDetails() != null) { customerSubscriptionDetails().validate(); } } - private static final ClientLogger LOGGER = new ClientLogger(ConfigurationsRequest.class); - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("configurationFilters", this.configurationFilters, - (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("configurationFilter", this.configurationFilter); jsonWriter.writeJsonField("customerSubscriptionDetails", this.customerSubscriptionDetails); return jsonWriter.writeEndObject(); } @@ -116,7 +107,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ConfigurationsRequest 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 ConfigurationsRequest. */ public static ConfigurationsRequest fromJson(JsonReader jsonReader) throws IOException { @@ -126,10 +116,8 @@ public static ConfigurationsRequest fromJson(JsonReader jsonReader) throws IOExc String fieldName = reader.getFieldName(); reader.nextToken(); - if ("configurationFilters".equals(fieldName)) { - List configurationFilters - = reader.readArray(reader1 -> ConfigurationFilters.fromJson(reader1)); - deserializedConfigurationsRequest.configurationFilters = configurationFilters; + if ("configurationFilter".equals(fieldName)) { + deserializedConfigurationsRequest.configurationFilter = ConfigurationFilter.fromJson(reader); } else if ("customerSubscriptionDetails".equals(fieldName)) { deserializedConfigurationsRequest.customerSubscriptionDetails = CustomerSubscriptionDetails.fromJson(reader); diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ContactDetails.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ContactDetails.java index f707d8cb7349..766b1afb9a33 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ContactDetails.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ContactDetails.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.edgeorder.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; @@ -155,22 +154,8 @@ public ContactDetails withEmailList(List emailList) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (contactName() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property contactName in model ContactDetails")); - } - if (phone() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property phone in model ContactDetails")); - } - if (emailList() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property emailList in model ContactDetails")); - } } - private static final ClientLogger LOGGER = new ClientLogger(ContactDetails.class); - /** * {@inheritDoc} */ @@ -179,9 +164,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("contactName", this.contactName); jsonWriter.writeStringField("phone", this.phone); - jsonWriter.writeArrayField("emailList", this.emailList, (writer, element) -> writer.writeString(element)); jsonWriter.writeStringField("phoneExtension", this.phoneExtension); jsonWriter.writeStringField("mobile", this.mobile); + jsonWriter.writeArrayField("emailList", this.emailList, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -191,7 +176,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ContactDetails 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 ContactDetails. */ public static ContactDetails fromJson(JsonReader jsonReader) throws IOException { @@ -205,13 +189,13 @@ public static ContactDetails fromJson(JsonReader jsonReader) throws IOException deserializedContactDetails.contactName = reader.getString(); } else if ("phone".equals(fieldName)) { deserializedContactDetails.phone = reader.getString(); - } else if ("emailList".equals(fieldName)) { - List emailList = reader.readArray(reader1 -> reader1.getString()); - deserializedContactDetails.emailList = emailList; } else if ("phoneExtension".equals(fieldName)) { deserializedContactDetails.phoneExtension = reader.getString(); } else if ("mobile".equals(fieldName)) { deserializedContactDetails.mobile = reader.getString(); + } else if ("emailList".equals(fieldName)) { + List emailList = reader.readArray(reader1 -> reader1.getString()); + deserializedContactDetails.emailList = emailList; } else { reader.skipChildren(); } diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/CostInformation.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/CostInformation.java index 0067c06067ef..f00b154008b4 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/CostInformation.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/CostInformation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -23,14 +23,14 @@ public final class CostInformation implements JsonSerializable private List billingMeterDetails; /* - * Default url to display billing information + * Default url to display billing information. */ private String billingInfoUrl; /** * Creates an instance of CostInformation class. */ - public CostInformation() { + private CostInformation() { } /** diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/CustomerSubscriptionDetails.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/CustomerSubscriptionDetails.java index 030908f43514..ac110c507666 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/CustomerSubscriptionDetails.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/CustomerSubscriptionDetails.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -20,17 +20,17 @@ @Fluent public final class CustomerSubscriptionDetails implements JsonSerializable { /* - * List of registered feature flags for subscription + * List of registered feature flags for subscription. */ private List registeredFeatures; /* - * Location placement Id of a subscription + * Location placement Id of a subscription. */ private String locationPlacementId; /* - * Quota ID of a subscription + * Quota ID of a subscription. */ private String quotaId; diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/CustomerSubscriptionRegisteredFeatures.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/CustomerSubscriptionRegisteredFeatures.java index 7b264cfcd2ce..c14957dc835f 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/CustomerSubscriptionRegisteredFeatures.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/CustomerSubscriptionRegisteredFeatures.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -18,12 +18,12 @@ public final class CustomerSubscriptionRegisteredFeatures implements JsonSerializable { /* - * Name of subscription registered feature + * Name of subscription registered feature. */ private String name; /* - * State of subscription registered feature + * State of subscription registered feature. */ private String state; diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Description.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Description.java index b1b37c9fa311..84ea93fb9ccd 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Description.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Description.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -50,7 +50,7 @@ public final class Description implements JsonSerializable { /** * Creates an instance of Description class. */ - public Description() { + private Description() { } /** diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/DescriptionType.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/DescriptionType.java index 1995a8d90d5f..fddf253ac988 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/DescriptionType.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/DescriptionType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -12,7 +12,7 @@ */ public final class DescriptionType extends ExpandableStringEnum { /** - * Static value Base for DescriptionType. + * Base description. */ public static final DescriptionType BASE = fromString("Base"); diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/DeviceDetails.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/DeviceDetails.java index 70a798b9cec6..cfc583f9f59d 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/DeviceDetails.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/DeviceDetails.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -17,28 +17,43 @@ @Immutable public final class DeviceDetails implements JsonSerializable { /* - * device serial number + * Device serial number. */ private String serialNumber; /* - * Management Resource Id + * Device serial number to be displayed. + */ + private String displaySerialNumber; + + /* + * Management Resource Id. */ private String managementResourceId; /* - * Management Resource Tenant ID + * Management Resource Tenant ID. */ private String managementResourceTenantId; + /* + * Determining nature of provisioning that the configuration supports. + */ + private ProvisioningSupport provisioningSupport; + + /* + * Provisioning Details for the device. + */ + private ProvisioningDetails provisioningDetails; + /** * Creates an instance of DeviceDetails class. */ - public DeviceDetails() { + private DeviceDetails() { } /** - * Get the serialNumber property: device serial number. + * Get the serialNumber property: Device serial number. * * @return the serialNumber value. */ @@ -46,6 +61,15 @@ public String serialNumber() { return this.serialNumber; } + /** + * Get the displaySerialNumber property: Device serial number to be displayed. + * + * @return the displaySerialNumber value. + */ + public String displaySerialNumber() { + return this.displaySerialNumber; + } + /** * Get the managementResourceId property: Management Resource Id. * @@ -64,12 +88,33 @@ public String managementResourceTenantId() { return this.managementResourceTenantId; } + /** + * Get the provisioningSupport property: Determining nature of provisioning that the configuration supports. + * + * @return the provisioningSupport value. + */ + public ProvisioningSupport provisioningSupport() { + return this.provisioningSupport; + } + + /** + * Get the provisioningDetails property: Provisioning Details for the device. + * + * @return the provisioningDetails value. + */ + public ProvisioningDetails provisioningDetails() { + return this.provisioningDetails; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (provisioningDetails() != null) { + provisioningDetails().validate(); + } } /** @@ -98,10 +143,16 @@ public static DeviceDetails fromJson(JsonReader jsonReader) throws IOException { if ("serialNumber".equals(fieldName)) { deserializedDeviceDetails.serialNumber = reader.getString(); + } else if ("displaySerialNumber".equals(fieldName)) { + deserializedDeviceDetails.displaySerialNumber = reader.getString(); } else if ("managementResourceId".equals(fieldName)) { deserializedDeviceDetails.managementResourceId = reader.getString(); } else if ("managementResourceTenantId".equals(fieldName)) { deserializedDeviceDetails.managementResourceTenantId = reader.getString(); + } else if ("provisioningSupport".equals(fieldName)) { + deserializedDeviceDetails.provisioningSupport = ProvisioningSupport.fromString(reader.getString()); + } else if ("provisioningDetails".equals(fieldName)) { + deserializedDeviceDetails.provisioningDetails = ProvisioningDetails.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/DevicePresenceVerificationDetails.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/DevicePresenceVerificationDetails.java new file mode 100644 index 000000000000..0fedadb726ff --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/DevicePresenceVerificationDetails.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Proof of possession details. + */ +@Immutable +public final class DevicePresenceVerificationDetails implements JsonSerializable { + /* + * Proof of possession status. + */ + private DevicePresenceVerificationStatus status; + + /* + * Insights on current status. + */ + private String message; + + /** + * Creates an instance of DevicePresenceVerificationDetails class. + */ + public DevicePresenceVerificationDetails() { + } + + /** + * Get the status property: Proof of possession status. + * + * @return the status value. + */ + public DevicePresenceVerificationStatus status() { + return this.status; + } + + /** + * Get the message property: Insights on current status. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DevicePresenceVerificationDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DevicePresenceVerificationDetails if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DevicePresenceVerificationDetails. + */ + public static DevicePresenceVerificationDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DevicePresenceVerificationDetails deserializedDevicePresenceVerificationDetails + = new DevicePresenceVerificationDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedDevicePresenceVerificationDetails.status + = DevicePresenceVerificationStatus.fromString(reader.getString()); + } else if ("message".equals(fieldName)) { + deserializedDevicePresenceVerificationDetails.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDevicePresenceVerificationDetails; + }); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/DevicePresenceVerificationStatus.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/DevicePresenceVerificationStatus.java new file mode 100644 index 000000000000..4342f6e85c45 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/DevicePresenceVerificationStatus.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Proof of possession status. + */ +public final class DevicePresenceVerificationStatus extends ExpandableStringEnum { + /** + * The device has not yet been verified to be with the right edge operator or at the right location. + */ + public static final DevicePresenceVerificationStatus NOT_INITIATED = fromString("NotInitiated"); + + /** + * Confirms that the device is verified to be with the right edge operator or at the right location. + */ + public static final DevicePresenceVerificationStatus COMPLETED = fromString("Completed"); + + /** + * Creates a new instance of DevicePresenceVerificationStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DevicePresenceVerificationStatus() { + } + + /** + * Creates or finds a DevicePresenceVerificationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding DevicePresenceVerificationStatus. + */ + public static DevicePresenceVerificationStatus fromString(String name) { + return fromString(name, DevicePresenceVerificationStatus.class); + } + + /** + * Gets known DevicePresenceVerificationStatus values. + * + * @return known DevicePresenceVerificationStatus values. + */ + public static Collection values() { + return values(DevicePresenceVerificationStatus.class); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Dimensions.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Dimensions.java index c7087e2eea47..54be22c9a497 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Dimensions.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Dimensions.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -54,7 +54,7 @@ public final class Dimensions implements JsonSerializable { /** * Creates an instance of Dimensions class. */ - public Dimensions() { + private Dimensions() { } /** diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/DisabledReason.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/DisabledReason.java index 22216e2c6d95..37924cff9a2b 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/DisabledReason.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/DisabledReason.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -12,42 +12,42 @@ */ public final class DisabledReason extends ExpandableStringEnum { /** - * Static value None for DisabledReason. + * Not disabled. */ public static final DisabledReason NONE = fromString("None"); /** - * Static value Country for DisabledReason. + * Not available in the requested country. */ public static final DisabledReason COUNTRY = fromString("Country"); /** - * Static value Region for DisabledReason. + * Not available to push data to the requested Azure region. */ public static final DisabledReason REGION = fromString("Region"); /** - * Static value Feature for DisabledReason. + * Required features are not enabled. */ public static final DisabledReason FEATURE = fromString("Feature"); /** - * Static value OfferType for DisabledReason. + * Subscription does not have required offer types. */ public static final DisabledReason OFFER_TYPE = fromString("OfferType"); /** - * Static value NoSubscriptionInfo for DisabledReason. + * Subscription has not registered to Microsoft.DataBox and Service does not have the subscription notification. */ public static final DisabledReason NO_SUBSCRIPTION_INFO = fromString("NoSubscriptionInfo"); /** - * Static value NotAvailable for DisabledReason. + * The product is not yet available. */ public static final DisabledReason NOT_AVAILABLE = fromString("NotAvailable"); /** - * Static value OutOfStock for DisabledReason. + * The product is out of stock. */ public static final DisabledReason OUT_OF_STOCK = fromString("OutOfStock"); diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/DisplayInfo.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/DisplayInfo.java index f4fd4c743762..288e604ef8ce 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/DisplayInfo.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/DisplayInfo.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -17,12 +17,12 @@ @Immutable public final class DisplayInfo implements JsonSerializable { /* - * Product family display name + * Product family display name. */ private String productFamilyDisplayName; /* - * Configuration display name + * Configuration display name. */ private String configurationDisplayName; diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/DoubleEncryptionStatus.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/DoubleEncryptionStatus.java index d861ed499d55..1ca5d9a49451 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/DoubleEncryptionStatus.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/DoubleEncryptionStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -13,12 +13,12 @@ */ public final class DoubleEncryptionStatus extends ExpandableStringEnum { /** - * Static value Disabled for DoubleEncryptionStatus. + * Double encryption is disabled. */ public static final DoubleEncryptionStatus DISABLED = fromString("Disabled"); /** - * Static value Enabled for DoubleEncryptionStatus. + * Double encryption is enabled. */ public static final DoubleEncryptionStatus ENABLED = fromString("Enabled"); diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/EncryptionPreferences.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/EncryptionPreferences.java index b53ade7e1e6b..c253786573d7 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/EncryptionPreferences.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/EncryptionPreferences.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/FilterableProperty.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/FilterableProperty.java index 6bf18126fd09..c6465b5235da 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/FilterableProperty.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/FilterableProperty.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ForwardShippingDetails.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ForwardShippingDetails.java index caaf70b5cd41..925f89b825e4 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ForwardShippingDetails.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ForwardShippingDetails.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -27,7 +27,7 @@ public final class ForwardShippingDetails implements JsonSerializable { + /** + * The fulfillment (the whole journey of the product offering) is handled by microsoft. + */ + public static final FulfillmentType MICROSOFT = fromString("Microsoft"); + + /** + * The fulfillment (the whole journey of the product offering) is handled by external third party entities. + */ + public static final FulfillmentType EXTERNAL = fromString("External"); + + /** + * Creates a new instance of FulfillmentType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FulfillmentType() { + } + + /** + * Creates or finds a FulfillmentType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FulfillmentType. + */ + public static FulfillmentType fromString(String name) { + return fromString(name, FulfillmentType.class); + } + + /** + * Gets known FulfillmentType values. + * + * @return known FulfillmentType values. + */ + public static Collection values() { + return values(FulfillmentType.class); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/GroupedChildConfigurations.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/GroupedChildConfigurations.java new file mode 100644 index 000000000000..a8661a702c37 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/GroupedChildConfigurations.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Grouped child configuration object. + */ +@Immutable +public final class GroupedChildConfigurations implements JsonSerializable { + /* + * Category information. + */ + private CategoryInformation categoryInformation; + + /* + * List of child configurations. + */ + private List childConfigurations; + + /** + * Creates an instance of GroupedChildConfigurations class. + */ + private GroupedChildConfigurations() { + } + + /** + * Get the categoryInformation property: Category information. + * + * @return the categoryInformation value. + */ + public CategoryInformation categoryInformation() { + return this.categoryInformation; + } + + /** + * Get the childConfigurations property: List of child configurations. + * + * @return the childConfigurations value. + */ + public List childConfigurations() { + return this.childConfigurations; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (categoryInformation() != null) { + categoryInformation().validate(); + } + if (childConfigurations() != null) { + childConfigurations().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GroupedChildConfigurations from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GroupedChildConfigurations if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GroupedChildConfigurations. + */ + public static GroupedChildConfigurations fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GroupedChildConfigurations deserializedGroupedChildConfigurations = new GroupedChildConfigurations(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("categoryInformation".equals(fieldName)) { + deserializedGroupedChildConfigurations.categoryInformation = CategoryInformation.fromJson(reader); + } else if ("childConfigurations".equals(fieldName)) { + List childConfigurations + = reader.readArray(reader1 -> ChildConfiguration.fromJson(reader1)); + deserializedGroupedChildConfigurations.childConfigurations = childConfigurations; + } else { + reader.skipChildren(); + } + } + + return deserializedGroupedChildConfigurations; + }); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/HierarchyInformation.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/HierarchyInformation.java index 2f190b6636ce..1bf3e7a61de2 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/HierarchyInformation.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/HierarchyInformation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -17,25 +17,30 @@ @Fluent public final class HierarchyInformation implements JsonSerializable { /* - * Represents product family name that uniquely identifies product family + * Represents product family name that uniquely identifies product family. */ private String productFamilyName; /* - * Represents product line name that uniquely identifies product line + * Represents product line name that uniquely identifies product line. */ private String productLineName; /* - * Represents product name that uniquely identifies product + * Represents product name that uniquely identifies product. */ private String productName; /* - * Represents configuration name that uniquely identifies configuration + * Represents configuration name that uniquely identifies configuration. */ private String configurationName; + /* + * Represents Model Display Name. + */ + private String configurationIdDisplayName; + /** * Creates an instance of HierarchyInformation class. */ @@ -122,6 +127,26 @@ public HierarchyInformation withConfigurationName(String configurationName) { return this; } + /** + * Get the configurationIdDisplayName property: Represents Model Display Name. + * + * @return the configurationIdDisplayName value. + */ + public String configurationIdDisplayName() { + return this.configurationIdDisplayName; + } + + /** + * Set the configurationIdDisplayName property: Represents Model Display Name. + * + * @param configurationIdDisplayName the configurationIdDisplayName value to set. + * @return the HierarchyInformation object itself. + */ + public HierarchyInformation withConfigurationIdDisplayName(String configurationIdDisplayName) { + this.configurationIdDisplayName = configurationIdDisplayName; + return this; + } + /** * Validates the instance. * @@ -140,6 +165,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("productLineName", this.productLineName); jsonWriter.writeStringField("productName", this.productName); jsonWriter.writeStringField("configurationName", this.configurationName); + jsonWriter.writeStringField("configurationIdDisplayName", this.configurationIdDisplayName); return jsonWriter.writeEndObject(); } @@ -166,6 +192,8 @@ public static HierarchyInformation fromJson(JsonReader jsonReader) throws IOExce deserializedHierarchyInformation.productName = reader.getString(); } else if ("configurationName".equals(fieldName)) { deserializedHierarchyInformation.configurationName = reader.getString(); + } else if ("configurationIdDisplayName".equals(fieldName)) { + deserializedHierarchyInformation.configurationIdDisplayName = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/IdentificationType.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/IdentificationType.java new file mode 100644 index 000000000000..61ce20398257 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/IdentificationType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Identification type of the configuration. + */ +public final class IdentificationType extends ExpandableStringEnum { + /** + * Product does not have any explicit identifier. + */ + public static final IdentificationType NOT_SUPPORTED = fromString("NotSupported"); + + /** + * Product is identifiable by serial number. + */ + public static final IdentificationType SERIAL_NUMBER = fromString("SerialNumber"); + + /** + * Creates a new instance of IdentificationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IdentificationType() { + } + + /** + * Creates or finds a IdentificationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding IdentificationType. + */ + public static IdentificationType fromString(String name) { + return fromString(name, IdentificationType.class); + } + + /** + * Gets known IdentificationType values. + * + * @return known IdentificationType values. + */ + public static Collection values() { + return values(IdentificationType.class); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ImageInformation.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ImageInformation.java index 2d96bdbb2f40..eac34dae144b 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ImageInformation.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ImageInformation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -17,19 +17,19 @@ @Immutable public final class ImageInformation implements JsonSerializable { /* - * Type of the image + * Type of the image. */ private ImageType imageType; /* - * Url of the image + * Url of the image. */ private String imageUrl; /** * Creates an instance of ImageInformation class. */ - public ImageInformation() { + private ImageInformation() { } /** diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ImageType.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ImageType.java index 23f850b42122..074d28fb4dc9 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ImageType.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/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.edgeorder.models; @@ -12,17 +12,17 @@ */ public final class ImageType extends ExpandableStringEnum { /** - * Static value MainImage for ImageType. + * Main image. */ public static final ImageType MAIN_IMAGE = fromString("MainImage"); /** - * Static value BulletImage for ImageType. + * Bullet image. */ public static final ImageType BULLET_IMAGE = fromString("BulletImage"); /** - * Static value GenericImage for ImageType. + * Generic image. */ public static final ImageType GENERIC_IMAGE = fromString("GenericImage"); diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/LengthHeightUnit.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/LengthHeightUnit.java index f5a1ee88494f..03f602b6080c 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/LengthHeightUnit.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/LengthHeightUnit.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -12,12 +12,12 @@ */ public final class LengthHeightUnit extends ExpandableStringEnum { /** - * Static value IN for LengthHeightUnit. + * Inch, applicable for West US. */ public static final LengthHeightUnit IN = fromString("IN"); /** - * Static value CM for LengthHeightUnit. + * Centimeter. */ public static final LengthHeightUnit CM = fromString("CM"); diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Link.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Link.java index f337f7f85963..c7d2683f16fe 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Link.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Link.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -17,19 +17,19 @@ @Immutable public final class Link implements JsonSerializable { /* - * Type of link + * Type of link. */ private LinkType linkType; /* - * Url of the link + * Url of the link. */ private String linkUrl; /** * Creates an instance of Link class. */ - public Link() { + private Link() { } /** diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/LinkType.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/LinkType.java index f9f8ec064f9c..451c7d589efc 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/LinkType.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/LinkType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -12,35 +12,40 @@ */ public final class LinkType extends ExpandableStringEnum { /** - * Static value Generic for LinkType. + * Generic link. */ public static final LinkType GENERIC = fromString("Generic"); /** - * Static value TermsAndConditions for LinkType. + * Terms and conditions link. */ public static final LinkType TERMS_AND_CONDITIONS = fromString("TermsAndConditions"); /** - * Static value Specification for LinkType. + * Link to product specification. */ public static final LinkType SPECIFICATION = fromString("Specification"); /** - * Static value Documentation for LinkType. + * Link to product documentation. */ public static final LinkType DOCUMENTATION = fromString("Documentation"); /** - * Static value KnowMore for LinkType. + * Link to know more. */ public static final LinkType KNOW_MORE = fromString("KnowMore"); /** - * Static value SignUp for LinkType. + * Link to sign up for products. */ public static final LinkType SIGN_UP = fromString("SignUp"); + /** + * Link to order the product from another source and not from Azure Edge Hardware Center. + */ + public static final LinkType DISCOVERABLE = fromString("Discoverable"); + /** * Creates a new instance of LinkType value. * diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ManagementResourcePreferences.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ManagementResourcePreferences.java index ed498b6cea36..456a4f732364 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ManagementResourcePreferences.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ManagementResourcePreferences.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -17,7 +17,7 @@ @Fluent public final class ManagementResourcePreferences implements JsonSerializable { /* - * Customer preferred Management resource ARM ID + * Customer preferred Management resource ARM ID. */ private String preferredManagementResourceId; diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/MeterDetails.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/MeterDetails.java index e5207c4bd929..f3d98436cceb 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/MeterDetails.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/MeterDetails.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -22,7 +22,7 @@ public class MeterDetails implements JsonSerializable { private BillingType billingType = BillingType.fromString("MeterDetails"); /* - * Billing unit applicable for Pav2 billing + * Billing unit applicable for Pav2 billing. */ private Double multiplier; @@ -34,7 +34,7 @@ public class MeterDetails implements JsonSerializable { /** * Creates an instance of MeterDetails class. */ - public MeterDetails() { + protected MeterDetails() { } /** diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/MeteringType.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/MeteringType.java index a1ca51797175..982ccb48f4f3 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/MeteringType.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/MeteringType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -12,17 +12,17 @@ */ public final class MeteringType extends ExpandableStringEnum { /** - * Static value OneTime for MeteringType. + * One time billing. */ public static final MeteringType ONE_TIME = fromString("OneTime"); /** - * Static value Recurring for MeteringType. + * Recurring billing. */ public static final MeteringType RECURRING = fromString("Recurring"); /** - * Static value Adhoc for MeteringType. + * Adhoc billing. */ public static final MeteringType ADHOC = fromString("Adhoc"); diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/NotificationPreference.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/NotificationPreference.java index ba61fce6b097..81ebc77b92c0 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/NotificationPreference.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/NotificationPreference.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/NotificationStageName.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/NotificationStageName.java index c8473d6278f9..79b1753f1db3 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/NotificationStageName.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/NotificationStageName.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -12,12 +12,12 @@ */ public final class NotificationStageName extends ExpandableStringEnum { /** - * Static value Shipped for NotificationStageName. + * Notification at order item shipped from microsoft datacenter. */ public static final NotificationStageName SHIPPED = fromString("Shipped"); /** - * Static value Delivered for NotificationStageName. + * Notification at order item delivered to customer. */ public static final NotificationStageName DELIVERED = fromString("Delivered"); diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Operation.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Operation.java index 44e6c7d24870..bab5036867a1 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Operation.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/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.edgeorder.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/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OperationDisplay.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OperationDisplay.java index 46d6226151fa..92d2556d6c97 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OperationDisplay.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/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.edgeorder.models; @@ -12,7 +12,7 @@ import java.io.IOException; /** - * Localized display information for this particular operation. + * Localized display information for and operation. */ @Immutable public final class OperationDisplay implements JsonSerializable { @@ -42,7 +42,7 @@ public final class OperationDisplay implements JsonSerializable list(); + + /** + * List the operations for the provider. + * + * @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 list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderItemCancellationEnum.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderItemCancellationEnum.java index 775b00196b6a..1b93fd7519d7 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderItemCancellationEnum.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderItemCancellationEnum.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -12,17 +12,17 @@ */ public final class OrderItemCancellationEnum extends ExpandableStringEnum { /** - * Static value Cancellable for OrderItemCancellationEnum. + * Order item can be cancelled without fee. */ public static final OrderItemCancellationEnum CANCELLABLE = fromString("Cancellable"); /** - * Static value CancellableWithFee for OrderItemCancellationEnum. + * Order item can be cancelled with fee. */ public static final OrderItemCancellationEnum CANCELLABLE_WITH_FEE = fromString("CancellableWithFee"); /** - * Static value NotCancellable for OrderItemCancellationEnum. + * Order item not cancellable. */ public static final OrderItemCancellationEnum NOT_CANCELLABLE = fromString("NotCancellable"); diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderItemDetails.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderItemDetails.java index a0a4200314e7..1658e05e8519 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderItemDetails.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderItemDetails.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -20,7 +20,7 @@ @Fluent public final class OrderItemDetails implements JsonSerializable { /* - * Unique identifier for configuration. + * Represents product details. */ private ProductDetails productDetails; @@ -30,32 +30,42 @@ public final class OrderItemDetails implements JsonSerializable orderItemStageHistory; /* - * Customer notification Preferences + * Customer notification Preferences. */ private Preferences preferences; /* - * Forward Package Shipping details + * Forward Package Shipping details. */ private ForwardShippingDetails forwardShippingDetails; /* - * Reverse Package Shipping details + * Reverse Package Shipping details. */ private ReverseShippingDetails reverseShippingDetails; /* - * Additional notification email list + * Additional notification email list. */ private List notificationEmailList; @@ -84,11 +94,6 @@ public final class OrderItemDetails implements JsonSerializable e.validate()); } @@ -344,6 +379,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeJsonField("productDetails", this.productDetails); jsonWriter.writeStringField("orderItemType", this.orderItemType == null ? null : this.orderItemType.toString()); + jsonWriter.writeStringField("orderItemMode", this.orderItemMode == null ? null : this.orderItemMode.toString()); + jsonWriter.writeJsonField("siteDetails", this.siteDetails); jsonWriter.writeJsonField("preferences", this.preferences); jsonWriter.writeArrayField("notificationEmailList", this.notificationEmailList, (writer, element) -> writer.writeString(element)); @@ -370,6 +407,10 @@ public static OrderItemDetails fromJson(JsonReader jsonReader) throws IOExceptio deserializedOrderItemDetails.productDetails = ProductDetails.fromJson(reader); } else if ("orderItemType".equals(fieldName)) { deserializedOrderItemDetails.orderItemType = OrderItemType.fromString(reader.getString()); + } else if ("orderItemMode".equals(fieldName)) { + deserializedOrderItemDetails.orderItemMode = OrderMode.fromString(reader.getString()); + } else if ("siteDetails".equals(fieldName)) { + deserializedOrderItemDetails.siteDetails = SiteDetails.fromJson(reader); } else if ("currentStage".equals(fieldName)) { deserializedOrderItemDetails.currentStage = StageDetails.fromJson(reader); } else if ("orderItemStageHistory".equals(fieldName)) { @@ -396,8 +437,6 @@ public static OrderItemDetails fromJson(JsonReader jsonReader) throws IOExceptio deserializedOrderItemDetails.returnReason = reader.getString(); } else if ("returnStatus".equals(fieldName)) { deserializedOrderItemDetails.returnStatus = OrderItemReturnEnum.fromString(reader.getString()); - } else if ("managementRpDetails".equals(fieldName)) { - deserializedOrderItemDetails.managementRpDetails = ResourceProviderDetails.fromJson(reader); } else if ("managementRpDetailsList".equals(fieldName)) { List managementRpDetailsList = reader.readArray(reader1 -> ResourceProviderDetails.fromJson(reader1)); diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderItemDetailsUpdateParameter.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderItemDetailsUpdateParameter.java new file mode 100644 index 000000000000..2af35d0b8721 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderItemDetailsUpdateParameter.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Order item details Patchable Properties. + */ +@Fluent +public final class OrderItemDetailsUpdateParameter implements JsonSerializable { + /* + * Represents product details. + */ + private ProductDetailsUpdateParameter productDetails; + + /* + * Site Related Details. + */ + private SiteDetails siteDetails; + + /** + * Creates an instance of OrderItemDetailsUpdateParameter class. + */ + public OrderItemDetailsUpdateParameter() { + } + + /** + * Get the productDetails property: Represents product details. + * + * @return the productDetails value. + */ + public ProductDetailsUpdateParameter productDetails() { + return this.productDetails; + } + + /** + * Set the productDetails property: Represents product details. + * + * @param productDetails the productDetails value to set. + * @return the OrderItemDetailsUpdateParameter object itself. + */ + public OrderItemDetailsUpdateParameter withProductDetails(ProductDetailsUpdateParameter productDetails) { + this.productDetails = productDetails; + return this; + } + + /** + * Get the siteDetails property: Site Related Details. + * + * @return the siteDetails value. + */ + public SiteDetails siteDetails() { + return this.siteDetails; + } + + /** + * Set the siteDetails property: Site Related Details. + * + * @param siteDetails the siteDetails value to set. + * @return the OrderItemDetailsUpdateParameter object itself. + */ + public OrderItemDetailsUpdateParameter withSiteDetails(SiteDetails siteDetails) { + this.siteDetails = siteDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (productDetails() != null) { + productDetails().validate(); + } + if (siteDetails() != null) { + siteDetails().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("productDetails", this.productDetails); + jsonWriter.writeJsonField("siteDetails", this.siteDetails); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OrderItemDetailsUpdateParameter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OrderItemDetailsUpdateParameter if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OrderItemDetailsUpdateParameter. + */ + public static OrderItemDetailsUpdateParameter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OrderItemDetailsUpdateParameter deserializedOrderItemDetailsUpdateParameter + = new OrderItemDetailsUpdateParameter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("productDetails".equals(fieldName)) { + deserializedOrderItemDetailsUpdateParameter.productDetails + = ProductDetailsUpdateParameter.fromJson(reader); + } else if ("siteDetails".equals(fieldName)) { + deserializedOrderItemDetailsUpdateParameter.siteDetails = SiteDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOrderItemDetailsUpdateParameter; + }); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderItemResource.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderItemResource.java index 88e2230e4893..85c70c48c54b 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderItemResource.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderItemResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -54,7 +54,14 @@ public interface OrderItemResource { Map tags(); /** - * Gets the systemData property: Represents resource creation and update time. + * Gets the identity property: Msi identity of the resource. + * + * @return the identity value. + */ + ResourceIdentity identity(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -88,6 +95,13 @@ public interface OrderItemResource { */ String orderId(); + /** + * Gets the provisioningState property: Provisioning state. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + /** * Gets the region of the resource. * @@ -119,9 +133,9 @@ public interface OrderItemResource { /** * The entirety of the OrderItemResource definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, DefinitionStages.WithOrderItemDetails, DefinitionStages.WithAddressDetails, - DefinitionStages.WithOrderId, DefinitionStages.WithCreate { + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithResourceGroup, + DefinitionStages.WithOrderItemDetails, DefinitionStages.WithOrderId, DefinitionStages.WithCreate { } /** @@ -178,20 +192,7 @@ interface WithOrderItemDetails { * @param orderItemDetails Represents order item details. * @return the next definition stage. */ - WithAddressDetails withOrderItemDetails(OrderItemDetails orderItemDetails); - } - - /** - * The stage of the OrderItemResource definition allowing to specify addressDetails. - */ - interface WithAddressDetails { - /** - * Specifies the addressDetails property: Represents shipping and return address for order item. - * - * @param addressDetails Represents shipping and return address for order item. - * @return the next definition stage. - */ - WithOrderId withAddressDetails(AddressDetails addressDetails); + WithOrderId withOrderItemDetails(OrderItemDetails orderItemDetails); } /** @@ -199,7 +200,7 @@ interface WithAddressDetails { */ interface WithOrderId { /** - * Specifies the orderId property: Id of the order to which order item belongs to. + * Specifies the orderId property: Id of the order to which order item belongs to.. * * @param orderId Id of the order to which order item belongs to. * @return the next definition stage. @@ -211,7 +212,8 @@ interface WithOrderId { * The stage of the OrderItemResource definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. */ - interface WithCreate extends DefinitionStages.WithTags { + interface WithCreate + extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, DefinitionStages.WithAddressDetails { /** * Executes the create request. * @@ -240,6 +242,32 @@ interface WithTags { */ WithCreate withTags(Map tags); } + + /** + * The stage of the OrderItemResource definition allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: Msi identity of the resource. + * + * @param identity Msi identity of the resource. + * @return the next definition stage. + */ + WithCreate withIdentity(ResourceIdentity identity); + } + + /** + * The stage of the OrderItemResource definition allowing to specify addressDetails. + */ + interface WithAddressDetails { + /** + * Specifies the addressDetails property: Represents shipping and return address for order item.. + * + * @param addressDetails Represents shipping and return address for order item. + * @return the next definition stage. + */ + WithCreate withAddressDetails(AddressDetails addressDetails); + } } /** @@ -252,8 +280,9 @@ interface WithTags { /** * The template for OrderItemResource update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithForwardAddress, UpdateStages.WithPreferences, - UpdateStages.WithNotificationEmailList, UpdateStages.WithIfMatch { + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithForwardAddress, + UpdateStages.WithPreferences, UpdateStages.WithNotificationEmailList, UpdateStages.WithOrderItemDetails, + UpdateStages.WithIfMatch { /** * Executes the update request. * @@ -289,6 +318,19 @@ interface WithTags { Update withTags(Map tags); } + /** + * The stage of the OrderItemResource update allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: Msi identity of the resource. + * + * @param identity Msi identity of the resource. + * @return the next definition stage. + */ + Update withIdentity(ResourceIdentity identity); + } + /** * The stage of the OrderItemResource update allowing to specify forwardAddress. */ @@ -328,6 +370,19 @@ interface WithNotificationEmailList { Update withNotificationEmailList(List notificationEmailList); } + /** + * The stage of the OrderItemResource update allowing to specify orderItemDetails. + */ + interface WithOrderItemDetails { + /** + * Specifies the orderItemDetails property: Represents order item details.. + * + * @param orderItemDetails Represents order item details. + * @return the next definition stage. + */ + Update withOrderItemDetails(OrderItemDetailsUpdateParameter orderItemDetails); + } + /** * The stage of the OrderItemResource update allowing to specify ifMatch. */ @@ -369,7 +424,7 @@ interface WithIfMatch { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ - Response cancelOrderItemWithResponse(CancellationReason cancellationReason, Context context); + Response cancelWithResponse(CancellationReason cancellationReason, Context context); /** * Cancel order item. @@ -379,12 +434,12 @@ interface WithIfMatch { * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void cancelOrderItem(CancellationReason cancellationReason); + void cancel(CancellationReason cancellationReason); /** * Return order item. * - * @param returnOrderItemDetails Return order item CurrentStatus. + * @param returnOrderItemDetails Return order item details. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -394,7 +449,7 @@ interface WithIfMatch { /** * Return order item. * - * @param returnOrderItemDetails Return order item CurrentStatus. + * @param returnOrderItemDetails Return order item details. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderItemResources.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderItemResources.java new file mode 100644 index 000000000000..f32727e6cdbf --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderItemResources.java @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of OrderItemResources. + */ +public interface OrderItemResources { + /** + * Get an order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param expand $expand is supported on parent device details, device details, forward shipping details and reverse + * shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for + * order item provides details on the devices of the product, Device Details for order item provides details on the + * devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and + * reverse shipping details respectively. + * @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 an order item along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String orderItemName, + String expand, Context context); + + /** + * Get an order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 order item. + */ + OrderItemResource getByResourceGroup(String resourceGroupName, String orderItemName); + + /** + * Delete an order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String orderItemName); + + /** + * Delete an order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String orderItemName, Context context); + + /** + * List order items at resource group level. + * + * @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 list of order items as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List order items at resource group level. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter $filter is supported to filter based on order id and order Item Type. Filter supports only equals + * operation. + * @param expand $expand is supported on parent device details, device details, forward shipping details and reverse + * shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for + * order item provides details on the devices of the product, Device Details for order item provides details on the + * devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and + * reverse shipping details respectively. + * @param skipToken $skipToken is supported on Get list of order items, which provides the next page in the list of + * order items. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of order items as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, String filter, String expand, + String skipToken, Integer top, Context context); + + /** + * List order items at subscription level. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of order items as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List order items at subscription level. + * + * @param filter $filter is supported to filter based on order id and order Item Type. Filter supports only equals + * operation. + * @param expand $expand is supported on parent device details, device details, forward shipping details and reverse + * shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for + * order item provides details on the devices of the product, Device Details for order item provides details on the + * devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and + * reverse shipping details respectively. + * @param skipToken $skipToken is supported on Get list of order items, which provides the next page in the list of + * order items. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of order items as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String filter, String expand, String skipToken, Integer top, Context context); + + /** + * Cancel order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param cancellationReason Reason for cancellation. + * @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 {@link Response}. + */ + Response cancelWithResponse(String resourceGroupName, String orderItemName, + CancellationReason cancellationReason, Context context); + + /** + * Cancel order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param cancellationReason Reason for cancellation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel(String resourceGroupName, String orderItemName, CancellationReason cancellationReason); + + /** + * Return order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param returnOrderItemDetails Return order item details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void returnOrderItem(String resourceGroupName, String orderItemName, ReturnOrderItemDetails returnOrderItemDetails); + + /** + * Return order item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderItemName The name of the order item. + * @param returnOrderItemDetails Return order item details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void returnOrderItem(String resourceGroupName, String orderItemName, ReturnOrderItemDetails returnOrderItemDetails, + Context context); + + /** + * Get an order item. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an order item along with {@link Response}. + */ + OrderItemResource getById(String id); + + /** + * Get an order item. + * + * @param id the resource ID. + * @param expand $expand is supported on parent device details, device details, forward shipping details and reverse + * shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for + * order item provides details on the devices of the product, Device Details for order item provides details on the + * devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and + * reverse shipping details respectively. + * @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 an order item along with {@link Response}. + */ + Response getByIdWithResponse(String id, String expand, Context context); + + /** + * Delete an order item. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete an order item. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new OrderItemResource resource. + * + * @param name resource name. + * @return the first stage of the new OrderItemResource definition. + */ + OrderItemResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderItemReturnEnum.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderItemReturnEnum.java index 21ac635800ed..5a613f027596 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderItemReturnEnum.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderItemReturnEnum.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -12,17 +12,17 @@ */ public final class OrderItemReturnEnum extends ExpandableStringEnum { /** - * Static value Returnable for OrderItemReturnEnum. + * Order item can be returned without fee. */ public static final OrderItemReturnEnum RETURNABLE = fromString("Returnable"); /** - * Static value ReturnableWithFee for OrderItemReturnEnum. + * Order item can be returned with fee. */ public static final OrderItemReturnEnum RETURNABLE_WITH_FEE = fromString("ReturnableWithFee"); /** - * Static value NotReturnable for OrderItemReturnEnum. + * Order item not returnable. */ public static final OrderItemReturnEnum NOT_RETURNABLE = fromString("NotReturnable"); diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderItemType.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderItemType.java index 86aab8c3487b..a1040b135f60 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderItemType.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderItemType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -12,15 +12,20 @@ */ public final class OrderItemType extends ExpandableStringEnum { /** - * Static value Purchase for OrderItemType. + * Purchase OrderItem. */ public static final OrderItemType PURCHASE = fromString("Purchase"); /** - * Static value Rental for OrderItemType. + * Rental OrderItem. */ public static final OrderItemType RENTAL = fromString("Rental"); + /** + * Orders placed outside of azure. + */ + public static final OrderItemType EXTERNAL = fromString("External"); + /** * Creates a new instance of OrderItemType value. * diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderItemUpdateParameter.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderItemUpdateParameter.java index 22beeab1abfe..631b07172b4d 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderItemUpdateParameter.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderItemUpdateParameter.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -21,7 +21,7 @@ @Fluent public final class OrderItemUpdateParameter implements JsonSerializable { /* - * Order item update properties + * Order item update properties. */ private OrderItemUpdateProperties innerProperties; @@ -31,6 +31,11 @@ public final class OrderItemUpdateParameter implements JsonSerializable tags; + /* + * Msi identity of the resource + */ + private ResourceIdentity identity; + /** * Creates an instance of OrderItemUpdateParameter class. */ @@ -68,6 +73,26 @@ public OrderItemUpdateParameter withTags(Map tags) { return this; } + /** + * Get the identity property: Msi identity of the resource. + * + * @return the identity value. + */ + public ResourceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Msi identity of the resource. + * + * @param identity the identity value to set. + * @return the OrderItemUpdateParameter object itself. + */ + public OrderItemUpdateParameter withIdentity(ResourceIdentity identity) { + this.identity = identity; + return this; + } + /** * Get the forwardAddress property: Updates forward shipping address and contact details. * @@ -137,6 +162,29 @@ public OrderItemUpdateParameter withNotificationEmailList(List notificat return this; } + /** + * Get the orderItemDetails property: Represents order item details. + * + * @return the orderItemDetails value. + */ + public OrderItemDetailsUpdateParameter orderItemDetails() { + return this.innerProperties() == null ? null : this.innerProperties().orderItemDetails(); + } + + /** + * Set the orderItemDetails property: Represents order item details. + * + * @param orderItemDetails the orderItemDetails value to set. + * @return the OrderItemUpdateParameter object itself. + */ + public OrderItemUpdateParameter withOrderItemDetails(OrderItemDetailsUpdateParameter orderItemDetails) { + if (this.innerProperties() == null) { + this.innerProperties = new OrderItemUpdateProperties(); + } + this.innerProperties().withOrderItemDetails(orderItemDetails); + return this; + } + /** * Validates the instance. * @@ -146,6 +194,9 @@ public void validate() { if (innerProperties() != null) { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } /** @@ -156,6 +207,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeJsonField("properties", this.innerProperties); jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -179,6 +231,8 @@ public static OrderItemUpdateParameter fromJson(JsonReader jsonReader) throws IO } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedOrderItemUpdateParameter.tags = tags; + } else if ("identity".equals(fieldName)) { + deserializedOrderItemUpdateParameter.identity = ResourceIdentity.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderMode.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderMode.java new file mode 100644 index 000000000000..67a7e910e371 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderMode.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines the mode of the Order item. + */ +public final class OrderMode extends ExpandableStringEnum { + /** + * Default Order mode. + */ + public static final OrderMode DEFAULT = fromString("Default"); + + /** + * Mode in which the Order will not be fulfilled. + */ + public static final OrderMode DO_NOT_FULFILL = fromString("DoNotFulfill"); + + /** + * Creates a new instance of OrderMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OrderMode() { + } + + /** + * Creates or finds a OrderMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding OrderMode. + */ + public static OrderMode fromString(String name) { + return fromString(name, OrderMode.class); + } + + /** + * Gets known OrderMode values. + * + * @return known OrderMode values. + */ + public static Collection values() { + return values(OrderMode.class); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderResource.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderResource.java index 617e14b86e4a..679e6dbdd756 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderResource.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -34,7 +34,7 @@ public interface OrderResource { String type(); /** - * Gets the systemData property: Represents resource creation and update time. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -61,6 +61,13 @@ public interface OrderResource { */ List orderStageHistory(); + /** + * Gets the orderMode property: Order mode. + * + * @return the orderMode value. + */ + OrderMode orderMode(); + /** * Gets the inner com.azure.resourcemanager.edgeorder.fluent.models.OrderResourceInner object. * diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderResources.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderResources.java new file mode 100644 index 000000000000..726193937b49 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrderResources.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of OrderResources. + */ +public interface OrderResources { + /** + * Get an order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param orderName The name of the order. + * @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 an order along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String location, String orderName, + Context context); + + /** + * Get an order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param orderName The name of the order. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 order. + */ + OrderResource get(String resourceGroupName, String location, String orderName); +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrdersOperationGroups.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrdersOperationGroups.java new file mode 100644 index 000000000000..1aae7d55c61f --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/OrdersOperationGroups.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of OrdersOperationGroups. + */ +public interface OrdersOperationGroups { + /** + * List orders at subscription level. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of orders as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List orders at subscription level. + * + * @param skipToken $skipToken is supported on Get list of orders, which provides the next page in the list of + * orders. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of orders as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String skipToken, Integer top, Context context); + + /** + * List orders at resource group level. + * + * @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 list of orders as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List orders at resource group level. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param skipToken $skipToken is supported on Get list of orders, which provides the next page in the list of + * orders. + * @param top $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list + * will be returned to the API caller. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of orders as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, String skipToken, Integer top, + Context context); +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Origin.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Origin.java index 40737b67972f..fb4abb85a147 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Origin.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Origin.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -13,17 +13,17 @@ */ public final class Origin extends ExpandableStringEnum { /** - * 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/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Pav2MeterDetails.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Pav2MeterDetails.java index eef8c19fae12..f57416859d3e 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Pav2MeterDetails.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Pav2MeterDetails.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -28,7 +28,7 @@ public final class Pav2MeterDetails extends MeterDetails { /** * Creates an instance of Pav2MeterDetails class. */ - public Pav2MeterDetails() { + private Pav2MeterDetails() { } /** diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Preferences.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Preferences.java index 09a4dd843afd..1b8a4acab9af 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Preferences.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Preferences.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -37,6 +37,11 @@ public final class Preferences implements JsonSerializable { */ private ManagementResourcePreferences managementResourcePreferences; + /* + * Preferences related to the Term commitment. + */ + private TermCommitmentPreferences termCommitmentPreferences; + /** * Creates an instance of Preferences class. */ @@ -123,6 +128,26 @@ public Preferences withManagementResourcePreferences(ManagementResourcePreferenc return this; } + /** + * Get the termCommitmentPreferences property: Preferences related to the Term commitment. + * + * @return the termCommitmentPreferences value. + */ + public TermCommitmentPreferences termCommitmentPreferences() { + return this.termCommitmentPreferences; + } + + /** + * Set the termCommitmentPreferences property: Preferences related to the Term commitment. + * + * @param termCommitmentPreferences the termCommitmentPreferences value to set. + * @return the Preferences object itself. + */ + public Preferences withTermCommitmentPreferences(TermCommitmentPreferences termCommitmentPreferences) { + this.termCommitmentPreferences = termCommitmentPreferences; + return this; + } + /** * Validates the instance. * @@ -141,6 +166,9 @@ public void validate() { if (managementResourcePreferences() != null) { managementResourcePreferences().validate(); } + if (termCommitmentPreferences() != null) { + termCommitmentPreferences().validate(); + } } /** @@ -154,6 +182,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("transportPreferences", this.transportPreferences); jsonWriter.writeJsonField("encryptionPreferences", this.encryptionPreferences); jsonWriter.writeJsonField("managementResourcePreferences", this.managementResourcePreferences); + jsonWriter.writeJsonField("termCommitmentPreferences", this.termCommitmentPreferences); return jsonWriter.writeEndObject(); } @@ -183,6 +212,8 @@ public static Preferences fromJson(JsonReader jsonReader) throws IOException { } else if ("managementResourcePreferences".equals(fieldName)) { deserializedPreferences.managementResourcePreferences = ManagementResourcePreferences.fromJson(reader); + } else if ("termCommitmentPreferences".equals(fieldName)) { + deserializedPreferences.termCommitmentPreferences = TermCommitmentPreferences.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Product.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Product.java index 5b6fb2bd5b99..f4e9ca0563de 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Product.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/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.edgeorder.models; @@ -15,19 +15,19 @@ import java.util.List; /** - * List of Products. + * Represents a product. */ @Immutable public final class Product implements JsonSerializable { /* - * Properties of product + * Properties of product. */ private ProductProperties innerProperties; /** * Creates an instance of Product class. */ - public Product() { + private Product() { } /** @@ -49,7 +49,7 @@ public List configurations() { } /** - * Get the filterableProperties property: list of filters supported for a product. + * Get the filterableProperties property: List of filters supported for a product. * * @return the filterableProperties value. */ @@ -111,6 +111,15 @@ public HierarchyInformation hierarchyInformation() { return this.innerProperties() == null ? null : this.innerProperties().hierarchyInformation(); } + /** + * Get the fulfilledBy property: The entity responsible for fulfillment of the item at the given hierarchy level. + * + * @return the fulfilledBy value. + */ + public FulfillmentType fulfilledBy() { + return this.innerProperties() == null ? null : this.innerProperties().fulfilledBy(); + } + /** * Validates the instance. * diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProductDetails.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProductDetails.java index 27bcdf9da00d..aa4c8d4e8006 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProductDetails.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProductDetails.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -19,29 +19,50 @@ @Fluent public final class ProductDetails implements JsonSerializable { /* - * Display details of the product + * Display details of the product. */ private DisplayInfo displayInfo; /* - * Hierarchy of the product which uniquely identifies the product + * Hierarchy of the product which uniquely identifies the product. */ private HierarchyInformation hierarchyInformation; /* - * Quantity of the product + * Double encryption status of the configuration. Read-only field. */ - private Integer count; + private DoubleEncryptionStatus productDoubleEncryptionStatus; /* - * Double encryption status of the configuration. Read-only field. + * Identification type of the configuration. */ - private DoubleEncryptionStatus productDoubleEncryptionStatus; + private IdentificationType identificationType; + + /* + * Device details of the parent configuration. + */ + private DeviceDetails parentDeviceDetails; + + /* + * Device Provisioning Details for Parent. + */ + private ProvisioningDetails parentProvisioningDetails; + + /* + * List of additional configurations customer wants in the order item apart from the ones included in the base + * configuration. + */ + private List optInAdditionalConfigurations; + + /* + * Details of all child configurations that are part of the order item. + */ + private List childConfigurationDeviceDetails; /* - * list of device details + * Term Commitment Information of the Device. */ - private List deviceDetails; + private TermCommitmentInformation termCommitmentInformation; /** * Creates an instance of ProductDetails class. @@ -90,30 +111,92 @@ public ProductDetails withHierarchyInformation(HierarchyInformation hierarchyInf } /** - * Get the count property: Quantity of the product. + * Get the productDoubleEncryptionStatus property: Double encryption status of the configuration. Read-only field. * - * @return the count value. + * @return the productDoubleEncryptionStatus value. */ - public Integer count() { - return this.count; + public DoubleEncryptionStatus productDoubleEncryptionStatus() { + return this.productDoubleEncryptionStatus; } /** - * Get the productDoubleEncryptionStatus property: Double encryption status of the configuration. Read-only field. + * Get the identificationType property: Identification type of the configuration. * - * @return the productDoubleEncryptionStatus value. + * @return the identificationType value. */ - public DoubleEncryptionStatus productDoubleEncryptionStatus() { - return this.productDoubleEncryptionStatus; + public IdentificationType identificationType() { + return this.identificationType; + } + + /** + * Get the parentDeviceDetails property: Device details of the parent configuration. + * + * @return the parentDeviceDetails value. + */ + public DeviceDetails parentDeviceDetails() { + return this.parentDeviceDetails; + } + + /** + * Get the parentProvisioningDetails property: Device Provisioning Details for Parent. + * + * @return the parentProvisioningDetails value. + */ + public ProvisioningDetails parentProvisioningDetails() { + return this.parentProvisioningDetails; + } + + /** + * Set the parentProvisioningDetails property: Device Provisioning Details for Parent. + * + * @param parentProvisioningDetails the parentProvisioningDetails value to set. + * @return the ProductDetails object itself. + */ + public ProductDetails withParentProvisioningDetails(ProvisioningDetails parentProvisioningDetails) { + this.parentProvisioningDetails = parentProvisioningDetails; + return this; } /** - * Get the deviceDetails property: list of device details. + * Get the optInAdditionalConfigurations property: List of additional configurations customer wants in the order + * item apart from the ones included in the base configuration. * - * @return the deviceDetails value. + * @return the optInAdditionalConfigurations value. */ - public List deviceDetails() { - return this.deviceDetails; + public List optInAdditionalConfigurations() { + return this.optInAdditionalConfigurations; + } + + /** + * Set the optInAdditionalConfigurations property: List of additional configurations customer wants in the order + * item apart from the ones included in the base configuration. + * + * @param optInAdditionalConfigurations the optInAdditionalConfigurations value to set. + * @return the ProductDetails object itself. + */ + public ProductDetails + withOptInAdditionalConfigurations(List optInAdditionalConfigurations) { + this.optInAdditionalConfigurations = optInAdditionalConfigurations; + return this; + } + + /** + * Get the childConfigurationDeviceDetails property: Details of all child configurations that are part of the order + * item. + * + * @return the childConfigurationDeviceDetails value. + */ + public List childConfigurationDeviceDetails() { + return this.childConfigurationDeviceDetails; + } + + /** + * Get the termCommitmentInformation property: Term Commitment Information of the Device. + * + * @return the termCommitmentInformation value. + */ + public TermCommitmentInformation termCommitmentInformation() { + return this.termCommitmentInformation; } /** @@ -132,8 +215,20 @@ public void validate() { } else { hierarchyInformation().validate(); } - if (deviceDetails() != null) { - deviceDetails().forEach(e -> e.validate()); + if (parentDeviceDetails() != null) { + parentDeviceDetails().validate(); + } + if (parentProvisioningDetails() != null) { + parentProvisioningDetails().validate(); + } + if (optInAdditionalConfigurations() != null) { + optInAdditionalConfigurations().forEach(e -> e.validate()); + } + if (childConfigurationDeviceDetails() != null) { + childConfigurationDeviceDetails().forEach(e -> e.validate()); + } + if (termCommitmentInformation() != null) { + termCommitmentInformation().validate(); } } @@ -147,6 +242,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeJsonField("hierarchyInformation", this.hierarchyInformation); jsonWriter.writeJsonField("displayInfo", this.displayInfo); + jsonWriter.writeJsonField("parentProvisioningDetails", this.parentProvisioningDetails); + jsonWriter.writeArrayField("optInAdditionalConfigurations", this.optInAdditionalConfigurations, + (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -170,14 +268,25 @@ public static ProductDetails fromJson(JsonReader jsonReader) throws IOException deserializedProductDetails.hierarchyInformation = HierarchyInformation.fromJson(reader); } else if ("displayInfo".equals(fieldName)) { deserializedProductDetails.displayInfo = DisplayInfo.fromJson(reader); - } else if ("count".equals(fieldName)) { - deserializedProductDetails.count = reader.getNullable(JsonReader::getInt); } else if ("productDoubleEncryptionStatus".equals(fieldName)) { deserializedProductDetails.productDoubleEncryptionStatus = DoubleEncryptionStatus.fromString(reader.getString()); - } else if ("deviceDetails".equals(fieldName)) { - List deviceDetails = reader.readArray(reader1 -> DeviceDetails.fromJson(reader1)); - deserializedProductDetails.deviceDetails = deviceDetails; + } else if ("identificationType".equals(fieldName)) { + deserializedProductDetails.identificationType = IdentificationType.fromString(reader.getString()); + } else if ("parentDeviceDetails".equals(fieldName)) { + deserializedProductDetails.parentDeviceDetails = DeviceDetails.fromJson(reader); + } else if ("parentProvisioningDetails".equals(fieldName)) { + deserializedProductDetails.parentProvisioningDetails = ProvisioningDetails.fromJson(reader); + } else if ("optInAdditionalConfigurations".equals(fieldName)) { + List optInAdditionalConfigurations + = reader.readArray(reader1 -> AdditionalConfiguration.fromJson(reader1)); + deserializedProductDetails.optInAdditionalConfigurations = optInAdditionalConfigurations; + } else if ("childConfigurationDeviceDetails".equals(fieldName)) { + List childConfigurationDeviceDetails + = reader.readArray(reader1 -> ConfigurationDeviceDetails.fromJson(reader1)); + deserializedProductDetails.childConfigurationDeviceDetails = childConfigurationDeviceDetails; + } else if ("termCommitmentInformation".equals(fieldName)) { + deserializedProductDetails.termCommitmentInformation = TermCommitmentInformation.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProductDetailsUpdateParameter.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProductDetailsUpdateParameter.java new file mode 100644 index 000000000000..9a8bb1788ff1 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProductDetailsUpdateParameter.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents product details patchable properties. + */ +@Fluent +public final class ProductDetailsUpdateParameter implements JsonSerializable { + /* + * Device Provisioning Details for Parent. + */ + private ProvisioningDetails parentProvisioningDetails; + + /** + * Creates an instance of ProductDetailsUpdateParameter class. + */ + public ProductDetailsUpdateParameter() { + } + + /** + * Get the parentProvisioningDetails property: Device Provisioning Details for Parent. + * + * @return the parentProvisioningDetails value. + */ + public ProvisioningDetails parentProvisioningDetails() { + return this.parentProvisioningDetails; + } + + /** + * Set the parentProvisioningDetails property: Device Provisioning Details for Parent. + * + * @param parentProvisioningDetails the parentProvisioningDetails value to set. + * @return the ProductDetailsUpdateParameter object itself. + */ + public ProductDetailsUpdateParameter withParentProvisioningDetails(ProvisioningDetails parentProvisioningDetails) { + this.parentProvisioningDetails = parentProvisioningDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (parentProvisioningDetails() != null) { + parentProvisioningDetails().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("parentProvisioningDetails", this.parentProvisioningDetails); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProductDetailsUpdateParameter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProductDetailsUpdateParameter if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProductDetailsUpdateParameter. + */ + public static ProductDetailsUpdateParameter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProductDetailsUpdateParameter deserializedProductDetailsUpdateParameter + = new ProductDetailsUpdateParameter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parentProvisioningDetails".equals(fieldName)) { + deserializedProductDetailsUpdateParameter.parentProvisioningDetails + = ProvisioningDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedProductDetailsUpdateParameter; + }); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProductFamiliesMetadataDetails.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProductFamiliesMetadataDetails.java index d46733f3bf85..728972853c93 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProductFamiliesMetadataDetails.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProductFamiliesMetadataDetails.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -26,7 +26,7 @@ public interface ProductFamiliesMetadataDetails { List resourceProviderDetails(); /** - * Gets the filterableProperties property: list of filters supported for a product. + * Gets the filterableProperties property: List of filters supported for a product. * * @return the filterableProperties value. */ @@ -74,6 +74,13 @@ public interface ProductFamiliesMetadataDetails { */ HierarchyInformation hierarchyInformation(); + /** + * Gets the fulfilledBy property: The entity responsible for fulfillment of the item at the given hierarchy level. + * + * @return the fulfilledBy value. + */ + FulfillmentType fulfilledBy(); + /** * Gets the inner com.azure.resourcemanager.edgeorder.fluent.models.ProductFamiliesMetadataDetailsInner object. * diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProductFamiliesRequest.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProductFamiliesRequest.java index f4ae9cb43cc1..1d4f0d06efb1 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProductFamiliesRequest.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProductFamiliesRequest.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -26,7 +26,7 @@ public final class ProductFamiliesRequest implements JsonSerializable resourceProviderDetails(); /** - * Gets the filterableProperties property: list of filters supported for a product. + * Gets the filterableProperties property: List of filters supported for a product. * * @return the filterableProperties value. */ @@ -74,6 +74,13 @@ public interface ProductFamily { */ HierarchyInformation hierarchyInformation(); + /** + * Gets the fulfilledBy property: The entity responsible for fulfillment of the item at the given hierarchy level. + * + * @return the fulfilledBy value. + */ + FulfillmentType fulfilledBy(); + /** * Gets the inner com.azure.resourcemanager.edgeorder.fluent.models.ProductFamilyInner object. * diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProductLine.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProductLine.java index 776695f1c9e2..d08e0cc98a28 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProductLine.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProductLine.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -19,14 +19,14 @@ @Immutable public final class ProductLine implements JsonSerializable { /* - * Properties of product line + * Properties of product line. */ private ProductLineProperties innerProperties; /** * Creates an instance of ProductLine class. */ - public ProductLine() { + private ProductLine() { } /** @@ -48,7 +48,7 @@ public List products() { } /** - * Get the filterableProperties property: list of filters supported for a product. + * Get the filterableProperties property: List of filters supported for a product. * * @return the filterableProperties value. */ @@ -110,6 +110,15 @@ public HierarchyInformation hierarchyInformation() { return this.innerProperties() == null ? null : this.innerProperties().hierarchyInformation(); } + /** + * Get the fulfilledBy property: The entity responsible for fulfillment of the item at the given hierarchy level. + * + * @return the fulfilledBy value. + */ + public FulfillmentType fulfilledBy() { + return this.innerProperties() == null ? null : this.innerProperties().fulfilledBy(); + } + /** * Validates the instance. * diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProductsAndConfigurationsOperationGroups.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProductsAndConfigurationsOperationGroups.java new file mode 100644 index 000000000000..638ecd0273e7 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProductsAndConfigurationsOperationGroups.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of ProductsAndConfigurationsOperationGroups. + */ +public interface ProductsAndConfigurationsOperationGroups { + /** + * List configurations for the given product family, product line and product for the given subscription. + * + * @param configurationsRequest Filters for showing the configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of configurations as paginated response with {@link PagedIterable}. + */ + PagedIterable listConfigurations(ConfigurationsRequest configurationsRequest); + + /** + * List configurations for the given product family, product line and product for the given subscription. + * + * @param configurationsRequest Filters for showing the configurations. + * @param skipToken $skipToken is supported on list of configurations, which provides the next page in the list of + * configurations. + * @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 list of configurations as paginated response with {@link PagedIterable}. + */ + PagedIterable listConfigurations(ConfigurationsRequest configurationsRequest, String skipToken, + Context context); + + /** + * List product families for the given subscription. + * + * @param productFamiliesRequest Filters for showing the product families. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of product families as paginated response with {@link PagedIterable}. + */ + PagedIterable listProductFamilies(ProductFamiliesRequest productFamiliesRequest); + + /** + * List product families for the given subscription. + * + * @param productFamiliesRequest Filters for showing the product families. + * @param expand $expand is supported on configurations parameter for product, which provides details on the + * configurations for the product. + * @param skipToken $skipToken is supported on list of product families, which provides the next page in the list of + * product families. + * @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 list of product families as paginated response with {@link PagedIterable}. + */ + PagedIterable listProductFamilies(ProductFamiliesRequest productFamiliesRequest, String expand, + String skipToken, Context context); + + /** + * List product families metadata for the given subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return holds details about product family metadata as paginated response with {@link PagedIterable}. + */ + PagedIterable listProductFamiliesMetadata(); + + /** + * List product families metadata for the given subscription. + * + * @param skipToken $skipToken is supported on list of product families metadata, which provides the next page in + * the list of product families metadata. + * @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 holds details about product family metadata as paginated response with {@link PagedIterable}. + */ + PagedIterable listProductFamiliesMetadata(String skipToken, Context context); +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProvisioningDetails.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProvisioningDetails.java new file mode 100644 index 000000000000..7e1570cb5d93 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProvisioningDetails.java @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Details Related To Provision Resource. + */ +@Fluent +public final class ProvisioningDetails implements JsonSerializable { + /* + * Quantity of the devices. + */ + private Integer quantity; + + /* + * Provisioning Resource Arm ID. + */ + private String provisioningArmId; + + /* + * Provisioning End Point. + */ + private String provisioningEndPoint; + + /* + * Serial Number for the Device. + */ + private String serialNumber; + + /* + * Vendor Name for the Device , (for 1P devices - Microsoft). + */ + private String vendorName; + + /* + * Arc Enabled Resource Arm id. + */ + private String readyToConnectArmId; + + /* + * Management Resource ArmId. + */ + private String managementResourceArmId; + + /* + * Unique Identity for a Device. + */ + private String uniqueDeviceIdentifier; + + /* + * Auto Provisioning Details. + */ + private AutoProvisioningStatus autoProvisioningStatus; + + /* + * Proof of possession details. + */ + private DevicePresenceVerificationDetails devicePresenceVerification; + + /** + * Creates an instance of ProvisioningDetails class. + */ + public ProvisioningDetails() { + } + + /** + * Get the quantity property: Quantity of the devices. + * + * @return the quantity value. + */ + public Integer quantity() { + return this.quantity; + } + + /** + * Set the quantity property: Quantity of the devices. + * + * @param quantity the quantity value to set. + * @return the ProvisioningDetails object itself. + */ + public ProvisioningDetails withQuantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get the provisioningArmId property: Provisioning Resource Arm ID. + * + * @return the provisioningArmId value. + */ + public String provisioningArmId() { + return this.provisioningArmId; + } + + /** + * Set the provisioningArmId property: Provisioning Resource Arm ID. + * + * @param provisioningArmId the provisioningArmId value to set. + * @return the ProvisioningDetails object itself. + */ + public ProvisioningDetails withProvisioningArmId(String provisioningArmId) { + this.provisioningArmId = provisioningArmId; + return this; + } + + /** + * Get the provisioningEndPoint property: Provisioning End Point. + * + * @return the provisioningEndPoint value. + */ + public String provisioningEndPoint() { + return this.provisioningEndPoint; + } + + /** + * Set the provisioningEndPoint property: Provisioning End Point. + * + * @param provisioningEndPoint the provisioningEndPoint value to set. + * @return the ProvisioningDetails object itself. + */ + public ProvisioningDetails withProvisioningEndPoint(String provisioningEndPoint) { + this.provisioningEndPoint = provisioningEndPoint; + return this; + } + + /** + * Get the serialNumber property: Serial Number for the Device. + * + * @return the serialNumber value. + */ + public String serialNumber() { + return this.serialNumber; + } + + /** + * Set the serialNumber property: Serial Number for the Device. + * + * @param serialNumber the serialNumber value to set. + * @return the ProvisioningDetails object itself. + */ + public ProvisioningDetails withSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + return this; + } + + /** + * Get the vendorName property: Vendor Name for the Device , (for 1P devices - Microsoft). + * + * @return the vendorName value. + */ + public String vendorName() { + return this.vendorName; + } + + /** + * Set the vendorName property: Vendor Name for the Device , (for 1P devices - Microsoft). + * + * @param vendorName the vendorName value to set. + * @return the ProvisioningDetails object itself. + */ + public ProvisioningDetails withVendorName(String vendorName) { + this.vendorName = vendorName; + return this; + } + + /** + * Get the readyToConnectArmId property: Arc Enabled Resource Arm id. + * + * @return the readyToConnectArmId value. + */ + public String readyToConnectArmId() { + return this.readyToConnectArmId; + } + + /** + * Set the readyToConnectArmId property: Arc Enabled Resource Arm id. + * + * @param readyToConnectArmId the readyToConnectArmId value to set. + * @return the ProvisioningDetails object itself. + */ + public ProvisioningDetails withReadyToConnectArmId(String readyToConnectArmId) { + this.readyToConnectArmId = readyToConnectArmId; + return this; + } + + /** + * Get the managementResourceArmId property: Management Resource ArmId. + * + * @return the managementResourceArmId value. + */ + public String managementResourceArmId() { + return this.managementResourceArmId; + } + + /** + * Set the managementResourceArmId property: Management Resource ArmId. + * + * @param managementResourceArmId the managementResourceArmId value to set. + * @return the ProvisioningDetails object itself. + */ + public ProvisioningDetails withManagementResourceArmId(String managementResourceArmId) { + this.managementResourceArmId = managementResourceArmId; + return this; + } + + /** + * Get the uniqueDeviceIdentifier property: Unique Identity for a Device. + * + * @return the uniqueDeviceIdentifier value. + */ + public String uniqueDeviceIdentifier() { + return this.uniqueDeviceIdentifier; + } + + /** + * Get the autoProvisioningStatus property: Auto Provisioning Details. + * + * @return the autoProvisioningStatus value. + */ + public AutoProvisioningStatus autoProvisioningStatus() { + return this.autoProvisioningStatus; + } + + /** + * Set the autoProvisioningStatus property: Auto Provisioning Details. + * + * @param autoProvisioningStatus the autoProvisioningStatus value to set. + * @return the ProvisioningDetails object itself. + */ + public ProvisioningDetails withAutoProvisioningStatus(AutoProvisioningStatus autoProvisioningStatus) { + this.autoProvisioningStatus = autoProvisioningStatus; + return this; + } + + /** + * Get the devicePresenceVerification property: Proof of possession details. + * + * @return the devicePresenceVerification value. + */ + public DevicePresenceVerificationDetails devicePresenceVerification() { + return this.devicePresenceVerification; + } + + /** + * Set the devicePresenceVerification property: Proof of possession details. + * + * @param devicePresenceVerification the devicePresenceVerification value to set. + * @return the ProvisioningDetails object itself. + */ + public ProvisioningDetails + withDevicePresenceVerification(DevicePresenceVerificationDetails devicePresenceVerification) { + this.devicePresenceVerification = devicePresenceVerification; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (devicePresenceVerification() != null) { + devicePresenceVerification().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("quantity", this.quantity); + jsonWriter.writeStringField("provisioningArmId", this.provisioningArmId); + jsonWriter.writeStringField("provisioningEndPoint", this.provisioningEndPoint); + jsonWriter.writeStringField("serialNumber", this.serialNumber); + jsonWriter.writeStringField("vendorName", this.vendorName); + jsonWriter.writeStringField("readyToConnectArmId", this.readyToConnectArmId); + jsonWriter.writeStringField("managementResourceArmId", this.managementResourceArmId); + jsonWriter.writeStringField("autoProvisioningStatus", + this.autoProvisioningStatus == null ? null : this.autoProvisioningStatus.toString()); + jsonWriter.writeJsonField("devicePresenceVerification", this.devicePresenceVerification); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProvisioningDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProvisioningDetails if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ProvisioningDetails. + */ + public static ProvisioningDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProvisioningDetails deserializedProvisioningDetails = new ProvisioningDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("quantity".equals(fieldName)) { + deserializedProvisioningDetails.quantity = reader.getNullable(JsonReader::getInt); + } else if ("provisioningArmId".equals(fieldName)) { + deserializedProvisioningDetails.provisioningArmId = reader.getString(); + } else if ("provisioningEndPoint".equals(fieldName)) { + deserializedProvisioningDetails.provisioningEndPoint = reader.getString(); + } else if ("serialNumber".equals(fieldName)) { + deserializedProvisioningDetails.serialNumber = reader.getString(); + } else if ("vendorName".equals(fieldName)) { + deserializedProvisioningDetails.vendorName = reader.getString(); + } else if ("readyToConnectArmId".equals(fieldName)) { + deserializedProvisioningDetails.readyToConnectArmId = reader.getString(); + } else if ("managementResourceArmId".equals(fieldName)) { + deserializedProvisioningDetails.managementResourceArmId = reader.getString(); + } else if ("uniqueDeviceIdentifier".equals(fieldName)) { + deserializedProvisioningDetails.uniqueDeviceIdentifier = reader.getString(); + } else if ("autoProvisioningStatus".equals(fieldName)) { + deserializedProvisioningDetails.autoProvisioningStatus + = AutoProvisioningStatus.fromString(reader.getString()); + } else if ("devicePresenceVerification".equals(fieldName)) { + deserializedProvisioningDetails.devicePresenceVerification + = DevicePresenceVerificationDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedProvisioningDetails; + }); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProvisioningState.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProvisioningState.java new file mode 100644 index 000000000000..9e328398b7ee --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProvisioningState.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning state. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** + * Creating state. + */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** + * Succeeded state. + */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Failed state. + */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * Canceled state. + */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { + } + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProvisioningSupport.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProvisioningSupport.java new file mode 100644 index 000000000000..12f54f279f8b --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ProvisioningSupport.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Determining nature of provisioning that the configuration supports. + */ +public final class ProvisioningSupport extends ExpandableStringEnum { + /** + * The configuration can be provisioned from the cloud. + */ + public static final ProvisioningSupport CLOUD_BASED = fromString("CloudBased"); + + /** + * The configuration need to be provisioned manually by the end user. + */ + public static final ProvisioningSupport MANUAL = fromString("Manual"); + + /** + * Creates a new instance of ProvisioningSupport value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningSupport() { + } + + /** + * Creates or finds a ProvisioningSupport from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningSupport. + */ + public static ProvisioningSupport fromString(String name) { + return fromString(name, ProvisioningSupport.class); + } + + /** + * Gets known ProvisioningSupport values. + * + * @return known ProvisioningSupport values. + */ + public static Collection values() { + return values(ProvisioningSupport.class); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/PurchaseMeterDetails.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/PurchaseMeterDetails.java index e533f3a7c10e..1705db94cb1b 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/PurchaseMeterDetails.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/PurchaseMeterDetails.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -21,24 +21,24 @@ public final class PurchaseMeterDetails extends MeterDetails { private BillingType billingType = BillingType.PURCHASE; /* - * Product Id + * Product Id. */ private String productId; /* - * Sku Id + * Sku Id. */ private String skuId; /* - * Term Id + * Term Id. */ private String termId; /** * Creates an instance of PurchaseMeterDetails class. */ - public PurchaseMeterDetails() { + private PurchaseMeterDetails() { } /** diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ResourceIdentity.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ResourceIdentity.java new file mode 100644 index 000000000000..61f8f38b9b0f --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ResourceIdentity.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Msi identity details of the resource. + */ +@Fluent +public final class ResourceIdentity implements JsonSerializable { + /* + * Identity type + */ + private String type; + + /* + * Service Principal Id backing the Msi + */ + private String principalId; + + /* + * Home Tenant Id + */ + private String tenantId; + + /* + * User Assigned Identities + */ + private Map userAssignedIdentities; + + /** + * Creates an instance of ResourceIdentity class. + */ + public ResourceIdentity() { + } + + /** + * Get the type property: Identity type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Identity type. + * + * @param type the type value to set. + * @return the ResourceIdentity object itself. + */ + public ResourceIdentity withType(String type) { + this.type = type; + return this; + } + + /** + * Get the principalId property: Service Principal Id backing the Msi. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: Home Tenant Id. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the userAssignedIdentities property: User Assigned Identities. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: User Assigned Identities. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ResourceIdentity object itself. + */ + public ResourceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (userAssignedIdentities() != null) { + userAssignedIdentities().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceIdentity if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceIdentity. + */ + public static ResourceIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceIdentity deserializedResourceIdentity = new ResourceIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedResourceIdentity.type = reader.getString(); + } else if ("principalId".equals(fieldName)) { + deserializedResourceIdentity.principalId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedResourceIdentity.tenantId = reader.getString(); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedResourceIdentity.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedResourceIdentity; + }); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ResourceProviderDetails.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ResourceProviderDetails.java index 18b5639e3abf..e69797731273 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ResourceProviderDetails.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ResourceProviderDetails.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -17,14 +17,14 @@ @Immutable public final class ResourceProviderDetails implements JsonSerializable { /* - * Resource provider namespace + * Resource provider namespace. */ private String resourceProviderNamespace; /** * Creates an instance of ResourceProviderDetails class. */ - public ResourceProviderDetails() { + private ResourceProviderDetails() { } /** diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ResourceProviders.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ResourceProviders.java deleted file mode 100644 index d39c0372cc2e..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ResourceProviders.java +++ /dev/null @@ -1,566 +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.edgeorder.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of ResourceProviders. - */ -public interface ResourceProviders { - /** - * This method gets all the operations that are exposed for customer. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listOperations(); - - /** - * This method gets all the operations that are exposed for customer. - * - * @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 list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listOperations(Context context); - - /** - * Lists all the addresses available under the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return address Resource Collection as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Lists all the addresses available under the subscription. - * - * @param filter $filter is supported to filter based on shipping address properties. Filter supports only equals - * operation. - * @param skipToken $skipToken is supported on Get list of addresses, which provides the next page in the list of - * addresses. - * @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 address Resource Collection as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String filter, String skipToken, Context context); - - /** - * This method provides the list of product families for the given subscription. - * - * @param productFamiliesRequest Filters for showing the product families. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of product families as paginated response with {@link PagedIterable}. - */ - PagedIterable listProductFamilies(ProductFamiliesRequest productFamiliesRequest); - - /** - * This method provides the list of product families for the given subscription. - * - * @param productFamiliesRequest Filters for showing the product families. - * @param expand $expand is supported on configurations parameter for product, which provides details on the - * configurations for the product. - * @param skipToken $skipToken is supported on list of product families, which provides the next page in the list of - * product families. - * @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 list of product families as paginated response with {@link PagedIterable}. - */ - PagedIterable listProductFamilies(ProductFamiliesRequest productFamiliesRequest, String expand, - String skipToken, Context context); - - /** - * This method provides the list of configurations for the given product family, product line and product under - * subscription. - * - * @param configurationsRequest Filters for showing the configurations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of configurations as paginated response with {@link PagedIterable}. - */ - PagedIterable listConfigurations(ConfigurationsRequest configurationsRequest); - - /** - * This method provides the list of configurations for the given product family, product line and product under - * subscription. - * - * @param configurationsRequest Filters for showing the configurations. - * @param skipToken $skipToken is supported on list of configurations, which provides the next page in the list of - * configurations. - * @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 list of configurations as paginated response with {@link PagedIterable}. - */ - PagedIterable listConfigurations(ConfigurationsRequest configurationsRequest, String skipToken, - Context context); - - /** - * This method provides the list of product families metadata for the given subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return holds details about product family metadata as paginated response with {@link PagedIterable}. - */ - PagedIterable listProductFamiliesMetadata(); - - /** - * This method provides the list of product families metadata for the given subscription. - * - * @param skipToken $skipToken is supported on list of product families metadata, which provides the next page in - * the list of product families metadata. - * @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 holds details about product family metadata as paginated response with {@link PagedIterable}. - */ - PagedIterable listProductFamiliesMetadata(String skipToken, Context context); - - /** - * Lists order at subscription level. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orders as paginated response with {@link PagedIterable}. - */ - PagedIterable listOrderAtSubscriptionLevel(); - - /** - * Lists order at subscription level. - * - * @param skipToken $skipToken is supported on Get list of order, which provides the next page in the list of order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orders as paginated response with {@link PagedIterable}. - */ - PagedIterable listOrderAtSubscriptionLevel(String skipToken, Context context); - - /** - * Lists order item at subscription level. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orderItems as paginated response with {@link PagedIterable}. - */ - PagedIterable listOrderItemsAtSubscriptionLevel(); - - /** - * Lists order item at subscription level. - * - * @param filter $filter is supported to filter based on order id. Filter supports only equals operation. - * @param expand $expand is supported on device details, forward shipping details and reverse shipping details - * parameters. Each of these can be provided as a comma separated list. Device Details for order item provides - * details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping - * details respectively. - * @param skipToken $skipToken is supported on Get list of order items, which provides the next page in the list of - * order items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orderItems as paginated response with {@link PagedIterable}. - */ - PagedIterable listOrderItemsAtSubscriptionLevel(String filter, String expand, String skipToken, - Context context); - - /** - * Lists all the addresses available under the given 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 address Resource Collection as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists all the addresses available under the given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter $filter is supported to filter based on shipping address properties. Filter supports only equals - * operation. - * @param skipToken $skipToken is supported on Get list of addresses, which provides the next page in the list of - * address. - * @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 address Resource Collection as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName, String filter, String skipToken, - Context context); - - /** - * Gets information about the specified address. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @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 information about the specified address along with {@link Response}. - */ - Response getByResourceGroupWithResponse(String resourceGroupName, String addressName, - Context context); - - /** - * Gets information about the specified address. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified address. - */ - AddressResource getByResourceGroup(String resourceGroupName, String addressName); - - /** - * Deletes an address. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByResourceGroup(String resourceGroupName, String addressName); - - /** - * Deletes an address. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param addressName The name of the address Resource within the specified resource group. address names must be - * between 3 and 24 characters in length and use any alphanumeric and underscore only. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String addressName, Context context); - - /** - * Lists order at resource group level. - * - * @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 list of orders as paginated response with {@link PagedIterable}. - */ - PagedIterable listOrderAtResourceGroupLevel(String resourceGroupName); - - /** - * Lists order at resource group level. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param skipToken $skipToken is supported on Get list of order, which provides the next page in the list of order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orders as paginated response with {@link PagedIterable}. - */ - PagedIterable listOrderAtResourceGroupLevel(String resourceGroupName, String skipToken, - Context context); - - /** - * Gets an order. - * - * @param orderName The name of the order. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param location The name of Azure region. - * @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 an order along with {@link Response}. - */ - Response getOrderByNameWithResponse(String orderName, String resourceGroupName, String location, - Context context); - - /** - * Gets an order. - * - * @param orderName The name of the order. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param location The name of Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 order. - */ - OrderResource getOrderByName(String orderName, String resourceGroupName, String location); - - /** - * Lists order item at resource group level. - * - * @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 list of orderItems as paginated response with {@link PagedIterable}. - */ - PagedIterable listOrderItemsAtResourceGroupLevel(String resourceGroupName); - - /** - * Lists order item at resource group level. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter $filter is supported to filter based on order id. Filter supports only equals operation. - * @param expand $expand is supported on device details, forward shipping details and reverse shipping details - * parameters. Each of these can be provided as a comma separated list. Device Details for order item provides - * details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping - * details respectively. - * @param skipToken $skipToken is supported on Get list of order items, which provides the next page in the list of - * order items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of orderItems as paginated response with {@link PagedIterable}. - */ - PagedIterable listOrderItemsAtResourceGroupLevel(String resourceGroupName, String filter, - String expand, String skipToken, Context context); - - /** - * Gets an order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param expand $expand is supported on device details, forward shipping details and reverse shipping details - * parameters. Each of these can be provided as a comma separated list. Device Details for order item provides - * details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping - * details respectively. - * @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 an order item along with {@link Response}. - */ - Response getOrderItemByNameWithResponse(String orderItemName, String resourceGroupName, - String expand, Context context); - - /** - * Gets an order item. - * - * @param orderItemName The name of the order item. - * @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 an order item. - */ - OrderItemResource getOrderItemByName(String orderItemName, String resourceGroupName); - - /** - * Deletes an order item. - * - * @param orderItemName The name of the order item. - * @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. - */ - void deleteOrderItemByName(String orderItemName, String resourceGroupName); - - /** - * Deletes an order item. - * - * @param orderItemName The name of the order item. - * @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. - */ - void deleteOrderItemByName(String orderItemName, String resourceGroupName, Context context); - - /** - * Cancel order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cancellationReason Reason for cancellation. - * @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 {@link Response}. - */ - Response cancelOrderItemWithResponse(String orderItemName, String resourceGroupName, - CancellationReason cancellationReason, Context context); - - /** - * Cancel order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cancellationReason Reason for cancellation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void cancelOrderItem(String orderItemName, String resourceGroupName, CancellationReason cancellationReason); - - /** - * Return order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param returnOrderItemDetails Return order item CurrentStatus. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void returnOrderItem(String orderItemName, String resourceGroupName, ReturnOrderItemDetails returnOrderItemDetails); - - /** - * Return order item. - * - * @param orderItemName The name of the order item. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param returnOrderItemDetails Return order item CurrentStatus. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void returnOrderItem(String orderItemName, String resourceGroupName, ReturnOrderItemDetails returnOrderItemDetails, - Context context); - - /** - * Gets information about the specified address. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified address along with {@link Response}. - */ - AddressResource getById(String id); - - /** - * Gets information about the specified address. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified address along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Gets an order item. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an order item along with {@link Response}. - */ - OrderItemResource getOrderItemById(String id); - - /** - * Gets an order item. - * - * @param id the resource ID. - * @param expand $expand is supported on device details, forward shipping details and reverse shipping details - * parameters. Each of these can be provided as a comma separated list. Device Details for order item provides - * details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping - * details respectively. - * @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 an order item along with {@link Response}. - */ - Response getOrderItemByIdWithResponse(String id, String expand, Context context); - - /** - * Deletes an address. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Deletes an address. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByIdWithResponse(String id, Context context); - - /** - * Deletes an order item. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteOrderItemById(String id); - - /** - * Deletes an order item. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteOrderItemByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new AddressResource resource. - * - * @param name resource name. - * @return the first stage of the new AddressResource definition. - */ - AddressResource.DefinitionStages.Blank defineAddress(String name); - - /** - * Begins definition for a new OrderItemResource resource. - * - * @param name resource name. - * @return the first stage of the new OrderItemResource definition. - */ - OrderItemResource.DefinitionStages.Blank defineOrderItem(String name); -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ReturnOrderItemDetails.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ReturnOrderItemDetails.java index 37bb4bbf6263..08663d7c6403 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ReturnOrderItemDetails.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/ReturnOrderItemDetails.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -19,7 +19,7 @@ @Fluent public final class ReturnOrderItemDetails implements JsonSerializable { /* - * customer return address. + * Customer return address. */ private AddressProperties returnAddress; @@ -29,12 +29,12 @@ public final class ReturnOrderItemDetails implements JsonSerializable { + /* + * Unique Id, Identifying A Site. + */ + private String siteId; + + /** + * Creates an instance of SiteDetails class. + */ + public SiteDetails() { + } + + /** + * Get the siteId property: Unique Id, Identifying A Site. + * + * @return the siteId value. + */ + public String siteId() { + return this.siteId; + } + + /** + * Set the siteId property: Unique Id, Identifying A Site. + * + * @param siteId the siteId value to set. + * @return the SiteDetails object itself. + */ + public SiteDetails withSiteId(String siteId) { + this.siteId = siteId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (siteId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property siteId in model SiteDetails")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SiteDetails.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("siteId", this.siteId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SiteDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SiteDetails 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 SiteDetails. + */ + public static SiteDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SiteDetails deserializedSiteDetails = new SiteDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("siteId".equals(fieldName)) { + deserializedSiteDetails.siteId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSiteDetails; + }); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Specification.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Specification.java index a9dbd32a2e8c..e72b378a976a 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Specification.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/Specification.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -12,24 +12,24 @@ import java.io.IOException; /** - * Specifications of the configurations. + * Specification of the configurations. */ @Immutable public final class Specification implements JsonSerializable { /* - * Name of the specification + * Name of the specification. */ private String name; /* - * Value of the specification + * Value of the specification. */ private String value; /** * Creates an instance of Specification class. */ - public Specification() { + private Specification() { } /** diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/StageDetails.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/StageDetails.java index 0d9f62798bc6..f90f2e1ff9ab 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/StageDetails.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/StageDetails.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -24,7 +24,7 @@ public final class StageDetails implements JsonSerializable { private StageStatus stageStatus; /* - * Stage name + * Stage name. */ private StageName stageName; @@ -34,14 +34,14 @@ public final class StageDetails implements JsonSerializable { private String displayName; /* - * Stage start time + * Stage start time. */ private OffsetDateTime startTime; /** * Creates an instance of StageDetails class. */ - public StageDetails() { + private StageDetails() { } /** diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/StageName.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/StageName.java index 3b6dd8e6b76b..bff3a26b5bce 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/StageName.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/StageName.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -12,62 +12,67 @@ */ public final class StageName extends ExpandableStringEnum { /** - * Static value Placed for StageName. + * Currently in draft mode and can still be cancelled. */ public static final StageName PLACED = fromString("Placed"); /** - * Static value InReview for StageName. + * Order is currently in draft mode and can still be cancelled. */ public static final StageName IN_REVIEW = fromString("InReview"); /** - * Static value Confirmed for StageName. + * Order is confirmed. */ public static final StageName CONFIRMED = fromString("Confirmed"); /** - * Static value ReadyToShip for StageName. + * Order is ready to ship. */ public static final StageName READY_TO_SHIP = fromString("ReadyToShip"); /** - * Static value Shipped for StageName. + * Order is in transit to customer. */ public static final StageName SHIPPED = fromString("Shipped"); /** - * Static value Delivered for StageName. + * Order is delivered to customer. */ public static final StageName DELIVERED = fromString("Delivered"); /** - * Static value InUse for StageName. + * Order is ready to get cloud connected. + */ + public static final StageName READY_TO_SETUP = fromString("ReadyToSetup"); + + /** + * Order is in use at customer site. */ public static final StageName IN_USE = fromString("InUse"); /** - * Static value ReturnInitiated for StageName. + * Return has been initiated by customer. */ public static final StageName RETURN_INITIATED = fromString("ReturnInitiated"); /** - * Static value ReturnPickedUp for StageName. + * Order is in transit from customer to Microsoft. */ public static final StageName RETURN_PICKED_UP = fromString("ReturnPickedUp"); /** - * Static value ReturnedToMicrosoft for StageName. + * Order has been received back to Microsoft. */ public static final StageName RETURNED_TO_MICROSOFT = fromString("ReturnedToMicrosoft"); /** - * Static value ReturnCompleted for StageName. + * Return has now completed. */ public static final StageName RETURN_COMPLETED = fromString("ReturnCompleted"); /** - * Static value Cancelled for StageName. + * Order has been cancelled. */ public static final StageName CANCELLED = fromString("Cancelled"); diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/StageStatus.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/StageStatus.java index ea6fa271436b..31e8b918ddea 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/StageStatus.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/StageStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -12,32 +12,32 @@ */ public final class StageStatus extends ExpandableStringEnum { /** - * Static value None for StageStatus. + * No status available yet. */ public static final StageStatus NONE = fromString("None"); /** - * Static value InProgress for StageStatus. + * Stage is in progress. */ public static final StageStatus IN_PROGRESS = fromString("InProgress"); /** - * Static value Succeeded for StageStatus. + * Stage has succeeded. */ public static final StageStatus SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for StageStatus. + * Stage has failed. */ public static final StageStatus FAILED = fromString("Failed"); /** - * Static value Cancelled for StageStatus. + * Stage has been cancelled. */ public static final StageStatus CANCELLED = fromString("Cancelled"); /** - * Static value Cancelling for StageStatus. + * Stage is cancelling. */ public static final StageStatus CANCELLING = fromString("Cancelling"); diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/SupportedFilterTypes.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/SupportedFilterTypes.java index 1c25c2dbc520..6213de918f71 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/SupportedFilterTypes.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/SupportedFilterTypes.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -12,12 +12,12 @@ */ public final class SupportedFilterTypes extends ExpandableStringEnum { /** - * Static value ShipToCountries for SupportedFilterTypes. + * Ship to country. */ public static final SupportedFilterTypes SHIP_TO_COUNTRIES = fromString("ShipToCountries"); /** - * Static value DoubleEncryptionStatus for SupportedFilterTypes. + * Double encryption status. */ public static final SupportedFilterTypes DOUBLE_ENCRYPTION_STATUS = fromString("DoubleEncryptionStatus"); diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/TermCommitmentInformation.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/TermCommitmentInformation.java new file mode 100644 index 000000000000..2daec39a5863 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/TermCommitmentInformation.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; + +/** + * Term Commitment Information. + */ +@Immutable +public final class TermCommitmentInformation implements JsonSerializable { + /* + * Term Commitment Type + */ + private TermCommitmentType termCommitmentType; + + /* + * Term Commitment Duration. Currently Supporting P365D, P1095D + */ + private Duration termCommitmentTypeDuration; + + /* + * Number of Days Pending for Term Commitment + */ + private Integer pendingDaysForTerm; + + /** + * Creates an instance of TermCommitmentInformation class. + */ + private TermCommitmentInformation() { + } + + /** + * Get the termCommitmentType property: Term Commitment Type. + * + * @return the termCommitmentType value. + */ + public TermCommitmentType termCommitmentType() { + return this.termCommitmentType; + } + + /** + * Get the termCommitmentTypeDuration property: Term Commitment Duration. Currently Supporting P365D, P1095D. + * + * @return the termCommitmentTypeDuration value. + */ + public Duration termCommitmentTypeDuration() { + return this.termCommitmentTypeDuration; + } + + /** + * Get the pendingDaysForTerm property: Number of Days Pending for Term Commitment. + * + * @return the pendingDaysForTerm value. + */ + public Integer pendingDaysForTerm() { + return this.pendingDaysForTerm; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (termCommitmentType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property termCommitmentType in model TermCommitmentInformation")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TermCommitmentInformation.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("termCommitmentType", + this.termCommitmentType == null ? null : this.termCommitmentType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TermCommitmentInformation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TermCommitmentInformation 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 TermCommitmentInformation. + */ + public static TermCommitmentInformation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TermCommitmentInformation deserializedTermCommitmentInformation = new TermCommitmentInformation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("termCommitmentType".equals(fieldName)) { + deserializedTermCommitmentInformation.termCommitmentType + = TermCommitmentType.fromString(reader.getString()); + } else if ("termCommitmentTypeDuration".equals(fieldName)) { + deserializedTermCommitmentInformation.termCommitmentTypeDuration + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else if ("pendingDaysForTerm".equals(fieldName)) { + deserializedTermCommitmentInformation.pendingDaysForTerm = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedTermCommitmentInformation; + }); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/TermCommitmentPreferences.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/TermCommitmentPreferences.java new file mode 100644 index 000000000000..a7dab8762713 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/TermCommitmentPreferences.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; + +/** + * Term Commitment preference received from customer. + */ +@Fluent +public final class TermCommitmentPreferences implements JsonSerializable { + /* + * Term Commitment Type + */ + private TermCommitmentType preferredTermCommitmentType; + + /* + * Customer preferred Term Duration. + */ + private Duration preferredTermCommitmentDuration; + + /** + * Creates an instance of TermCommitmentPreferences class. + */ + public TermCommitmentPreferences() { + } + + /** + * Get the preferredTermCommitmentType property: Term Commitment Type. + * + * @return the preferredTermCommitmentType value. + */ + public TermCommitmentType preferredTermCommitmentType() { + return this.preferredTermCommitmentType; + } + + /** + * Set the preferredTermCommitmentType property: Term Commitment Type. + * + * @param preferredTermCommitmentType the preferredTermCommitmentType value to set. + * @return the TermCommitmentPreferences object itself. + */ + public TermCommitmentPreferences withPreferredTermCommitmentType(TermCommitmentType preferredTermCommitmentType) { + this.preferredTermCommitmentType = preferredTermCommitmentType; + return this; + } + + /** + * Get the preferredTermCommitmentDuration property: Customer preferred Term Duration. + * + * @return the preferredTermCommitmentDuration value. + */ + public Duration preferredTermCommitmentDuration() { + return this.preferredTermCommitmentDuration; + } + + /** + * Set the preferredTermCommitmentDuration property: Customer preferred Term Duration. + * + * @param preferredTermCommitmentDuration the preferredTermCommitmentDuration value to set. + * @return the TermCommitmentPreferences object itself. + */ + public TermCommitmentPreferences withPreferredTermCommitmentDuration(Duration preferredTermCommitmentDuration) { + this.preferredTermCommitmentDuration = preferredTermCommitmentDuration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (preferredTermCommitmentType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property preferredTermCommitmentType in model TermCommitmentPreferences")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TermCommitmentPreferences.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("preferredTermCommitmentType", + this.preferredTermCommitmentType == null ? null : this.preferredTermCommitmentType.toString()); + jsonWriter.writeStringField("preferredTermCommitmentDuration", + CoreUtils.durationToStringWithDays(this.preferredTermCommitmentDuration)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TermCommitmentPreferences from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TermCommitmentPreferences 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 TermCommitmentPreferences. + */ + public static TermCommitmentPreferences fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TermCommitmentPreferences deserializedTermCommitmentPreferences = new TermCommitmentPreferences(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("preferredTermCommitmentType".equals(fieldName)) { + deserializedTermCommitmentPreferences.preferredTermCommitmentType + = TermCommitmentType.fromString(reader.getString()); + } else if ("preferredTermCommitmentDuration".equals(fieldName)) { + deserializedTermCommitmentPreferences.preferredTermCommitmentDuration + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedTermCommitmentPreferences; + }); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/TermCommitmentType.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/TermCommitmentType.java new file mode 100644 index 000000000000..847120c6ae70 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/TermCommitmentType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Term Commitment Type. + */ +public final class TermCommitmentType extends ExpandableStringEnum { + /** + * Pay as you go Term Commitment Model. + */ + public static final TermCommitmentType NONE = fromString("None"); + + /** + * Trial Term Commitment Model. + */ + public static final TermCommitmentType TRIAL = fromString("Trial"); + + /** + * Time based Term Commitment Model. + */ + public static final TermCommitmentType TIMED = fromString("Timed"); + + /** + * Creates a new instance of TermCommitmentType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TermCommitmentType() { + } + + /** + * Creates or finds a TermCommitmentType from its string representation. + * + * @param name a name to look for. + * @return the corresponding TermCommitmentType. + */ + public static TermCommitmentType fromString(String name) { + return fromString(name, TermCommitmentType.class); + } + + /** + * Gets known TermCommitmentType values. + * + * @return known TermCommitmentType values. + */ + public static Collection values() { + return values(TermCommitmentType.class); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/TermTypeDetails.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/TermTypeDetails.java new file mode 100644 index 000000000000..4edc1c407b90 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/TermTypeDetails.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; + +/** + * Holds details about term type and duration. + */ +@Immutable +public final class TermTypeDetails implements JsonSerializable { + /* + * Term Commitment Type + */ + private TermCommitmentType termType; + + /* + * Duration for the term type. + */ + private Duration termTypeDuration; + + /** + * Creates an instance of TermTypeDetails class. + */ + private TermTypeDetails() { + } + + /** + * Get the termType property: Term Commitment Type. + * + * @return the termType value. + */ + public TermCommitmentType termType() { + return this.termType; + } + + /** + * Get the termTypeDuration property: Duration for the term type. + * + * @return the termTypeDuration value. + */ + public Duration termTypeDuration() { + return this.termTypeDuration; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (termType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property termType in model TermTypeDetails")); + } + if (termTypeDuration() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property termTypeDuration in model TermTypeDetails")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TermTypeDetails.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("termType", this.termType == null ? null : this.termType.toString()); + jsonWriter.writeStringField("termTypeDuration", CoreUtils.durationToStringWithDays(this.termTypeDuration)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TermTypeDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TermTypeDetails 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 TermTypeDetails. + */ + public static TermTypeDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TermTypeDetails deserializedTermTypeDetails = new TermTypeDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("termType".equals(fieldName)) { + deserializedTermTypeDetails.termType = TermCommitmentType.fromString(reader.getString()); + } else if ("termTypeDuration".equals(fieldName)) { + deserializedTermTypeDetails.termTypeDuration + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedTermTypeDetails; + }); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/TransportPreferences.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/TransportPreferences.java index b4e2e8621eef..3846c7d87077 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/TransportPreferences.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/TransportPreferences.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/TransportShipmentTypes.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/TransportShipmentTypes.java index c8ad35a56f72..7fede36f9015 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/TransportShipmentTypes.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/TransportShipmentTypes.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -12,12 +12,12 @@ */ public final class TransportShipmentTypes extends ExpandableStringEnum { /** - * Static value CustomerManaged for TransportShipmentTypes. + * Shipment Logistics is handled by the customer. */ public static final TransportShipmentTypes CUSTOMER_MANAGED = fromString("CustomerManaged"); /** - * Static value MicrosoftManaged for TransportShipmentTypes. + * Shipment Logistics is handled by Microsoft. */ public static final TransportShipmentTypes MICROSOFT_MANAGED = fromString("MicrosoftManaged"); diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/UserAssignedIdentity.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/UserAssignedIdentity.java new file mode 100644 index 000000000000..9cd72d7d308f --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/UserAssignedIdentity.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * User assigned identity properties. + */ +@Immutable +public final class UserAssignedIdentity implements JsonSerializable { + /* + * The principal ID of the assigned identity. + */ + private String principalId; + + /* + * The client ID of the assigned identity. + */ + private String clientId; + + /** + * Creates an instance of UserAssignedIdentity class. + */ + public UserAssignedIdentity() { + } + + /** + * Get the principalId property: The principal ID of the assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserAssignedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserAssignedIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the UserAssignedIdentity. + */ + public static UserAssignedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserAssignedIdentity deserializedUserAssignedIdentity = new UserAssignedIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedUserAssignedIdentity.principalId = reader.getString(); + } else if ("clientId".equals(fieldName)) { + deserializedUserAssignedIdentity.clientId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserAssignedIdentity; + }); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/WeightMeasurementUnit.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/WeightMeasurementUnit.java index 9296d74690c8..1c8d83da2e43 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/WeightMeasurementUnit.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/WeightMeasurementUnit.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.models; @@ -12,12 +12,12 @@ */ public final class WeightMeasurementUnit extends ExpandableStringEnum { /** - * Static value LBS for WeightMeasurementUnit. + * Pounds. */ public static final WeightMeasurementUnit LBS = fromString("LBS"); /** - * Static value KGS for WeightMeasurementUnit. + * Kilograms. */ public static final WeightMeasurementUnit KGS = fromString("KGS"); diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/package-info.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/package-info.java index 021cbdddf69b..eb724b09b611 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/models/package-info.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/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 EdgeOrderManagementClient. + * Package containing the data models for Edgeorder. * Edge Order API's. */ package com.azure.resourcemanager.edgeorder.models; diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/package-info.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/package-info.java index 1f183ff279ee..a441278f431a 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/package-info.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/com/azure/resourcemanager/edgeorder/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 EdgeOrderManagementClient. + * Package containing the classes for Edgeorder. * Edge Order API's. */ package com.azure.resourcemanager.edgeorder; diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/module-info.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/module-info.java index 8aa685186f08..a8c2b5c2328e 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/java/module-info.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/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.edgeorder { requires transitive com.azure.core.management; @@ -12,4 +12,5 @@ opens com.azure.resourcemanager.edgeorder.fluent.models to com.azure.core; opens com.azure.resourcemanager.edgeorder.models to com.azure.core; + opens com.azure.resourcemanager.edgeorder.implementation.models to com.azure.core; } diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-edgeorder/proxy-config.json b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-edgeorder/proxy-config.json index 3c86a3cbe22e..b6e8a3ded3c7 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-edgeorder/proxy-config.json +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-edgeorder/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.edgeorder.implementation.ResourceProvidersClientImpl$ResourceProvidersService"]] \ No newline at end of file +[["com.azure.resourcemanager.edgeorder.implementation.AddressResourcesClientImpl$AddressResourcesService"],["com.azure.resourcemanager.edgeorder.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.edgeorder.implementation.OrderItemResourcesClientImpl$OrderItemResourcesService"],["com.azure.resourcemanager.edgeorder.implementation.OrderResourcesClientImpl$OrderResourcesService"],["com.azure.resourcemanager.edgeorder.implementation.OrdersOperationGroupsClientImpl$OrdersOperationGroupsService"],["com.azure.resourcemanager.edgeorder.implementation.ProductsAndConfigurationsOperationGroupsClientImpl$ProductsAndConfigurationsOperationGroupsService"]] \ No newline at end of file diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/resources/azure-resourcemanager-edgeorder.properties b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/resources/azure-resourcemanager-edgeorder.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/main/resources/azure-resourcemanager-edgeorder.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderCreateAddressSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/AddressResourcesCreateSamples.java similarity index 71% rename from sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderCreateAddressSamples.java rename to sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/AddressResourcesCreateSamples.java index ca2328f27eb7..bdec7b10320b 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderCreateAddressSamples.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/AddressResourcesCreateSamples.java @@ -1,36 +1,33 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.generated; +import com.azure.resourcemanager.edgeorder.models.AddressClassification; import com.azure.resourcemanager.edgeorder.models.AddressType; import com.azure.resourcemanager.edgeorder.models.ContactDetails; import com.azure.resourcemanager.edgeorder.models.ShippingAddress; import java.util.Arrays; /** - * Samples for ResourceProvider CreateAddress. + * Samples for AddressResources Create. */ -public final class ResourceProviderCreateAddressSamples { +public final class AddressResourcesCreateSamples { /* - * x-ms-original-file: - * specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/CreateAddress.json + * x-ms-original-file: 2024-02-01/CreateAddress.json */ /** * Sample code: CreateAddress. * - * @param manager Entry point to EdgeOrderManager. + * @param manager Entry point to EdgeorderManager. */ - public static void createAddress(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders() - .defineAddress("TestAddressName2") + public static void createAddress(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.addressResources() + .define("TestAddressName2") .withRegion("eastus") .withExistingResourceGroup("YourResourceGroupName") - .withContactDetails(new ContactDetails().withContactName("XXXX XXXX") - .withPhone("0000000000") - .withPhoneExtension("") - .withEmailList(Arrays.asList("xxxx@xxxx.xxx"))) + .withAddressClassification(AddressClassification.SHIPPING) .withShippingAddress(new ShippingAddress().withStreetAddress1("16 TOWNSEND ST") .withStreetAddress2("UNIT 1") .withCity("San Francisco") @@ -39,6 +36,10 @@ public static void createAddress(com.azure.resourcemanager.edgeorder.EdgeOrderMa .withPostalCode("fakeTokenPlaceholder") .withCompanyName("Microsoft") .withAddressType(AddressType.NONE)) + .withContactDetails(new ContactDetails().withContactName("XXXX XXXX") + .withPhone("0000000000") + .withPhoneExtension("") + .withEmailList(Arrays.asList("xxxx@xxxx.xxx"))) .create(); } } diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/AddressResourcesDeleteSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/AddressResourcesDeleteSamples.java new file mode 100644 index 000000000000..622583e2f522 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/AddressResourcesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.generated; + +/** + * Samples for AddressResources Delete. + */ +public final class AddressResourcesDeleteSamples { + /* + * x-ms-original-file: 2024-02-01/DeleteAddressByName.json + */ + /** + * Sample code: DeleteAddressByName. + * + * @param manager Entry point to EdgeorderManager. + */ + public static void deleteAddressByName(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.addressResources() + .delete("YourResourceGroupName", "TestAddressName1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderGetByResourceGroupSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/AddressResourcesGetByResourceGroupSamples.java similarity index 50% rename from sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderGetByResourceGroupSamples.java rename to sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/AddressResourcesGetByResourceGroupSamples.java index d4daea9be999..91b47fcf8263 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderGetByResourceGroupSamples.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/AddressResourcesGetByResourceGroupSamples.java @@ -1,24 +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.edgeorder.generated; /** - * Samples for ResourceProvider GetByResourceGroup. + * Samples for AddressResources GetByResourceGroup. */ -public final class ResourceProviderGetByResourceGroupSamples { +public final class AddressResourcesGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/GetAddressByName.json + * x-ms-original-file: 2024-02-01/GetAddressByName.json */ /** * Sample code: GetAddressByName. * - * @param manager Entry point to EdgeOrderManager. + * @param manager Entry point to EdgeorderManager. */ - public static void getAddressByName(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders() + public static void getAddressByName(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.addressResources() .getByResourceGroupWithResponse("YourResourceGroupName", "TestAddressName1", com.azure.core.util.Context.NONE); } diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/AddressResourcesListByResourceGroupSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/AddressResourcesListByResourceGroupSamples.java new file mode 100644 index 000000000000..d32ff9eb9431 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/AddressResourcesListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.generated; + +/** + * Samples for AddressResources ListByResourceGroup. + */ +public final class AddressResourcesListByResourceGroupSamples { + /* + * x-ms-original-file: 2024-02-01/ListAddressesAtResourceGroupLevel.json + */ + /** + * Sample code: ListAddressesAtResourceGroupLevel. + * + * @param manager Entry point to EdgeorderManager. + */ + public static void listAddressesAtResourceGroupLevel(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.addressResources() + .listByResourceGroup("YourResourceGroupName", null, null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/AddressResourcesListSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/AddressResourcesListSamples.java new file mode 100644 index 000000000000..1971fab21854 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/AddressResourcesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.generated; + +/** + * Samples for AddressResources List. + */ +public final class AddressResourcesListSamples { + /* + * x-ms-original-file: 2024-02-01/ListAddressesAtSubscriptionLevel.json + */ + /** + * Sample code: ListAddressesAtSubscriptionLevel. + * + * @param manager Entry point to EdgeorderManager. + */ + public static void listAddressesAtSubscriptionLevel(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.addressResources().list(null, null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderUpdateAddressSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/AddressResourcesUpdateSamples.java similarity index 80% rename from sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderUpdateAddressSamples.java rename to sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/AddressResourcesUpdateSamples.java index 561abcc8e0e5..7a369b0f7d85 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderUpdateAddressSamples.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/AddressResourcesUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.generated; @@ -13,20 +13,19 @@ import java.util.Map; /** - * Samples for ResourceProvider UpdateAddress. + * Samples for AddressResources Update. */ -public final class ResourceProviderUpdateAddressSamples { +public final class AddressResourcesUpdateSamples { /* - * x-ms-original-file: - * specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/UpdateAddress.json + * x-ms-original-file: 2024-02-01/UpdateAddress.json */ /** * Sample code: UpdateAddress. * - * @param manager Entry point to EdgeOrderManager. + * @param manager Entry point to EdgeorderManager. */ - public static void updateAddress(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - AddressResource resource = manager.resourceProviders() + public static void updateAddress(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + AddressResource resource = manager.addressResources() .getByResourceGroupWithResponse("YourResourceGroupName", "TestAddressName2", com.azure.core.util.Context.NONE) .getValue(); diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OperationsListSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OperationsListSamples.java new file mode 100644 index 000000000000..ddf3306a628a --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OperationsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.generated; + +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2024-02-01/ListOperations.json + */ + /** + * Sample code: ListOperations. + * + * @param manager Entry point to EdgeorderManager. + */ + public static void listOperations(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OrderItemResourcesCancelSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OrderItemResourcesCancelSamples.java new file mode 100644 index 000000000000..c490a9d341ff --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OrderItemResourcesCancelSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.generated; + +import com.azure.resourcemanager.edgeorder.models.CancellationReason; + +/** + * Samples for OrderItemResources Cancel. + */ +public final class OrderItemResourcesCancelSamples { + /* + * x-ms-original-file: 2024-02-01/CancelOrderItem.json + */ + /** + * Sample code: CancelOrderItem. + * + * @param manager Entry point to EdgeorderManager. + */ + public static void cancelOrderItem(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.orderItemResources() + .cancelWithResponse("YourResourceGroupName", "TestOrderItemName3", + new CancellationReason().withReason("Order cancelled"), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderCreateOrderItemSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OrderItemResourcesCreateSamples.java similarity index 80% rename from sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderCreateOrderItemSamples.java rename to sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OrderItemResourcesCreateSamples.java index 53577ceff0bd..c6f47ea1125b 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderCreateOrderItemSamples.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OrderItemResourcesCreateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.generated; @@ -19,21 +19,20 @@ import java.util.Arrays; /** - * Samples for ResourceProvider CreateOrderItem. + * Samples for OrderItemResources Create. */ -public final class ResourceProviderCreateOrderItemSamples { +public final class OrderItemResourcesCreateSamples { /* - * x-ms-original-file: - * specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/CreateOrderItem.json + * x-ms-original-file: 2024-02-01/CreateOrderItem.json */ /** * Sample code: CreateOrderItem. * - * @param manager Entry point to EdgeOrderManager. + * @param manager Entry point to EdgeorderManager. */ - public static void createOrderItem(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders() - .defineOrderItem("TestOrderItemName2") + public static void createOrderItem(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.orderItemResources() + .define("TestOrderItemName2") .withRegion("eastus") .withExistingResourceGroup("YourResourceGroupName") .withOrderItemDetails(new OrderItemDetails() @@ -45,6 +44,8 @@ public static void createOrderItem(com.azure.resourcemanager.edgeorder.EdgeOrder .withOrderItemType(OrderItemType.PURCHASE) .withPreferences(new Preferences().withTransportPreferences( new TransportPreferences().withPreferredShipmentType(TransportShipmentTypes.MICROSOFT_MANAGED)))) + .withOrderId( + "/subscriptions/eb5dc900-6186-49d8-b7d7-febd866fdc1d/resourceGroups/YourResourceGroupName/providers/Microsoft.EdgeOrder/locations/eastus/orders/TestOrderName2") .withAddressDetails(new AddressDetails().withForwardAddress(new AddressProperties() .withShippingAddress(new ShippingAddress().withStreetAddress1("16 TOWNSEND ST") .withStreetAddress2("UNIT 1") @@ -58,8 +59,6 @@ public static void createOrderItem(com.azure.resourcemanager.edgeorder.EdgeOrder .withPhone("0000000000") .withPhoneExtension("") .withEmailList(Arrays.asList("xxxx@xxxx.xxx"))))) - .withOrderId( - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.EdgeOrder/locations/eastus/orders/TestOrderName2") .create(); } } diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OrderItemResourcesDeleteSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OrderItemResourcesDeleteSamples.java new file mode 100644 index 000000000000..3d063403f6a1 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OrderItemResourcesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.generated; + +/** + * Samples for OrderItemResources Delete. + */ +public final class OrderItemResourcesDeleteSamples { + /* + * x-ms-original-file: 2024-02-01/DeleteOrderItemByName.json + */ + /** + * Sample code: DeleteOrderItemByName. + * + * @param manager Entry point to EdgeorderManager. + */ + public static void deleteOrderItemByName(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.orderItemResources() + .delete("YourResourceGroupName", "TestOrderItemName3", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OrderItemResourcesGetByResourceGroupSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OrderItemResourcesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..955d0a783017 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OrderItemResourcesGetByResourceGroupSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.generated; + +/** + * Samples for OrderItemResources GetByResourceGroup. + */ +public final class OrderItemResourcesGetByResourceGroupSamples { + /* + * x-ms-original-file: 2024-02-01/GetOrderItemByName.json + */ + /** + * Sample code: GetOrderItemByName. + * + * @param manager Entry point to EdgeorderManager. + */ + public static void getOrderItemByName(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.orderItemResources() + .getByResourceGroupWithResponse("YourResourceGroupName", "TestOrderItemName1", null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OrderItemResourcesListByResourceGroupSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OrderItemResourcesListByResourceGroupSamples.java new file mode 100644 index 000000000000..59f45eacb435 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OrderItemResourcesListByResourceGroupSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.generated; + +/** + * Samples for OrderItemResources ListByResourceGroup. + */ +public final class OrderItemResourcesListByResourceGroupSamples { + /* + * x-ms-original-file: 2024-02-01/ListOrderItemsAtResourceGroupLevel.json + */ + /** + * Sample code: ListOrderItemsAtResourceGroupLevel. + * + * @param manager Entry point to EdgeorderManager. + */ + public static void + listOrderItemsAtResourceGroupLevel(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.orderItemResources() + .listByResourceGroup("YourResourceGroupName", null, null, null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OrderItemResourcesListSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OrderItemResourcesListSamples.java new file mode 100644 index 000000000000..737dbc86bfb4 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OrderItemResourcesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.generated; + +/** + * Samples for OrderItemResources List. + */ +public final class OrderItemResourcesListSamples { + /* + * x-ms-original-file: 2024-02-01/ListOrderItemsAtSubscriptionLevel.json + */ + /** + * Sample code: ListOrderItemsAtSubscriptionLevel. + * + * @param manager Entry point to EdgeorderManager. + */ + public static void listOrderItemsAtSubscriptionLevel(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.orderItemResources().list(null, null, null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OrderItemResourcesReturnOrderItemSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OrderItemResourcesReturnOrderItemSamples.java new file mode 100644 index 000000000000..a62470187912 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OrderItemResourcesReturnOrderItemSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.generated; + +import com.azure.resourcemanager.edgeorder.models.ReturnOrderItemDetails; + +/** + * Samples for OrderItemResources ReturnOrderItem. + */ +public final class OrderItemResourcesReturnOrderItemSamples { + /* + * x-ms-original-file: 2024-02-01/ReturnOrderItem.json + */ + /** + * Sample code: ReturnOrderItem. + * + * @param manager Entry point to EdgeorderManager. + */ + public static void returnOrderItem(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.orderItemResources() + .returnOrderItem("YourResourceGroupName", "TestOrderName4", + new ReturnOrderItemDetails().withReturnReason("Order returned"), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderUpdateOrderItemSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OrderItemResourcesUpdateSamples.java similarity index 61% rename from sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderUpdateOrderItemSamples.java rename to sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OrderItemResourcesUpdateSamples.java index da295285562d..c3dc6fd9a198 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderUpdateOrderItemSamples.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OrderItemResourcesUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.generated; @@ -10,21 +10,20 @@ import com.azure.resourcemanager.edgeorder.models.TransportShipmentTypes; /** - * Samples for ResourceProvider UpdateOrderItem. + * Samples for OrderItemResources Update. */ -public final class ResourceProviderUpdateOrderItemSamples { +public final class OrderItemResourcesUpdateSamples { /* - * x-ms-original-file: - * specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/UpdateOrderItem.json + * x-ms-original-file: 2024-02-01/UpdateOrderItem.json */ /** * Sample code: UpdateOrderItem. * - * @param manager Entry point to EdgeOrderManager. + * @param manager Entry point to EdgeorderManager. */ - public static void updateOrderItem(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - OrderItemResource resource = manager.resourceProviders() - .getOrderItemByNameWithResponse("TestOrderItemName3", "YourResourceGroupName", null, + public static void updateOrderItem(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + OrderItemResource resource = manager.orderItemResources() + .getByResourceGroupWithResponse("YourResourceGroupName", "TestOrderItemName3", null, com.azure.core.util.Context.NONE) .getValue(); resource.update() diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OrderResourcesGetSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OrderResourcesGetSamples.java new file mode 100644 index 000000000000..53ee9a0f4a1d --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OrderResourcesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.generated; + +/** + * Samples for OrderResources Get. + */ +public final class OrderResourcesGetSamples { + /* + * x-ms-original-file: 2024-02-01/GetOrderByName.json + */ + /** + * Sample code: GetOrderByName. + * + * @param manager Entry point to EdgeorderManager. + */ + public static void getOrderByName(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.orderResources() + .getWithResponse("YourResourceGroupName", "eastus", "TestOrderName3", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OrdersOperationGroupListByResourceGroupSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OrdersOperationGroupListByResourceGroupSamples.java new file mode 100644 index 000000000000..74a0d6a139ac --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OrdersOperationGroupListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.generated; + +/** + * Samples for OrdersOperationGroup ListByResourceGroup. + */ +public final class OrdersOperationGroupListByResourceGroupSamples { + /* + * x-ms-original-file: 2024-02-01/ListOrderAtResourceGroupLevel.json + */ + /** + * Sample code: ListOrderAtResourceGroupLevel. + * + * @param manager Entry point to EdgeorderManager. + */ + public static void listOrderAtResourceGroupLevel(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.ordersOperationGroups() + .listByResourceGroup("YourResourceGroupName", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OrdersOperationGroupListSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OrdersOperationGroupListSamples.java new file mode 100644 index 000000000000..f33463c446f9 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/OrdersOperationGroupListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.generated; + +/** + * Samples for OrdersOperationGroup List. + */ +public final class OrdersOperationGroupListSamples { + /* + * x-ms-original-file: 2024-02-01/ListOrderAtSubscriptionLevel.json + */ + /** + * Sample code: ListOrderAtSubscriptionLevel. + * + * @param manager Entry point to EdgeorderManager. + */ + public static void listOrderAtSubscriptionLevel(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.ordersOperationGroups().list(null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ProductsAndConfigurationsOperationGroupListConfigurationsSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ProductsAndConfigurationsOperationGroupListConfigurationsSamples.java new file mode 100644 index 000000000000..43d98bd2f7ca --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ProductsAndConfigurationsOperationGroupListConfigurationsSamples.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.generated; + +import com.azure.resourcemanager.edgeorder.models.ConfigurationFilter; +import com.azure.resourcemanager.edgeorder.models.ConfigurationsRequest; +import com.azure.resourcemanager.edgeorder.models.FilterableProperty; +import com.azure.resourcemanager.edgeorder.models.HierarchyInformation; +import com.azure.resourcemanager.edgeorder.models.SupportedFilterTypes; +import java.util.Arrays; + +/** + * Samples for ProductsAndConfigurationsOperationGroup ListConfigurations. + */ +public final class ProductsAndConfigurationsOperationGroupListConfigurationsSamples { + /* + * x-ms-original-file: 2024-02-01/ListConfigurations.json + */ + /** + * Sample code: ListConfigurations. + * + * @param manager Entry point to EdgeorderManager. + */ + public static void listConfigurations(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.productsAndConfigurationsOperationGroups() + .listConfigurations(new ConfigurationsRequest().withConfigurationFilter(new ConfigurationFilter() + .withHierarchyInformation(new HierarchyInformation().withProductFamilyName("azurestackedge") + .withProductLineName("azurestackedge") + .withProductName("azurestackedgegpu")) + .withFilterableProperty( + Arrays.asList(new FilterableProperty().withType(SupportedFilterTypes.SHIP_TO_COUNTRIES) + .withSupportedValues(Arrays.asList("US"))))), + null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ProductsAndConfigurationsOperationGroupListProductFamiliesMetadataSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ProductsAndConfigurationsOperationGroupListProductFamiliesMetadataSamples.java new file mode 100644 index 000000000000..dddd4e9bf1cb --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ProductsAndConfigurationsOperationGroupListProductFamiliesMetadataSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.generated; + +/** + * Samples for ProductsAndConfigurationsOperationGroup ListProductFamiliesMetadata. + */ +public final class ProductsAndConfigurationsOperationGroupListProductFamiliesMetadataSamples { + /* + * x-ms-original-file: 2024-02-01/ListProductFamiliesMetadata.json + */ + /** + * Sample code: ListProductFamiliesMetadata. + * + * @param manager Entry point to EdgeorderManager. + */ + public static void listProductFamiliesMetadata(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.productsAndConfigurationsOperationGroups() + .listProductFamiliesMetadata(null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderListProductFamiliesSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ProductsAndConfigurationsOperationGroupListProductFamiliesSamples.java similarity index 74% rename from sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderListProductFamiliesSamples.java rename to sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ProductsAndConfigurationsOperationGroupListProductFamiliesSamples.java index 372a6aebae2b..981ffbf03acb 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderListProductFamiliesSamples.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ProductsAndConfigurationsOperationGroupListProductFamiliesSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.generated; @@ -12,20 +12,19 @@ import java.util.Map; /** - * Samples for ResourceProvider ListProductFamilies. + * Samples for ProductsAndConfigurationsOperationGroup ListProductFamilies. */ -public final class ResourceProviderListProductFamiliesSamples { +public final class ProductsAndConfigurationsOperationGroupListProductFamiliesSamples { /* - * x-ms-original-file: - * specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ListProductFamilies.json + * x-ms-original-file: 2024-02-01/ListProductFamilies.json */ /** * Sample code: ListProductFamilies. * - * @param manager Entry point to EdgeOrderManager. + * @param manager Entry point to EdgeorderManager. */ - public static void listProductFamilies(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders() + public static void listProductFamilies(com.azure.resourcemanager.edgeorder.EdgeorderManager manager) { + manager.productsAndConfigurationsOperationGroups() .listProductFamilies( new ProductFamiliesRequest().withFilterableProperties(mapOf("azurestackedge", Arrays.asList(new FilterableProperty().withType(SupportedFilterTypes.SHIP_TO_COUNTRIES) diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderCancelOrderItemSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderCancelOrderItemSamples.java deleted file mode 100644 index 0a218e64b034..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderCancelOrderItemSamples.java +++ /dev/null @@ -1,27 +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.edgeorder.generated; - -import com.azure.resourcemanager.edgeorder.models.CancellationReason; - -/** - * Samples for ResourceProvider CancelOrderItem. - */ -public final class ResourceProviderCancelOrderItemSamples { - /* - * x-ms-original-file: - * specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/CancelOrderItem.json - */ - /** - * Sample code: CancelOrderItem. - * - * @param manager Entry point to EdgeOrderManager. - */ - public static void cancelOrderItem(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders() - .cancelOrderItemWithResponse("TestOrderItemName3", "YourResourceGroupName", - new CancellationReason().withReason("Order cancelled"), com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderDeleteOrderItemByNameSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderDeleteOrderItemByNameSamples.java deleted file mode 100644 index f841dde6fb82..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderDeleteOrderItemByNameSamples.java +++ /dev/null @@ -1,25 +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.edgeorder.generated; - -/** - * Samples for ResourceProvider DeleteOrderItemByName. - */ -public final class ResourceProviderDeleteOrderItemByNameSamples { - /* - * x-ms-original-file: - * specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/DeleteOrderItemByName. - * json - */ - /** - * Sample code: DeleteOrderItemByName. - * - * @param manager Entry point to EdgeOrderManager. - */ - public static void deleteOrderItemByName(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders() - .deleteOrderItemByName("TestOrderItemName3", "YourResourceGroupName", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderDeleteSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderDeleteSamples.java deleted file mode 100644 index ddac98af2e19..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderDeleteSamples.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.edgeorder.generated; - -/** - * Samples for ResourceProvider Delete. - */ -public final class ResourceProviderDeleteSamples { - /* - * x-ms-original-file: - * specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/DeleteAddressByName.json - */ - /** - * Sample code: DeleteAddressByName. - * - * @param manager Entry point to EdgeOrderManager. - */ - public static void deleteAddressByName(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders() - .delete("YourResourceGroupName", "TestAddressName1", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderGetOrderByNameSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderGetOrderByNameSamples.java deleted file mode 100644 index 73320ed2fc59..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderGetOrderByNameSamples.java +++ /dev/null @@ -1,25 +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.edgeorder.generated; - -/** - * Samples for ResourceProvider GetOrderByName. - */ -public final class ResourceProviderGetOrderByNameSamples { - /* - * x-ms-original-file: - * specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/GetOrderByName.json - */ - /** - * Sample code: GetOrderByName. - * - * @param manager Entry point to EdgeOrderManager. - */ - public static void getOrderByName(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders() - .getOrderByNameWithResponse("TestOrderName3", "YourResourceGroupName", "eastus", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderGetOrderItemByNameSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderGetOrderItemByNameSamples.java deleted file mode 100644 index 321880277b32..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderGetOrderItemByNameSamples.java +++ /dev/null @@ -1,25 +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.edgeorder.generated; - -/** - * Samples for ResourceProvider GetOrderItemByName. - */ -public final class ResourceProviderGetOrderItemByNameSamples { - /* - * x-ms-original-file: - * specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/GetOrderItemByName.json - */ - /** - * Sample code: GetOrderItemByName. - * - * @param manager Entry point to EdgeOrderManager. - */ - public static void getOrderItemByName(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders() - .getOrderItemByNameWithResponse("TestOrderItemName1", "YourResourceGroupName", null, - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderListByResourceGroupSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderListByResourceGroupSamples.java deleted file mode 100644 index e592dc761edb..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderListByResourceGroupSamples.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.edgeorder.generated; - -/** - * Samples for ResourceProvider ListByResourceGroup. - */ -public final class ResourceProviderListByResourceGroupSamples { - /* - * x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ - * ListAddressesAtResourceGroupLevel.json - */ - /** - * Sample code: ListAddressesAtResourceGroupLevel. - * - * @param manager Entry point to EdgeOrderManager. - */ - public static void listAddressesAtResourceGroupLevel(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders() - .listByResourceGroup("YourResourceGroupName", null, null, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderListConfigurationsSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderListConfigurationsSamples.java deleted file mode 100644 index 4a1f47ba96fd..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderListConfigurationsSamples.java +++ /dev/null @@ -1,39 +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.edgeorder.generated; - -import com.azure.resourcemanager.edgeorder.models.ConfigurationFilters; -import com.azure.resourcemanager.edgeorder.models.ConfigurationsRequest; -import com.azure.resourcemanager.edgeorder.models.FilterableProperty; -import com.azure.resourcemanager.edgeorder.models.HierarchyInformation; -import com.azure.resourcemanager.edgeorder.models.SupportedFilterTypes; -import java.util.Arrays; - -/** - * Samples for ResourceProvider ListConfigurations. - */ -public final class ResourceProviderListConfigurationsSamples { - /* - * x-ms-original-file: - * specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ListConfigurations.json - */ - /** - * Sample code: ListConfigurations. - * - * @param manager Entry point to EdgeOrderManager. - */ - public static void listConfigurations(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders() - .listConfigurations( - new ConfigurationsRequest().withConfigurationFilters(Arrays.asList(new ConfigurationFilters() - .withHierarchyInformation(new HierarchyInformation().withProductFamilyName("azurestackedge") - .withProductLineName("azurestackedge") - .withProductName("azurestackedgegpu")) - .withFilterableProperty( - Arrays.asList(new FilterableProperty().withType(SupportedFilterTypes.SHIP_TO_COUNTRIES) - .withSupportedValues(Arrays.asList("US")))))), - null, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderListOperationsSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderListOperationsSamples.java deleted file mode 100644 index 825f08faa9c0..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderListOperationsSamples.java +++ /dev/null @@ -1,23 +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.edgeorder.generated; - -/** - * Samples for ResourceProvider ListOperations. - */ -public final class ResourceProviderListOperationsSamples { - /* - * x-ms-original-file: - * specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ListOperations.json - */ - /** - * Sample code: ListOperations. - * - * @param manager Entry point to EdgeOrderManager. - */ - public static void listOperations(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders().listOperations(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderListOrderAtResourceGroupLevelSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderListOrderAtResourceGroupLevelSamples.java deleted file mode 100644 index 84b727c041ec..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderListOrderAtResourceGroupLevelSamples.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.edgeorder.generated; - -/** - * Samples for ResourceProvider ListOrderAtResourceGroupLevel. - */ -public final class ResourceProviderListOrderAtResourceGroupLevelSamples { - /* - * x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ - * ListOrderAtResourceGroupLevel.json - */ - /** - * Sample code: ListOrderAtResourceGroupLevel. - * - * @param manager Entry point to EdgeOrderManager. - */ - public static void listOrderAtResourceGroupLevel(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders() - .listOrderAtResourceGroupLevel("YourResourceGroupName", null, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderListOrderAtSubscriptionLevelSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderListOrderAtSubscriptionLevelSamples.java deleted file mode 100644 index 3b8495cbfbc1..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderListOrderAtSubscriptionLevelSamples.java +++ /dev/null @@ -1,23 +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.edgeorder.generated; - -/** - * Samples for ResourceProvider ListOrderAtSubscriptionLevel. - */ -public final class ResourceProviderListOrderAtSubscriptionLevelSamples { - /* - * x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ - * ListOrderAtSubscriptionLevel.json - */ - /** - * Sample code: ListOrderAtSubscriptionLevel. - * - * @param manager Entry point to EdgeOrderManager. - */ - public static void listOrderAtSubscriptionLevel(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders().listOrderAtSubscriptionLevel(null, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderListOrderItemsAtResourceGroupLevelSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderListOrderItemsAtResourceGroupLevelSamples.java deleted file mode 100644 index 7b8d915c1ca4..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderListOrderItemsAtResourceGroupLevelSamples.java +++ /dev/null @@ -1,26 +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.edgeorder.generated; - -/** - * Samples for ResourceProvider ListOrderItemsAtResourceGroupLevel. - */ -public final class ResourceProviderListOrderItemsAtResourceGroupLevelSamples { - /* - * x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ - * ListOrderItemsAtResourceGroupLevel.json - */ - /** - * Sample code: ListOrderItemsAtResourceGroupLevel. - * - * @param manager Entry point to EdgeOrderManager. - */ - public static void - listOrderItemsAtResourceGroupLevel(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders() - .listOrderItemsAtResourceGroupLevel("YourResourceGroupName", null, null, null, - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderListOrderItemsAtSubscriptionLevelSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderListOrderItemsAtSubscriptionLevelSamples.java deleted file mode 100644 index f31390458833..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderListOrderItemsAtSubscriptionLevelSamples.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.edgeorder.generated; - -/** - * Samples for ResourceProvider ListOrderItemsAtSubscriptionLevel. - */ -public final class ResourceProviderListOrderItemsAtSubscriptionLevelSamples { - /* - * x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ - * ListOrderItemsAtSubscriptionLevel.json - */ - /** - * Sample code: ListOrderItemsAtSubscriptionLevel. - * - * @param manager Entry point to EdgeOrderManager. - */ - public static void listOrderItemsAtSubscriptionLevel(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders() - .listOrderItemsAtSubscriptionLevel(null, null, null, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderListProductFamiliesMetadataSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderListProductFamiliesMetadataSamples.java deleted file mode 100644 index 0df599e067c3..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderListProductFamiliesMetadataSamples.java +++ /dev/null @@ -1,23 +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.edgeorder.generated; - -/** - * Samples for ResourceProvider ListProductFamiliesMetadata. - */ -public final class ResourceProviderListProductFamiliesMetadataSamples { - /* - * x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ - * ListProductFamiliesMetadata.json - */ - /** - * Sample code: ListProductFamiliesMetadata. - * - * @param manager Entry point to EdgeOrderManager. - */ - public static void listProductFamiliesMetadata(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders().listProductFamiliesMetadata(null, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderListSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderListSamples.java deleted file mode 100644 index 8be11b483c24..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderListSamples.java +++ /dev/null @@ -1,23 +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.edgeorder.generated; - -/** - * Samples for ResourceProvider List. - */ -public final class ResourceProviderListSamples { - /* - * x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ - * ListAddressesAtSubscriptionLevel.json - */ - /** - * Sample code: ListAddressesAtSubscriptionLevel. - * - * @param manager Entry point to EdgeOrderManager. - */ - public static void listAddressesAtSubscriptionLevel(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders().list(null, null, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderReturnOrderItemSamples.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderReturnOrderItemSamples.java deleted file mode 100644 index a90be802905b..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/samples/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderReturnOrderItemSamples.java +++ /dev/null @@ -1,27 +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.edgeorder.generated; - -import com.azure.resourcemanager.edgeorder.models.ReturnOrderItemDetails; - -/** - * Samples for ResourceProvider ReturnOrderItem. - */ -public final class ResourceProviderReturnOrderItemSamples { - /* - * x-ms-original-file: - * specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ReturnOrderItem.json - */ - /** - * Sample code: ReturnOrderItem. - * - * @param manager Entry point to EdgeOrderManager. - */ - public static void returnOrderItem(com.azure.resourcemanager.edgeorder.EdgeOrderManager manager) { - manager.resourceProviders() - .returnOrderItem("TestOrderName4", "YourResourceGroupName", - new ReturnOrderItemDetails().withReturnReason("Order returned"), com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/AvailabilityInformationTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/AvailabilityInformationTests.java deleted file mode 100644 index 58357c117d31..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/AvailabilityInformationTests.java +++ /dev/null @@ -1,23 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.models.AvailabilityInformation; - -public final class AvailabilityInformationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AvailabilityInformation model = BinaryData.fromString( - "{\"availabilityStage\":\"Preview\",\"disabledReason\":\"None\",\"disabledReasonMessage\":\"gjljyoxgvc\"}") - .toObject(AvailabilityInformation.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AvailabilityInformation model = new AvailabilityInformation(); - model = BinaryData.fromObject(model).toObject(AvailabilityInformation.class); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/BillingMeterDetailsTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/BillingMeterDetailsTests.java deleted file mode 100644 index 383917a0ec3f..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/BillingMeterDetailsTests.java +++ /dev/null @@ -1,23 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.models.BillingMeterDetails; - -public final class BillingMeterDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingMeterDetails model = BinaryData.fromString( - "{\"name\":\"fuwutttxf\",\"meterDetails\":{\"billingType\":\"MeterDetails\",\"multiplier\":70.29055066531684,\"chargingType\":\"PerDevice\"},\"meteringType\":\"OneTime\",\"frequency\":\"pcyvahfnljkyqx\"}") - .toObject(BillingMeterDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingMeterDetails model = new BillingMeterDetails(); - model = BinaryData.fromObject(model).toObject(BillingMeterDetails.class); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/CancellationReasonTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/CancellationReasonTests.java deleted file mode 100644 index 9f0e5b6458a6..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/CancellationReasonTests.java +++ /dev/null @@ -1,25 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.models.CancellationReason; -import org.junit.jupiter.api.Assertions; - -public final class CancellationReasonTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CancellationReason model - = BinaryData.fromString("{\"reason\":\"ssofwqmzqa\"}").toObject(CancellationReason.class); - Assertions.assertEquals("ssofwqmzqa", model.reason()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CancellationReason model = new CancellationReason().withReason("ssofwqmzqa"); - model = BinaryData.fromObject(model).toObject(CancellationReason.class); - Assertions.assertEquals("ssofwqmzqa", model.reason()); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ConfigurationFiltersTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ConfigurationFiltersTests.java deleted file mode 100644 index f568243346ea..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ConfigurationFiltersTests.java +++ /dev/null @@ -1,51 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.models.ConfigurationFilters; -import com.azure.resourcemanager.edgeorder.models.FilterableProperty; -import com.azure.resourcemanager.edgeorder.models.HierarchyInformation; -import com.azure.resourcemanager.edgeorder.models.SupportedFilterTypes; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ConfigurationFiltersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfigurationFilters model = BinaryData.fromString( - "{\"hierarchyInformation\":{\"productFamilyName\":\"dqmh\",\"productLineName\":\"dhtldwkyz\",\"productName\":\"utknc\",\"configurationName\":\"cwsvlxotog\"},\"filterableProperty\":[{\"type\":\"ShipToCountries\",\"supportedValues\":[\"qsx\",\"nmic\",\"kvceoveilovnotyf\"]},{\"type\":\"ShipToCountries\",\"supportedValues\":[\"njbkcnxdhbttkph\",\"wpn\",\"jtoqne\"]},{\"type\":\"DoubleEncryptionStatus\",\"supportedValues\":[\"lfplp\"]}]}") - .toObject(ConfigurationFilters.class); - Assertions.assertEquals("dqmh", model.hierarchyInformation().productFamilyName()); - Assertions.assertEquals("dhtldwkyz", model.hierarchyInformation().productLineName()); - Assertions.assertEquals("utknc", model.hierarchyInformation().productName()); - Assertions.assertEquals("cwsvlxotog", model.hierarchyInformation().configurationName()); - Assertions.assertEquals(SupportedFilterTypes.SHIP_TO_COUNTRIES, model.filterableProperty().get(0).type()); - Assertions.assertEquals("qsx", model.filterableProperty().get(0).supportedValues().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationFilters model = new ConfigurationFilters() - .withHierarchyInformation(new HierarchyInformation().withProductFamilyName("dqmh") - .withProductLineName("dhtldwkyz") - .withProductName("utknc") - .withConfigurationName("cwsvlxotog")) - .withFilterableProperty(Arrays.asList( - new FilterableProperty().withType(SupportedFilterTypes.SHIP_TO_COUNTRIES) - .withSupportedValues(Arrays.asList("qsx", "nmic", "kvceoveilovnotyf")), - new FilterableProperty().withType(SupportedFilterTypes.SHIP_TO_COUNTRIES) - .withSupportedValues(Arrays.asList("njbkcnxdhbttkph", "wpn", "jtoqne")), - new FilterableProperty().withType(SupportedFilterTypes.DOUBLE_ENCRYPTION_STATUS) - .withSupportedValues(Arrays.asList("lfplp")))); - model = BinaryData.fromObject(model).toObject(ConfigurationFilters.class); - Assertions.assertEquals("dqmh", model.hierarchyInformation().productFamilyName()); - Assertions.assertEquals("dhtldwkyz", model.hierarchyInformation().productLineName()); - Assertions.assertEquals("utknc", model.hierarchyInformation().productName()); - Assertions.assertEquals("cwsvlxotog", model.hierarchyInformation().configurationName()); - Assertions.assertEquals(SupportedFilterTypes.SHIP_TO_COUNTRIES, model.filterableProperty().get(0).type()); - Assertions.assertEquals("qsx", model.filterableProperty().get(0).supportedValues().get(0)); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ConfigurationsRequestTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ConfigurationsRequestTests.java deleted file mode 100644 index 2ab20ef81348..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ConfigurationsRequestTests.java +++ /dev/null @@ -1,102 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.models.ConfigurationFilters; -import com.azure.resourcemanager.edgeorder.models.ConfigurationsRequest; -import com.azure.resourcemanager.edgeorder.models.CustomerSubscriptionDetails; -import com.azure.resourcemanager.edgeorder.models.CustomerSubscriptionRegisteredFeatures; -import com.azure.resourcemanager.edgeorder.models.FilterableProperty; -import com.azure.resourcemanager.edgeorder.models.HierarchyInformation; -import com.azure.resourcemanager.edgeorder.models.SupportedFilterTypes; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ConfigurationsRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfigurationsRequest model = BinaryData.fromString( - "{\"configurationFilters\":[{\"hierarchyInformation\":{\"productFamilyName\":\"uzycispnqza\",\"productLineName\":\"gkbrpyyd\",\"productName\":\"bnuqqkpik\",\"configurationName\":\"rgvtqag\"},\"filterableProperty\":[{\"type\":\"DoubleEncryptionStatus\",\"supportedValues\":[\"hijggme\",\"fsiarbutr\",\"vpnazzm\"]},{\"type\":\"DoubleEncryptionStatus\",\"supportedValues\":[\"unmpxttd\",\"hrbnlankxmyskpbh\"]}]},{\"hierarchyInformation\":{\"productFamilyName\":\"btkcxywnytnrsyn\",\"productLineName\":\"idybyxczf\",\"productName\":\"haaxdbabphl\",\"configurationName\":\"qlfktsths\"},\"filterableProperty\":[{\"type\":\"DoubleEncryptionStatus\",\"supportedValues\":[\"nyyazttbtwwrqpue\",\"ckzywbiexzfeyue\"]},{\"type\":\"DoubleEncryptionStatus\",\"supportedValues\":[\"bxu\"]},{\"type\":\"ShipToCountries\",\"supportedValues\":[\"hqwa\",\"muzyoxaepdk\",\"jancu\",\"rhdwbavxbniw\"]},{\"type\":\"DoubleEncryptionStatus\",\"supportedValues\":[\"wz\",\"s\"]}]},{\"hierarchyInformation\":{\"productFamilyName\":\"pgn\",\"productLineName\":\"txhp\",\"productName\":\"bzpfzab\",\"configurationName\":\"cuh\"},\"filterableProperty\":[{\"type\":\"ShipToCountries\",\"supportedValues\":[\"yqiklbbovplwzb\"]}]}],\"customerSubscriptionDetails\":{\"registeredFeatures\":[{\"name\":\"gu\",\"state\":\"vmkfssxqu\"},{\"name\":\"fpl\",\"state\":\"gsxnkjzkdeslpv\"},{\"name\":\"pwiyig\",\"state\":\"pkdwzbai\"},{\"name\":\"bbaumnyquped\",\"state\":\"jn\"}],\"locationPlacementId\":\"ckhsmtxpsieb\",\"quotaId\":\"fhvpesaps\"}}") - .toObject(ConfigurationsRequest.class); - Assertions.assertEquals("uzycispnqza", - model.configurationFilters().get(0).hierarchyInformation().productFamilyName()); - Assertions.assertEquals("gkbrpyyd", - model.configurationFilters().get(0).hierarchyInformation().productLineName()); - Assertions.assertEquals("bnuqqkpik", model.configurationFilters().get(0).hierarchyInformation().productName()); - Assertions.assertEquals("rgvtqag", - model.configurationFilters().get(0).hierarchyInformation().configurationName()); - Assertions.assertEquals(SupportedFilterTypes.DOUBLE_ENCRYPTION_STATUS, - model.configurationFilters().get(0).filterableProperty().get(0).type()); - Assertions.assertEquals("hijggme", - model.configurationFilters().get(0).filterableProperty().get(0).supportedValues().get(0)); - Assertions.assertEquals("gu", model.customerSubscriptionDetails().registeredFeatures().get(0).name()); - Assertions.assertEquals("vmkfssxqu", model.customerSubscriptionDetails().registeredFeatures().get(0).state()); - Assertions.assertEquals("ckhsmtxpsieb", model.customerSubscriptionDetails().locationPlacementId()); - Assertions.assertEquals("fhvpesaps", model.customerSubscriptionDetails().quotaId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationsRequest model = new ConfigurationsRequest() - .withConfigurationFilters(Arrays.asList( - new ConfigurationFilters() - .withHierarchyInformation(new HierarchyInformation().withProductFamilyName("uzycispnqza") - .withProductLineName("gkbrpyyd") - .withProductName("bnuqqkpik") - .withConfigurationName("rgvtqag")) - .withFilterableProperty(Arrays.asList( - new FilterableProperty().withType(SupportedFilterTypes.DOUBLE_ENCRYPTION_STATUS) - .withSupportedValues(Arrays.asList("hijggme", "fsiarbutr", "vpnazzm")), - new FilterableProperty().withType(SupportedFilterTypes.DOUBLE_ENCRYPTION_STATUS) - .withSupportedValues(Arrays.asList("unmpxttd", "hrbnlankxmyskpbh")))), - new ConfigurationFilters() - .withHierarchyInformation(new HierarchyInformation().withProductFamilyName("btkcxywnytnrsyn") - .withProductLineName("idybyxczf") - .withProductName("haaxdbabphl") - .withConfigurationName("qlfktsths")) - .withFilterableProperty(Arrays.asList( - new FilterableProperty().withType(SupportedFilterTypes.DOUBLE_ENCRYPTION_STATUS) - .withSupportedValues(Arrays.asList("nyyazttbtwwrqpue", "ckzywbiexzfeyue")), - new FilterableProperty().withType(SupportedFilterTypes.DOUBLE_ENCRYPTION_STATUS) - .withSupportedValues(Arrays.asList("bxu")), - new FilterableProperty().withType(SupportedFilterTypes.SHIP_TO_COUNTRIES) - .withSupportedValues(Arrays.asList("hqwa", "muzyoxaepdk", "jancu", "rhdwbavxbniw")), - new FilterableProperty().withType(SupportedFilterTypes.DOUBLE_ENCRYPTION_STATUS) - .withSupportedValues(Arrays.asList("wz", "s")))), - new ConfigurationFilters() - .withHierarchyInformation(new HierarchyInformation().withProductFamilyName("pgn") - .withProductLineName("txhp") - .withProductName("bzpfzab") - .withConfigurationName("cuh")) - .withFilterableProperty( - Arrays.asList(new FilterableProperty().withType(SupportedFilterTypes.SHIP_TO_COUNTRIES) - .withSupportedValues(Arrays.asList("yqiklbbovplwzb")))))) - .withCustomerSubscriptionDetails(new CustomerSubscriptionDetails() - .withRegisteredFeatures( - Arrays.asList(new CustomerSubscriptionRegisteredFeatures().withName("gu").withState("vmkfssxqu"), - new CustomerSubscriptionRegisteredFeatures().withName("fpl").withState("gsxnkjzkdeslpv"), - new CustomerSubscriptionRegisteredFeatures().withName("pwiyig").withState("pkdwzbai"), - new CustomerSubscriptionRegisteredFeatures().withName("bbaumnyquped").withState("jn"))) - .withLocationPlacementId("ckhsmtxpsieb") - .withQuotaId("fhvpesaps")); - model = BinaryData.fromObject(model).toObject(ConfigurationsRequest.class); - Assertions.assertEquals("uzycispnqza", - model.configurationFilters().get(0).hierarchyInformation().productFamilyName()); - Assertions.assertEquals("gkbrpyyd", - model.configurationFilters().get(0).hierarchyInformation().productLineName()); - Assertions.assertEquals("bnuqqkpik", model.configurationFilters().get(0).hierarchyInformation().productName()); - Assertions.assertEquals("rgvtqag", - model.configurationFilters().get(0).hierarchyInformation().configurationName()); - Assertions.assertEquals(SupportedFilterTypes.DOUBLE_ENCRYPTION_STATUS, - model.configurationFilters().get(0).filterableProperty().get(0).type()); - Assertions.assertEquals("hijggme", - model.configurationFilters().get(0).filterableProperty().get(0).supportedValues().get(0)); - Assertions.assertEquals("gu", model.customerSubscriptionDetails().registeredFeatures().get(0).name()); - Assertions.assertEquals("vmkfssxqu", model.customerSubscriptionDetails().registeredFeatures().get(0).state()); - Assertions.assertEquals("ckhsmtxpsieb", model.customerSubscriptionDetails().locationPlacementId()); - Assertions.assertEquals("fhvpesaps", model.customerSubscriptionDetails().quotaId()); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ContactDetailsTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ContactDetailsTests.java deleted file mode 100644 index d750b0fe3067..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ContactDetailsTests.java +++ /dev/null @@ -1,39 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.models.ContactDetails; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ContactDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ContactDetails model = BinaryData.fromString( - "{\"contactName\":\"zfsinzgvf\",\"phone\":\"jrwzox\",\"phoneExtension\":\"tfell\",\"mobile\":\"fziton\",\"emailList\":[\"qfpjk\",\"lxofpdvhpfxxypin\"]}") - .toObject(ContactDetails.class); - Assertions.assertEquals("zfsinzgvf", model.contactName()); - Assertions.assertEquals("jrwzox", model.phone()); - Assertions.assertEquals("tfell", model.phoneExtension()); - Assertions.assertEquals("fziton", model.mobile()); - Assertions.assertEquals("qfpjk", model.emailList().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ContactDetails model = new ContactDetails().withContactName("zfsinzgvf") - .withPhone("jrwzox") - .withPhoneExtension("tfell") - .withMobile("fziton") - .withEmailList(Arrays.asList("qfpjk", "lxofpdvhpfxxypin")); - model = BinaryData.fromObject(model).toObject(ContactDetails.class); - Assertions.assertEquals("zfsinzgvf", model.contactName()); - Assertions.assertEquals("jrwzox", model.phone()); - Assertions.assertEquals("tfell", model.phoneExtension()); - Assertions.assertEquals("fziton", model.mobile()); - Assertions.assertEquals("qfpjk", model.emailList().get(0)); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/CostInformationTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/CostInformationTests.java deleted file mode 100644 index a3a1adc5db77..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/CostInformationTests.java +++ /dev/null @@ -1,23 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.models.CostInformation; - -public final class CostInformationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CostInformation model = BinaryData.fromString( - "{\"billingMeterDetails\":[{\"name\":\"cohoq\",\"meterDetails\":{\"billingType\":\"MeterDetails\",\"multiplier\":91.86179081647042,\"chargingType\":\"PerOrder\"},\"meteringType\":\"Recurring\",\"frequency\":\"hheunmmqhgyx\"},{\"name\":\"onocukok\",\"meterDetails\":{\"billingType\":\"MeterDetails\",\"multiplier\":34.33208577532343,\"chargingType\":\"PerOrder\"},\"meteringType\":\"OneTime\",\"frequency\":\"szfkbe\"},{\"name\":\"ewrmjmwvvjektc\",\"meterDetails\":{\"billingType\":\"MeterDetails\",\"multiplier\":86.37973121918075,\"chargingType\":\"PerOrder\"},\"meteringType\":\"Recurring\",\"frequency\":\"frzpwvlqdqgb\"},{\"name\":\"ylihkaetckt\",\"meterDetails\":{\"billingType\":\"MeterDetails\",\"multiplier\":31.469501726344753,\"chargingType\":\"PerDevice\"},\"meteringType\":\"Adhoc\",\"frequency\":\"m\"}],\"billingInfoUrl\":\"tqhjfbebrjcx\"}") - .toObject(CostInformation.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CostInformation model = new CostInformation(); - model = BinaryData.fromObject(model).toObject(CostInformation.class); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/CustomerSubscriptionDetailsTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/CustomerSubscriptionDetailsTests.java deleted file mode 100644 index ffb8a6eeed66..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/CustomerSubscriptionDetailsTests.java +++ /dev/null @@ -1,41 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.models.CustomerSubscriptionDetails; -import com.azure.resourcemanager.edgeorder.models.CustomerSubscriptionRegisteredFeatures; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class CustomerSubscriptionDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomerSubscriptionDetails model = BinaryData.fromString( - "{\"registeredFeatures\":[{\"name\":\"dgak\",\"state\":\"s\"},{\"name\":\"yb\",\"state\":\"qedqytbciqfoufl\"},{\"name\":\"nkzsmodmglou\",\"state\":\"b\"},{\"name\":\"tmut\",\"state\":\"qktapspwgcuert\"}],\"locationPlacementId\":\"kdosvqw\",\"quotaId\":\"bmdg\"}") - .toObject(CustomerSubscriptionDetails.class); - Assertions.assertEquals("dgak", model.registeredFeatures().get(0).name()); - Assertions.assertEquals("s", model.registeredFeatures().get(0).state()); - Assertions.assertEquals("kdosvqw", model.locationPlacementId()); - Assertions.assertEquals("bmdg", model.quotaId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomerSubscriptionDetails model = new CustomerSubscriptionDetails() - .withRegisteredFeatures( - Arrays.asList(new CustomerSubscriptionRegisteredFeatures().withName("dgak").withState("s"), - new CustomerSubscriptionRegisteredFeatures().withName("yb").withState("qedqytbciqfoufl"), - new CustomerSubscriptionRegisteredFeatures().withName("nkzsmodmglou").withState("b"), - new CustomerSubscriptionRegisteredFeatures().withName("tmut").withState("qktapspwgcuert"))) - .withLocationPlacementId("kdosvqw") - .withQuotaId("bmdg"); - model = BinaryData.fromObject(model).toObject(CustomerSubscriptionDetails.class); - Assertions.assertEquals("dgak", model.registeredFeatures().get(0).name()); - Assertions.assertEquals("s", model.registeredFeatures().get(0).state()); - Assertions.assertEquals("kdosvqw", model.locationPlacementId()); - Assertions.assertEquals("bmdg", model.quotaId()); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/CustomerSubscriptionRegisteredFeaturesTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/CustomerSubscriptionRegisteredFeaturesTests.java deleted file mode 100644 index 4bcd4373ed50..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/CustomerSubscriptionRegisteredFeaturesTests.java +++ /dev/null @@ -1,29 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.models.CustomerSubscriptionRegisteredFeatures; -import org.junit.jupiter.api.Assertions; - -public final class CustomerSubscriptionRegisteredFeaturesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomerSubscriptionRegisteredFeatures model - = BinaryData.fromString("{\"name\":\"jfddgmbmbe\",\"state\":\"pbhtqqrolfpfpsa\"}") - .toObject(CustomerSubscriptionRegisteredFeatures.class); - Assertions.assertEquals("jfddgmbmbe", model.name()); - Assertions.assertEquals("pbhtqqrolfpfpsa", model.state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomerSubscriptionRegisteredFeatures model - = new CustomerSubscriptionRegisteredFeatures().withName("jfddgmbmbe").withState("pbhtqqrolfpfpsa"); - model = BinaryData.fromObject(model).toObject(CustomerSubscriptionRegisteredFeatures.class); - Assertions.assertEquals("jfddgmbmbe", model.name()); - Assertions.assertEquals("pbhtqqrolfpfpsa", model.state()); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/DeviceDetailsTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/DeviceDetailsTests.java deleted file mode 100644 index efa60229567d..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/DeviceDetailsTests.java +++ /dev/null @@ -1,23 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.models.DeviceDetails; - -public final class DeviceDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeviceDetails model = BinaryData.fromString( - "{\"serialNumber\":\"fsynljphuop\",\"managementResourceId\":\"dlqiyntorzih\",\"managementResourceTenantId\":\"osjswsr\"}") - .toObject(DeviceDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeviceDetails model = new DeviceDetails(); - model = BinaryData.fromObject(model).toObject(DeviceDetails.class); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/DimensionsTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/DimensionsTests.java deleted file mode 100644 index a4a6fd494339..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/DimensionsTests.java +++ /dev/null @@ -1,23 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.models.Dimensions; - -public final class DimensionsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Dimensions model = BinaryData.fromString( - "{\"length\":82.52473018455325,\"height\":64.78703434319303,\"width\":72.90823386959359,\"lengthHeightUnit\":\"IN\",\"weight\":28.76282136834404,\"depth\":21.972088249516553,\"weightUnit\":\"LBS\"}") - .toObject(Dimensions.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Dimensions model = new Dimensions(); - model = BinaryData.fromObject(model).toObject(Dimensions.class); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/DisplayInfoTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/DisplayInfoTests.java deleted file mode 100644 index d81a8cc87e94..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/DisplayInfoTests.java +++ /dev/null @@ -1,23 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.models.DisplayInfo; - -public final class DisplayInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DisplayInfo model = BinaryData - .fromString("{\"productFamilyDisplayName\":\"bwwift\",\"configurationDisplayName\":\"qkvpuvksgplsakn\"}") - .toObject(DisplayInfo.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DisplayInfo model = new DisplayInfo(); - model = BinaryData.fromObject(model).toObject(DisplayInfo.class); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/EncryptionPreferencesTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/EncryptionPreferencesTests.java deleted file mode 100644 index 2d2824a3f797..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/EncryptionPreferencesTests.java +++ /dev/null @@ -1,27 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.models.DoubleEncryptionStatus; -import com.azure.resourcemanager.edgeorder.models.EncryptionPreferences; -import org.junit.jupiter.api.Assertions; - -public final class EncryptionPreferencesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EncryptionPreferences model - = BinaryData.fromString("{\"doubleEncryptionStatus\":\"Disabled\"}").toObject(EncryptionPreferences.class); - Assertions.assertEquals(DoubleEncryptionStatus.DISABLED, model.doubleEncryptionStatus()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EncryptionPreferences model - = new EncryptionPreferences().withDoubleEncryptionStatus(DoubleEncryptionStatus.DISABLED); - model = BinaryData.fromObject(model).toObject(EncryptionPreferences.class); - Assertions.assertEquals(DoubleEncryptionStatus.DISABLED, model.doubleEncryptionStatus()); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/FilterablePropertyTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/FilterablePropertyTests.java deleted file mode 100644 index 91b3d480964a..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/FilterablePropertyTests.java +++ /dev/null @@ -1,31 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.models.FilterableProperty; -import com.azure.resourcemanager.edgeorder.models.SupportedFilterTypes; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class FilterablePropertyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FilterableProperty model = BinaryData.fromString( - "{\"type\":\"ShipToCountries\",\"supportedValues\":[\"sgcbac\",\"hejkotynqgou\",\"zndlikwy\",\"kgfg\"]}") - .toObject(FilterableProperty.class); - Assertions.assertEquals(SupportedFilterTypes.SHIP_TO_COUNTRIES, model.type()); - Assertions.assertEquals("sgcbac", model.supportedValues().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FilterableProperty model = new FilterableProperty().withType(SupportedFilterTypes.SHIP_TO_COUNTRIES) - .withSupportedValues(Arrays.asList("sgcbac", "hejkotynqgou", "zndlikwy", "kgfg")); - model = BinaryData.fromObject(model).toObject(FilterableProperty.class); - Assertions.assertEquals(SupportedFilterTypes.SHIP_TO_COUNTRIES, model.type()); - Assertions.assertEquals("sgcbac", model.supportedValues().get(0)); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ForwardShippingDetailsTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ForwardShippingDetailsTests.java deleted file mode 100644 index 2afcfe5dd2bd..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ForwardShippingDetailsTests.java +++ /dev/null @@ -1,23 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.models.ForwardShippingDetails; - -public final class ForwardShippingDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ForwardShippingDetails model = BinaryData.fromString( - "{\"carrierName\":\"hwit\",\"carrierDisplayName\":\"ypyynpcdpumnzg\",\"trackingId\":\"z\",\"trackingUrl\":\"abikns\"}") - .toObject(ForwardShippingDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ForwardShippingDetails model = new ForwardShippingDetails(); - model = BinaryData.fromObject(model).toObject(ForwardShippingDetails.class); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/HierarchyInformationTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/HierarchyInformationTests.java deleted file mode 100644 index b065f60fa720..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/HierarchyInformationTests.java +++ /dev/null @@ -1,35 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.models.HierarchyInformation; -import org.junit.jupiter.api.Assertions; - -public final class HierarchyInformationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HierarchyInformation model = BinaryData.fromString( - "{\"productFamilyName\":\"bgsncghkjeszzhb\",\"productLineName\":\"htxfvgxbfsmxnehm\",\"productName\":\"ec\",\"configurationName\":\"odebfqkkrbmpu\"}") - .toObject(HierarchyInformation.class); - Assertions.assertEquals("bgsncghkjeszzhb", model.productFamilyName()); - Assertions.assertEquals("htxfvgxbfsmxnehm", model.productLineName()); - Assertions.assertEquals("ec", model.productName()); - Assertions.assertEquals("odebfqkkrbmpu", model.configurationName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HierarchyInformation model = new HierarchyInformation().withProductFamilyName("bgsncghkjeszzhb") - .withProductLineName("htxfvgxbfsmxnehm") - .withProductName("ec") - .withConfigurationName("odebfqkkrbmpu"); - model = BinaryData.fromObject(model).toObject(HierarchyInformation.class); - Assertions.assertEquals("bgsncghkjeszzhb", model.productFamilyName()); - Assertions.assertEquals("htxfvgxbfsmxnehm", model.productLineName()); - Assertions.assertEquals("ec", model.productName()); - Assertions.assertEquals("odebfqkkrbmpu", model.configurationName()); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ImageInformationTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ImageInformationTests.java deleted file mode 100644 index 733db3bcc59b..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ImageInformationTests.java +++ /dev/null @@ -1,22 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.models.ImageInformation; - -public final class ImageInformationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageInformation model = BinaryData.fromString("{\"imageType\":\"BulletImage\",\"imageUrl\":\"zrnkcqvyxlwh\"}") - .toObject(ImageInformation.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageInformation model = new ImageInformation(); - model = BinaryData.fromObject(model).toObject(ImageInformation.class); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/LinkTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/LinkTests.java deleted file mode 100644 index 8900e1751e80..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/LinkTests.java +++ /dev/null @@ -1,22 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.models.Link; - -public final class LinkTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Link model = BinaryData.fromString("{\"linkType\":\"Specification\",\"linkUrl\":\"ttmrywnuzoqf\"}") - .toObject(Link.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Link model = new Link(); - model = BinaryData.fromObject(model).toObject(Link.class); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ManagementResourcePreferencesTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ManagementResourcePreferencesTests.java deleted file mode 100644 index 382ab75a21f4..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ManagementResourcePreferencesTests.java +++ /dev/null @@ -1,27 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.models.ManagementResourcePreferences; -import org.junit.jupiter.api.Assertions; - -public final class ManagementResourcePreferencesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagementResourcePreferences model - = BinaryData.fromString("{\"preferredManagementResourceId\":\"ynkedyatrwyhqmib\"}") - .toObject(ManagementResourcePreferences.class); - Assertions.assertEquals("ynkedyatrwyhqmib", model.preferredManagementResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagementResourcePreferences model - = new ManagementResourcePreferences().withPreferredManagementResourceId("ynkedyatrwyhqmib"); - model = BinaryData.fromObject(model).toObject(ManagementResourcePreferences.class); - Assertions.assertEquals("ynkedyatrwyhqmib", model.preferredManagementResourceId()); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/MeterDetailsTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/MeterDetailsTests.java deleted file mode 100644 index 21308521a67c..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/MeterDetailsTests.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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.models.MeterDetails; - -public final class MeterDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MeterDetails model = BinaryData - .fromString( - "{\"billingType\":\"MeterDetails\",\"multiplier\":88.18883517379254,\"chargingType\":\"PerDevice\"}") - .toObject(MeterDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MeterDetails model = new MeterDetails(); - model = BinaryData.fromObject(model).toObject(MeterDetails.class); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/NotificationPreferenceTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/NotificationPreferenceTests.java deleted file mode 100644 index bc9c7f8b32e2..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/NotificationPreferenceTests.java +++ /dev/null @@ -1,29 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.models.NotificationPreference; -import com.azure.resourcemanager.edgeorder.models.NotificationStageName; -import org.junit.jupiter.api.Assertions; - -public final class NotificationPreferenceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NotificationPreference model = BinaryData.fromString("{\"stageName\":\"Delivered\",\"sendNotification\":true}") - .toObject(NotificationPreference.class); - Assertions.assertEquals(NotificationStageName.DELIVERED, model.stageName()); - Assertions.assertEquals(true, model.sendNotification()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NotificationPreference model - = new NotificationPreference().withStageName(NotificationStageName.DELIVERED).withSendNotification(true); - model = BinaryData.fromObject(model).toObject(NotificationPreference.class); - Assertions.assertEquals(NotificationStageName.DELIVERED, model.stageName()); - Assertions.assertEquals(true, model.sendNotification()); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/OperationDisplayTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/OperationDisplayTests.java deleted file mode 100644 index 0f0d36724c67..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/OperationDisplayTests.java +++ /dev/null @@ -1,23 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.models.OperationDisplay; - -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\"}") - .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/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/OperationInnerTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/OperationInnerTests.java deleted file mode 100644 index 8e4888b3eced..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/OperationInnerTests.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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.fluent.models.OperationInner; -import com.azure.resourcemanager.edgeorder.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\"}") - .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/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/OperationListResultTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/OperationListResultTests.java deleted file mode 100644 index 98f84a574c75..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/OperationListResultTests.java +++ /dev/null @@ -1,23 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.models.OperationListResult; - -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\"}") - .toObject(OperationListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ResourceProvidersListOperationsMockTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/OperationsListMockTests.java similarity index 54% rename from sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ResourceProvidersListOperationsMockTests.java rename to sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/OperationsListMockTests.java index aab80cff2cd6..3833e124cb04 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ResourceProvidersListOperationsMockTests.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/OperationsListMockTests.java @@ -1,37 +1,36 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.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.edgeorder.EdgeOrderManager; +import com.azure.resourcemanager.edgeorder.EdgeorderManager; import com.azure.resourcemanager.edgeorder.models.Operation; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class ResourceProvidersListOperationsMockTests { +public final class OperationsListMockTests { @Test - public void testListOperations() throws Exception { + public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"pdtii\",\"isDataAction\":true,\"display\":{\"provider\":\"oaxoruzfgsqu\",\"resource\":\"xrxxlep\",\"operation\":\"amxjezwlw\",\"description\":\"xuqlcvydypat\"},\"origin\":\"system\",\"actionType\":\"Internal\"}]}"; + = "{\"value\":[{\"name\":\"exrxzbujrtrhq\",\"isDataAction\":true,\"display\":{\"provider\":\"khgn\",\"resource\":\"zonzlrpiqywnc\",\"operation\":\"tszcofizehtdhgb\",\"description\":\"vreljea\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EdgeOrderManager manager = EdgeOrderManager.configure() + EdgeorderManager manager = EdgeorderManager.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.resourceProviders().listOperations(com.azure.core.util.Context.NONE); + PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ResourceProvidersCancelOrderItemWithResponseMockTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/OrderItemResourcesCancelWithResponseMockTests.java similarity index 61% rename from sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ResourceProvidersCancelOrderItemWithResponseMockTests.java rename to sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/OrderItemResourcesCancelWithResponseMockTests.java index 281228c4b820..624b56e4253a 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ResourceProvidersCancelOrderItemWithResponseMockTests.java +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/OrderItemResourcesCancelWithResponseMockTests.java @@ -1,35 +1,35 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgeorder.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.edgeorder.EdgeOrderManager; +import com.azure.resourcemanager.edgeorder.EdgeorderManager; import com.azure.resourcemanager.edgeorder.models.CancellationReason; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class ResourceProvidersCancelOrderItemWithResponseMockTests { +public final class OrderItemResourcesCancelWithResponseMockTests { @Test - public void testCancelOrderItemWithResponse() throws Exception { + public void testCancelWithResponse() throws Exception { String responseStr = "{}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EdgeOrderManager manager = EdgeOrderManager.configure() + EdgeorderManager manager = EdgeorderManager.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.resourceProviders() - .cancelOrderItemWithResponse("tmczuomejwcwwqi", "knssxmojm", new CancellationReason().withReason("vpkjpr"), + manager.orderItemResources() + .cancelWithResponse("xzjrgy", "wpgj", new CancellationReason().withReason("snptfujgicgaao"), com.azure.core.util.Context.NONE); } diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/OrderPropertiesTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/OrderPropertiesTests.java deleted file mode 100644 index 1a367f2ea078..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/OrderPropertiesTests.java +++ /dev/null @@ -1,23 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.fluent.models.OrderProperties; - -public final class OrderPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OrderProperties model = BinaryData.fromString( - "{\"orderItemIds\":[\"llwptfdy\",\"pfqbuaceopzf\",\"rhhuaopppcqeqx\"],\"currentStage\":{\"stageStatus\":\"Failed\",\"stageName\":\"ReturnCompleted\",\"displayName\":\"xcto\",\"startTime\":\"2021-01-13T03:12:52Z\"},\"orderStageHistory\":[{\"stageStatus\":\"None\",\"stageName\":\"Confirmed\",\"displayName\":\"ostmgrcf\",\"startTime\":\"2021-06-18T12:29:32Z\"},{\"stageStatus\":\"Failed\",\"stageName\":\"Delivered\",\"displayName\":\"hhkxbp\",\"startTime\":\"2021-06-05T07:23:31Z\"},{\"stageStatus\":\"None\",\"stageName\":\"ReturnInitiated\",\"displayName\":\"j\",\"startTime\":\"2021-11-25T10:52:17Z\"}]}") - .toObject(OrderProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OrderProperties model = new OrderProperties(); - model = BinaryData.fromObject(model).toObject(OrderProperties.class); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/OrderResourceInnerTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/OrderResourceInnerTests.java deleted file mode 100644 index 8377ade50a1e..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/OrderResourceInnerTests.java +++ /dev/null @@ -1,23 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.fluent.models.OrderResourceInner; - -public final class OrderResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OrderResourceInner model = BinaryData.fromString( - "{\"properties\":{\"orderItemIds\":[\"ouwaboekqvkeln\",\"mvb\",\"wyjsflhhcaalnjix\"],\"currentStage\":{\"stageStatus\":\"InProgress\",\"stageName\":\"InUse\",\"displayName\":\"oyaqcslyjpkiid\",\"startTime\":\"2021-08-31T19:18:26Z\"},\"orderStageHistory\":[{\"stageStatus\":\"Failed\",\"stageName\":\"ReadyToShip\",\"displayName\":\"hnrztfol\",\"startTime\":\"2021-01-02T16:04:01Z\"},{\"stageStatus\":\"InProgress\",\"stageName\":\"ReadyToShip\",\"displayName\":\"aulppggd\",\"startTime\":\"2021-08-03T06:29:07Z\"},{\"stageStatus\":\"Succeeded\",\"stageName\":\"Cancelled\",\"displayName\":\"ropuhpigv\",\"startTime\":\"2021-05-18T16:57:02Z\"},{\"stageStatus\":\"Cancelling\",\"stageName\":\"Shipped\",\"displayName\":\"txmedj\",\"startTime\":\"2021-08-05T01:47:52Z\"}]},\"id\":\"ynqwwncwzzhxgk\",\"name\":\"rmgucnap\",\"type\":\"t\"}") - .toObject(OrderResourceInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OrderResourceInner model = new OrderResourceInner(); - model = BinaryData.fromObject(model).toObject(OrderResourceInner.class); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/OrderResourceListTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/OrderResourceListTests.java deleted file mode 100644 index af82f1ee099e..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/OrderResourceListTests.java +++ /dev/null @@ -1,26 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.models.OrderResourceList; -import org.junit.jupiter.api.Assertions; - -public final class OrderResourceListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OrderResourceList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"orderItemIds\":[\"twm\",\"dytdxwitx\"],\"currentStage\":{\"stageStatus\":\"InProgress\",\"stageName\":\"Confirmed\",\"displayName\":\"wgxhn\",\"startTime\":\"2021-10-10T16:17:48Z\"},\"orderStageHistory\":[{\"stageStatus\":\"InProgress\",\"stageName\":\"InReview\",\"displayName\":\"gklwn\",\"startTime\":\"2021-09-10T01:27:47Z\"}]},\"id\":\"dauwhvylwzbtd\",\"name\":\"xujznbmpowu\",\"type\":\"przqlveu\"},{\"properties\":{\"orderItemIds\":[\"pjmkhfxobbc\"],\"currentStage\":{\"stageStatus\":\"None\",\"stageName\":\"InReview\",\"displayName\":\"iplrbpbewtghfgb\",\"startTime\":\"2021-09-03T22:44:02Z\"},\"orderStageHistory\":[{\"stageStatus\":\"Failed\",\"stageName\":\"ReturnInitiated\",\"displayName\":\"hjkbegibtnmxieb\",\"startTime\":\"2021-07-30T14:06:14Z\"},{\"stageStatus\":\"Cancelling\",\"stageName\":\"Placed\",\"displayName\":\"cgwrtzjuz\",\"startTime\":\"2021-05-25T01:21:12Z\"},{\"stageStatus\":\"Failed\",\"stageName\":\"Cancelled\",\"displayName\":\"ongmtsa\",\"startTime\":\"2021-08-01T14:59:29Z\"},{\"stageStatus\":\"InProgress\",\"stageName\":\"Shipped\",\"displayName\":\"p\",\"startTime\":\"2021-07-31T13:26:15Z\"}]},\"id\":\"ftguv\",\"name\":\"iuhprwmdyvxqta\",\"type\":\"riwwroy\"},{\"properties\":{\"orderItemIds\":[\"xrmcqibycnojvk\",\"mefqsgzvahapjyzh\",\"vgqzcjrvxd\",\"zlmwlxkvugfhz\"],\"currentStage\":{\"stageStatus\":\"Cancelled\",\"stageName\":\"ReadyToShip\",\"displayName\":\"u\",\"startTime\":\"2021-02-16T01:55:44Z\"},\"orderStageHistory\":[{\"stageStatus\":\"Cancelling\",\"stageName\":\"ReturnedToMicrosoft\",\"displayName\":\"i\",\"startTime\":\"2021-04-28T10:05:56Z\"},{\"stageStatus\":\"InProgress\",\"stageName\":\"Cancelled\",\"displayName\":\"aejxd\",\"startTime\":\"2021-01-14T03:20:45Z\"}]},\"id\":\"kzbbtd\",\"name\":\"umveekgpwozuhkf\",\"type\":\"bsjyofdx\"}],\"nextLink\":\"us\"}") - .toObject(OrderResourceList.class); - Assertions.assertEquals("us", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OrderResourceList model = new OrderResourceList().withNextLink("us"); - model = BinaryData.fromObject(model).toObject(OrderResourceList.class); - Assertions.assertEquals("us", model.nextLink()); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/OrderResourcesGetWithResponseMockTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/OrderResourcesGetWithResponseMockTests.java new file mode 100644 index 000000000000..2de973b6c95f --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/OrderResourcesGetWithResponseMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.edgeorder.EdgeorderManager; +import com.azure.resourcemanager.edgeorder.models.OrderResource; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class OrderResourcesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"orderItemIds\":[\"xff\",\"shkwfbkgozxwopd\",\"yd\"],\"currentStage\":{\"stageStatus\":\"Failed\",\"stageName\":\"Placed\",\"displayName\":\"napxbiygnug\",\"startTime\":\"2021-11-17T11:32:04Z\"},\"orderStageHistory\":[{\"stageStatus\":\"Cancelled\",\"stageName\":\"Confirmed\",\"displayName\":\"uxuuyilflq\",\"startTime\":\"2021-01-23T22:11:32Z\"},{\"stageStatus\":\"None\",\"stageName\":\"Shipped\",\"displayName\":\"mrnjh\",\"startTime\":\"2021-11-15T07:49:24Z\"},{\"stageStatus\":\"Failed\",\"stageName\":\"ReadyToSetup\",\"displayName\":\"ytqj\",\"startTime\":\"2021-01-25T05:03:18Z\"},{\"stageStatus\":\"None\",\"stageName\":\"InUse\",\"displayName\":\"prnjletlxsmr\",\"startTime\":\"2021-01-20T22:12:31Z\"}],\"orderMode\":\"DoNotFulfill\"},\"id\":\"fa\",\"name\":\"owa\",\"type\":\"iynknlq\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + EdgeorderManager manager = EdgeorderManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + OrderResource response = manager.orderResources() + .getWithResponse("ra", "zvzbglbyv", "ctctbrxkjz", com.azure.core.util.Context.NONE) + .getValue(); + + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/OrdersOperationGroupsListByResourceGroupMockTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/OrdersOperationGroupsListByResourceGroupMockTests.java new file mode 100644 index 000000000000..35b2cd98fd35 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/OrdersOperationGroupsListByResourceGroupMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.edgeorder.EdgeorderManager; +import com.azure.resourcemanager.edgeorder.models.OrderResource; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class OrdersOperationGroupsListByResourceGroupMockTests { + @Test + public void testListByResourceGroup() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"orderItemIds\":[\"mflhuytxzvtznapx\",\"annovvoxczytpr\",\"nwvroevytlyokrr\"],\"currentStage\":{\"stageStatus\":\"Cancelled\",\"stageName\":\"ReturnedToMicrosoft\",\"displayName\":\"sasbcrymodizrx\",\"startTime\":\"2021-09-13T08:25:19Z\"},\"orderStageHistory\":[{\"stageStatus\":\"InProgress\",\"stageName\":\"Placed\",\"displayName\":\"mkmlmvevfx\",\"startTime\":\"2021-01-15T09:03:10Z\"}],\"orderMode\":\"Default\"},\"id\":\"zxlioh\",\"name\":\"d\",\"type\":\"dtfgxqbawpcbb\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + EdgeorderManager manager = EdgeorderManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.ordersOperationGroups() + .listByResourceGroup("h", "qdtvqecrqctmxx", 1236882459, com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/OrdersOperationGroupsListMockTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/OrdersOperationGroupsListMockTests.java new file mode 100644 index 000000000000..215db170f1f5 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/OrdersOperationGroupsListMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeorder.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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.edgeorder.EdgeorderManager; +import com.azure.resourcemanager.edgeorder.models.OrderResource; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class OrdersOperationGroupsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"orderItemIds\":[\"dulontacn\",\"qwtehtuevr\"],\"currentStage\":{\"stageStatus\":\"Failed\",\"stageName\":\"ReturnCompleted\",\"displayName\":\"gwxhnsduugwbsreu\",\"startTime\":\"2021-08-12T00:06:39Z\"},\"orderStageHistory\":[{\"stageStatus\":\"Succeeded\",\"stageName\":\"Shipped\",\"displayName\":\"lvhhtklnvn\",\"startTime\":\"2021-09-08T16:13:33Z\"},{\"stageStatus\":\"Failed\",\"stageName\":\"ReturnCompleted\",\"displayName\":\"devjb\",\"startTime\":\"2021-06-23T11:56:40Z\"},{\"stageStatus\":\"None\",\"stageName\":\"ReturnedToMicrosoft\",\"displayName\":\"okkhminq\",\"startTime\":\"2021-04-03T03:13:08Z\"}],\"orderMode\":\"Default\"},\"id\":\"gn\",\"name\":\"dxxewuninv\",\"type\":\"db\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + EdgeorderManager manager = EdgeorderManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.ordersOperationGroups().list("zoyw", 1919960687, com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/Pav2MeterDetailsTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/Pav2MeterDetailsTests.java deleted file mode 100644 index 06dff15a5a51..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/Pav2MeterDetailsTests.java +++ /dev/null @@ -1,23 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.models.Pav2MeterDetails; - -public final class Pav2MeterDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Pav2MeterDetails model = BinaryData.fromString( - "{\"billingType\":\"Pav2\",\"meterGuid\":\"ud\",\"multiplier\":10.95765880828754,\"chargingType\":\"PerDevice\"}") - .toObject(Pav2MeterDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Pav2MeterDetails model = new Pav2MeterDetails(); - model = BinaryData.fromObject(model).toObject(Pav2MeterDetails.class); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/PreferencesTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/PreferencesTests.java deleted file mode 100644 index 6545bfede450..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/PreferencesTests.java +++ /dev/null @@ -1,55 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.models.DoubleEncryptionStatus; -import com.azure.resourcemanager.edgeorder.models.EncryptionPreferences; -import com.azure.resourcemanager.edgeorder.models.ManagementResourcePreferences; -import com.azure.resourcemanager.edgeorder.models.NotificationPreference; -import com.azure.resourcemanager.edgeorder.models.NotificationStageName; -import com.azure.resourcemanager.edgeorder.models.Preferences; -import com.azure.resourcemanager.edgeorder.models.TransportPreferences; -import com.azure.resourcemanager.edgeorder.models.TransportShipmentTypes; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PreferencesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Preferences model = BinaryData.fromString( - "{\"notificationPreferences\":[{\"stageName\":\"Delivered\",\"sendNotification\":false},{\"stageName\":\"Delivered\",\"sendNotification\":false},{\"stageName\":\"Delivered\",\"sendNotification\":true},{\"stageName\":\"Shipped\",\"sendNotification\":true}],\"transportPreferences\":{\"preferredShipmentType\":\"MicrosoftManaged\"},\"encryptionPreferences\":{\"doubleEncryptionStatus\":\"Enabled\"},\"managementResourcePreferences\":{\"preferredManagementResourceId\":\"ox\"}}") - .toObject(Preferences.class); - Assertions.assertEquals(NotificationStageName.DELIVERED, model.notificationPreferences().get(0).stageName()); - Assertions.assertEquals(false, model.notificationPreferences().get(0).sendNotification()); - Assertions.assertEquals(TransportShipmentTypes.MICROSOFT_MANAGED, - model.transportPreferences().preferredShipmentType()); - Assertions.assertEquals(DoubleEncryptionStatus.ENABLED, model.encryptionPreferences().doubleEncryptionStatus()); - Assertions.assertEquals("ox", model.managementResourcePreferences().preferredManagementResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Preferences model = new Preferences() - .withNotificationPreferences(Arrays.asList( - new NotificationPreference().withStageName(NotificationStageName.DELIVERED).withSendNotification(false), - new NotificationPreference().withStageName(NotificationStageName.DELIVERED).withSendNotification(false), - new NotificationPreference().withStageName(NotificationStageName.DELIVERED).withSendNotification(true), - new NotificationPreference().withStageName(NotificationStageName.SHIPPED).withSendNotification(true))) - .withTransportPreferences( - new TransportPreferences().withPreferredShipmentType(TransportShipmentTypes.MICROSOFT_MANAGED)) - .withEncryptionPreferences( - new EncryptionPreferences().withDoubleEncryptionStatus(DoubleEncryptionStatus.ENABLED)) - .withManagementResourcePreferences( - new ManagementResourcePreferences().withPreferredManagementResourceId("ox")); - model = BinaryData.fromObject(model).toObject(Preferences.class); - Assertions.assertEquals(NotificationStageName.DELIVERED, model.notificationPreferences().get(0).stageName()); - Assertions.assertEquals(false, model.notificationPreferences().get(0).sendNotification()); - Assertions.assertEquals(TransportShipmentTypes.MICROSOFT_MANAGED, - model.transportPreferences().preferredShipmentType()); - Assertions.assertEquals(DoubleEncryptionStatus.ENABLED, model.encryptionPreferences().doubleEncryptionStatus()); - Assertions.assertEquals("ox", model.managementResourcePreferences().preferredManagementResourceId()); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ProductDetailsTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ProductDetailsTests.java deleted file mode 100644 index 5e72089984db..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ProductDetailsTests.java +++ /dev/null @@ -1,38 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.models.DisplayInfo; -import com.azure.resourcemanager.edgeorder.models.HierarchyInformation; -import com.azure.resourcemanager.edgeorder.models.ProductDetails; -import org.junit.jupiter.api.Assertions; - -public final class ProductDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProductDetails model = BinaryData.fromString( - "{\"displayInfo\":{\"productFamilyDisplayName\":\"sipqii\",\"configurationDisplayName\":\"yuq\"},\"hierarchyInformation\":{\"productFamilyName\":\"pqlpq\",\"productLineName\":\"ciuqgbdb\",\"productName\":\"auvfbtkuwhhmhyk\",\"configurationName\":\"oxafn\"},\"count\":1456966010,\"productDoubleEncryptionStatus\":\"Enabled\",\"deviceDetails\":[{\"serialNumber\":\"o\",\"managementResourceId\":\"kcdyhbpk\",\"managementResourceTenantId\":\"wdreqnovvqfovl\"},{\"serialNumber\":\"ywsuwsy\",\"managementResourceId\":\"ndsytgadg\",\"managementResourceTenantId\":\"aeaeneqnzarrw\"},{\"serialNumber\":\"uu\",\"managementResourceId\":\"fqka\",\"managementResourceTenantId\":\"wiipfpub\"}]}") - .toObject(ProductDetails.class); - Assertions.assertEquals("pqlpq", model.hierarchyInformation().productFamilyName()); - Assertions.assertEquals("ciuqgbdb", model.hierarchyInformation().productLineName()); - Assertions.assertEquals("auvfbtkuwhhmhyk", model.hierarchyInformation().productName()); - Assertions.assertEquals("oxafn", model.hierarchyInformation().configurationName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProductDetails model = new ProductDetails().withDisplayInfo(new DisplayInfo()) - .withHierarchyInformation(new HierarchyInformation().withProductFamilyName("pqlpq") - .withProductLineName("ciuqgbdb") - .withProductName("auvfbtkuwhhmhyk") - .withConfigurationName("oxafn")); - model = BinaryData.fromObject(model).toObject(ProductDetails.class); - Assertions.assertEquals("pqlpq", model.hierarchyInformation().productFamilyName()); - Assertions.assertEquals("ciuqgbdb", model.hierarchyInformation().productLineName()); - Assertions.assertEquals("auvfbtkuwhhmhyk", model.hierarchyInformation().productName()); - Assertions.assertEquals("oxafn", model.hierarchyInformation().configurationName()); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ProductFamiliesRequestTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ProductFamiliesRequestTests.java deleted file mode 100644 index 8f3ea6418ef1..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ProductFamiliesRequestTests.java +++ /dev/null @@ -1,84 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.models.CustomerSubscriptionDetails; -import com.azure.resourcemanager.edgeorder.models.CustomerSubscriptionRegisteredFeatures; -import com.azure.resourcemanager.edgeorder.models.FilterableProperty; -import com.azure.resourcemanager.edgeorder.models.ProductFamiliesRequest; -import com.azure.resourcemanager.edgeorder.models.SupportedFilterTypes; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ProductFamiliesRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProductFamiliesRequest model = BinaryData.fromString( - "{\"filterableProperties\":{\"xbnjbiksq\":[{\"type\":\"ShipToCountries\",\"supportedValues\":[\"huyb\",\"kpode\",\"ooginuvamih\"]},{\"type\":\"DoubleEncryptionStatus\",\"supportedValues\":[\"narxzxtheotus\",\"vyevcciqi\",\"nhungbw\"]},{\"type\":\"ShipToCountries\",\"supportedValues\":[\"nfygxgispemvtz\",\"kufubljo\",\"xqeofjaeqjhqjba\"]},{\"type\":\"ShipToCountries\",\"supportedValues\":[\"smjqulngsntnbyb\",\"zgcwrw\",\"lxxwrljdouskc\",\"vkocrcjdkwtn\"]}],\"yqduujit\":[{\"type\":\"ShipToCountries\",\"supportedValues\":[\"sainqpjwnzl\",\"jfm\",\"pee\",\"vmgxsab\"]}],\"zdatqxhocdg\":[{\"type\":\"ShipToCountries\",\"supportedValues\":[\"dzevndhkrw\",\"d\"]},{\"type\":\"DoubleEncryptionStatus\",\"supportedValues\":[\"dsbdkvwrwjf\"]},{\"type\":\"ShipToCountries\",\"supportedValues\":[\"nhutjeltmrldhugj\"]}]},\"customerSubscriptionDetails\":{\"registeredFeatures\":[{\"name\":\"phut\",\"state\":\"ndv\"},{\"name\":\"ozwyiftyhxhuro\",\"state\":\"tyxolniwpwc\"}],\"locationPlacementId\":\"jfkgiawxk\",\"quotaId\":\"ryplwckbasyypn\"}}") - .toObject(ProductFamiliesRequest.class); - Assertions.assertEquals(SupportedFilterTypes.SHIP_TO_COUNTRIES, - model.filterableProperties().get("xbnjbiksq").get(0).type()); - Assertions.assertEquals("huyb", model.filterableProperties().get("xbnjbiksq").get(0).supportedValues().get(0)); - Assertions.assertEquals("phut", model.customerSubscriptionDetails().registeredFeatures().get(0).name()); - Assertions.assertEquals("ndv", model.customerSubscriptionDetails().registeredFeatures().get(0).state()); - Assertions.assertEquals("jfkgiawxk", model.customerSubscriptionDetails().locationPlacementId()); - Assertions.assertEquals("ryplwckbasyypn", model.customerSubscriptionDetails().quotaId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProductFamiliesRequest model = new ProductFamiliesRequest() - .withFilterableProperties(mapOf("xbnjbiksq", Arrays.asList( - new FilterableProperty().withType(SupportedFilterTypes.SHIP_TO_COUNTRIES) - .withSupportedValues(Arrays.asList("huyb", "kpode", "ooginuvamih")), - new FilterableProperty().withType(SupportedFilterTypes.DOUBLE_ENCRYPTION_STATUS) - .withSupportedValues(Arrays.asList("narxzxtheotus", "vyevcciqi", "nhungbw")), - new FilterableProperty().withType(SupportedFilterTypes.SHIP_TO_COUNTRIES) - .withSupportedValues(Arrays.asList("nfygxgispemvtz", "kufubljo", "xqeofjaeqjhqjba")), - new FilterableProperty().withType(SupportedFilterTypes.SHIP_TO_COUNTRIES) - .withSupportedValues(Arrays.asList("smjqulngsntnbyb", "zgcwrw", "lxxwrljdouskc", "vkocrcjdkwtn"))), - "yqduujit", - Arrays.asList(new FilterableProperty().withType(SupportedFilterTypes.SHIP_TO_COUNTRIES) - .withSupportedValues(Arrays.asList("sainqpjwnzl", "jfm", "pee", "vmgxsab"))), - "zdatqxhocdg", - Arrays.asList( - new FilterableProperty().withType(SupportedFilterTypes.SHIP_TO_COUNTRIES) - .withSupportedValues(Arrays.asList("dzevndhkrw", "d")), - new FilterableProperty().withType(SupportedFilterTypes.DOUBLE_ENCRYPTION_STATUS) - .withSupportedValues(Arrays.asList("dsbdkvwrwjf")), - new FilterableProperty().withType(SupportedFilterTypes.SHIP_TO_COUNTRIES) - .withSupportedValues(Arrays.asList("nhutjeltmrldhugj"))))) - .withCustomerSubscriptionDetails(new CustomerSubscriptionDetails() - .withRegisteredFeatures( - Arrays.asList(new CustomerSubscriptionRegisteredFeatures().withName("phut").withState("ndv"), - new CustomerSubscriptionRegisteredFeatures().withName("ozwyiftyhxhuro") - .withState("tyxolniwpwc"))) - .withLocationPlacementId("jfkgiawxk") - .withQuotaId("ryplwckbasyypn")); - model = BinaryData.fromObject(model).toObject(ProductFamiliesRequest.class); - Assertions.assertEquals(SupportedFilterTypes.SHIP_TO_COUNTRIES, - model.filterableProperties().get("xbnjbiksq").get(0).type()); - Assertions.assertEquals("huyb", model.filterableProperties().get("xbnjbiksq").get(0).supportedValues().get(0)); - Assertions.assertEquals("phut", model.customerSubscriptionDetails().registeredFeatures().get(0).name()); - Assertions.assertEquals("ndv", model.customerSubscriptionDetails().registeredFeatures().get(0).state()); - Assertions.assertEquals("jfkgiawxk", model.customerSubscriptionDetails().locationPlacementId()); - Assertions.assertEquals("ryplwckbasyypn", model.customerSubscriptionDetails().quotaId()); - } - - // 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; - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/PurchaseMeterDetailsTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/PurchaseMeterDetailsTests.java deleted file mode 100644 index 5bf2f7eaa756..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/PurchaseMeterDetailsTests.java +++ /dev/null @@ -1,23 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.models.PurchaseMeterDetails; - -public final class PurchaseMeterDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PurchaseMeterDetails model = BinaryData.fromString( - "{\"billingType\":\"Purchase\",\"productId\":\"hzv\",\"skuId\":\"tdwkqbrq\",\"termId\":\"paxh\",\"multiplier\":86.79135891079454,\"chargingType\":\"PerOrder\"}") - .toObject(PurchaseMeterDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PurchaseMeterDetails model = new PurchaseMeterDetails(); - model = BinaryData.fromObject(model).toObject(PurchaseMeterDetails.class); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderDetailsTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderDetailsTests.java deleted file mode 100644 index 4738d03de59e..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ResourceProviderDetailsTests.java +++ /dev/null @@ -1,22 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.models.ResourceProviderDetails; - -public final class ResourceProviderDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceProviderDetails model = BinaryData.fromString("{\"resourceProviderNamespace\":\"riwflzlfb\"}") - .toObject(ResourceProviderDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceProviderDetails model = new ResourceProviderDetails(); - model = BinaryData.fromObject(model).toObject(ResourceProviderDetails.class); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ResourceProvidersDeleteMockTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ResourceProvidersDeleteMockTests.java deleted file mode 100644 index 147152c633ca..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ResourceProvidersDeleteMockTests.java +++ /dev/null @@ -1,33 +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.edgeorder.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.test.http.MockHttpResponse; -import com.azure.resourcemanager.edgeorder.EdgeOrderManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ResourceProvidersDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EdgeOrderManager manager = EdgeOrderManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.resourceProviders().delete("pvuzlmv", "elfk", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ResourceProvidersDeleteOrderItemByNameMockTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ResourceProvidersDeleteOrderItemByNameMockTests.java deleted file mode 100644 index 797e373fb99f..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ResourceProvidersDeleteOrderItemByNameMockTests.java +++ /dev/null @@ -1,33 +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.edgeorder.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.test.http.MockHttpResponse; -import com.azure.resourcemanager.edgeorder.EdgeOrderManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ResourceProvidersDeleteOrderItemByNameMockTests { - @Test - public void testDeleteOrderItemByName() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EdgeOrderManager manager = EdgeOrderManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.resourceProviders().deleteOrderItemByName("qfzgemjdftul", "ltducea", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ResourceProvidersGetOrderByNameWithResponseMockTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ResourceProvidersGetOrderByNameWithResponseMockTests.java deleted file mode 100644 index 428238ea7675..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ResourceProvidersGetOrderByNameWithResponseMockTests.java +++ /dev/null @@ -1,37 +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.edgeorder.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.test.http.MockHttpResponse; -import com.azure.resourcemanager.edgeorder.EdgeOrderManager; -import com.azure.resourcemanager.edgeorder.models.OrderResource; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ResourceProvidersGetOrderByNameWithResponseMockTests { - @Test - public void testGetOrderByNameWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"orderItemIds\":[\"lrcoolsttpki\"],\"currentStage\":{\"stageStatus\":\"Succeeded\",\"stageName\":\"Delivered\",\"displayName\":\"rywvtylbfpn\",\"startTime\":\"2021-10-05T21:52:34Z\"},\"orderStageHistory\":[{\"stageStatus\":\"None\",\"stageName\":\"Shipped\",\"displayName\":\"htywubxcbihwq\",\"startTime\":\"2021-06-27T00:09:55Z\"},{\"stageStatus\":\"Failed\",\"stageName\":\"Cancelled\",\"displayName\":\"chrdgoihxumwcto\",\"startTime\":\"2021-07-09T14:12:15Z\"},{\"stageStatus\":\"Cancelling\",\"stageName\":\"Shipped\",\"displayName\":\"fdlwg\",\"startTime\":\"2021-04-25T18:49:42Z\"}]},\"id\":\"bwtovvtgseinqf\",\"name\":\"ufxqknpirgnepttw\",\"type\":\"msniffc\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EdgeOrderManager manager = EdgeOrderManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OrderResource response = manager.resourceProviders() - .getOrderByNameWithResponse("xqupevzhf", "totxhojujb", "pelmcuvhixbjxyf", com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ResourceProvidersListOrderAtResourceGroupLevelMockTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ResourceProvidersListOrderAtResourceGroupLevelMockTests.java deleted file mode 100644 index 0c702dd68088..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ResourceProvidersListOrderAtResourceGroupLevelMockTests.java +++ /dev/null @@ -1,37 +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.edgeorder.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.test.http.MockHttpResponse; -import com.azure.resourcemanager.edgeorder.EdgeOrderManager; -import com.azure.resourcemanager.edgeorder.models.OrderResource; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ResourceProvidersListOrderAtResourceGroupLevelMockTests { - @Test - public void testListOrderAtResourceGroupLevel() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"orderItemIds\":[\"agfhsxtta\",\"gzxnfaazpxdtnk\",\"mkqjj\"],\"currentStage\":{\"stageStatus\":\"None\",\"stageName\":\"InReview\",\"displayName\":\"kpyouaibrebqaay\",\"startTime\":\"2021-03-27T04:31:49Z\"},\"orderStageHistory\":[{\"stageStatus\":\"Succeeded\",\"stageName\":\"Delivered\",\"displayName\":\"tezlwff\",\"startTime\":\"2021-10-31T02:18:42Z\"},{\"stageStatus\":\"Cancelled\",\"stageName\":\"Cancelled\",\"displayName\":\"qmt\",\"startTime\":\"2021-03-16T18:33:01Z\"}]},\"id\":\"mmji\",\"name\":\"yeozphvwauyqncy\",\"type\":\"upkvipmdsc\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EdgeOrderManager manager = EdgeOrderManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.resourceProviders() - .listOrderAtResourceGroupLevel("gplcrpwjxeznoigb", "njwmwkpnbsazejj", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ResourceProvidersListOrderAtSubscriptionLevelMockTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ResourceProvidersListOrderAtSubscriptionLevelMockTests.java deleted file mode 100644 index a4817cb9791d..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/ResourceProvidersListOrderAtSubscriptionLevelMockTests.java +++ /dev/null @@ -1,37 +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.edgeorder.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.test.http.MockHttpResponse; -import com.azure.resourcemanager.edgeorder.EdgeOrderManager; -import com.azure.resourcemanager.edgeorder.models.OrderResource; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ResourceProvidersListOrderAtSubscriptionLevelMockTests { - @Test - public void testListOrderAtSubscriptionLevel() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"orderItemIds\":[\"ofel\",\"a\"],\"currentStage\":{\"stageStatus\":\"Cancelled\",\"stageName\":\"Shipped\",\"displayName\":\"dvriiiojnal\",\"startTime\":\"2021-06-23T19:51:13Z\"},\"orderStageHistory\":[{\"stageStatus\":\"Failed\",\"stageName\":\"ReturnPickedUp\",\"displayName\":\"sowueluqhhahhx\",\"startTime\":\"2021-01-10T01:08:15Z\"},{\"stageStatus\":\"Succeeded\",\"stageName\":\"InUse\",\"displayName\":\"jgwwspughftq\",\"startTime\":\"2021-10-21T10:21:41Z\"},{\"stageStatus\":\"Succeeded\",\"stageName\":\"ReturnPickedUp\",\"displayName\":\"ukndxdigrjgu\",\"startTime\":\"2021-02-16T11:30:47Z\"},{\"stageStatus\":\"Failed\",\"stageName\":\"InUse\",\"displayName\":\"tfih\",\"startTime\":\"2021-09-15T16:26:55Z\"}]},\"id\":\"tzingamvpph\",\"name\":\"szqzudphqamv\",\"type\":\"kfwynw\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EdgeOrderManager manager = EdgeOrderManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.resourceProviders().listOrderAtSubscriptionLevel("dhszfjv", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/SpecificationTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/SpecificationTests.java deleted file mode 100644 index 841e0798d486..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/SpecificationTests.java +++ /dev/null @@ -1,22 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.models.Specification; - -public final class SpecificationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Specification model - = BinaryData.fromString("{\"name\":\"npc\",\"value\":\"ocohslkevleg\"}").toObject(Specification.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Specification model = new Specification(); - model = BinaryData.fromObject(model).toObject(Specification.class); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/StageDetailsTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/StageDetailsTests.java deleted file mode 100644 index 53922686855c..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/StageDetailsTests.java +++ /dev/null @@ -1,23 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.models.StageDetails; - -public final class StageDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StageDetails model = BinaryData.fromString( - "{\"stageStatus\":\"None\",\"stageName\":\"Confirmed\",\"displayName\":\"r\",\"startTime\":\"2021-10-05T00:25:34Z\"}") - .toObject(StageDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StageDetails model = new StageDetails(); - model = BinaryData.fromObject(model).toObject(StageDetails.class); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/TransportPreferencesTests.java b/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/TransportPreferencesTests.java deleted file mode 100644 index 503f2a3d69f5..000000000000 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/src/test/java/com/azure/resourcemanager/edgeorder/generated/TransportPreferencesTests.java +++ /dev/null @@ -1,27 +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.edgeorder.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgeorder.models.TransportPreferences; -import com.azure.resourcemanager.edgeorder.models.TransportShipmentTypes; -import org.junit.jupiter.api.Assertions; - -public final class TransportPreferencesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TransportPreferences model = BinaryData.fromString("{\"preferredShipmentType\":\"CustomerManaged\"}") - .toObject(TransportPreferences.class); - Assertions.assertEquals(TransportShipmentTypes.CUSTOMER_MANAGED, model.preferredShipmentType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TransportPreferences model - = new TransportPreferences().withPreferredShipmentType(TransportShipmentTypes.CUSTOMER_MANAGED); - model = BinaryData.fromObject(model).toObject(TransportPreferences.class); - Assertions.assertEquals(TransportShipmentTypes.CUSTOMER_MANAGED, model.preferredShipmentType()); - } -} diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/tsp-location.yaml b/sdk/edgeorder/azure-resourcemanager-edgeorder/tsp-location.yaml new file mode 100644 index 000000000000..a986b7ea2d37 --- /dev/null +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/edgeorder/EdgeOrder.Management +commit: 1114538fd24217b94902430aa2f9b227f5c55727 +repo: Azure/azure-rest-api-specs +additionalDirectories: